<commit_before>from __future__ import division

import math
import numpy as np
import pyviennacl as p
import scipy.sparse.linalg as spspla
from _common import *
from itertools import product

points_x_y = 5

if double_support:
    dtype_tolerances = [('float64', 1.0E-5)]
else:
    dtype_tolerances = [('float32', 1.0E-3)]


matrix_types = [('compressed_matrix', 'p.CompressedMatrix'),
                ('coordinate_matrix', 'p.CoordinateMatrix'),
                ('ell_matrix', 'p.ELLMatrix'),
                ('hyb_matrix', 'p.HybridMatrix')]

rhs_vector_getters = [('vector', 'get_vector')] #,
                      #('vector_range', 'get_vector_range'),
                      #('vector_slice', 'get_vector_slice')]

solvers = [('cg', 'p.tags.CG'),
           #('mixed_precision_cg', 'p.tags.MixedPrecisionCG'),
           ('bicgstab', 'p.tags.BiCGStab'),
           ('gmres', 'p.tags.GMRES')]

preconditioners = [('no_preconditioner', 'p.tags.NoPreconditioner',
                    ['compressed_matrix', 'coordinate_matrix',
                     'ell_matrix', 'hyb_matrix']),
                   ('ichol0', 'p.tags.ICHOL0', ['compressed_matrix']),
                   ('ilu0', 'p.tags.ILU0', ['compressed_matrix']),
                   ('ilut', 'p.tags.ILUT', ['compressed_matrix']),
                   ('block_ilu0', 'p.tags.BlockILU0', ['compressed_matrix']),
                   ('block_ilut', 'p.tags.BlockILUT', ['compressed_matrix']),
                   ('jacobi', 'p.tags.Jacobi', ['compressed_matrix']),
                   ('row_scaling', 'p.tags.RowScaling', ['compressed_matrix', 'coordinate_matrix']),
                   ('amg', 'p.tags.AMG', ['compressed_matrix']),
                   ('spai', 'p.tags.SPAI', ['compressed_matrix']),
                   ('fspai', 'p.tags.FSPAI', ['compressed_matrix'])]


for d_t_, solver_, sparse_type_, vector_getter_, precond_ in product(dtype_tolerances, solvers, matrix_types, rhs_vector_getters, preconditioners):
    dt_ = d_t_[0]
    tol_ = d_t_[1]
    solver_name = solver_[0]
    solver_tag_name = solver_[1]<commit_msg>Disable AMG preconditioner test until it is refactored<commit_after>from __future__ import division

import math
import numpy as np
import pyviennacl as p
import scipy.sparse.linalg as spspla
from _common import *
from itertools import product

points_x_y = 5

if double_support:
    dtype_tolerances = [('float64', 1.0E-5)]
else:
    dtype_tolerances = [('float32', 1.0E-3)]


matrix_types = [('compressed_matrix', 'p.CompressedMatrix'),
                ('coordinate_matrix', 'p.CoordinateMatrix'),
                ('ell_matrix', 'p.ELLMatrix'),
                ('hyb_matrix', 'p.HybridMatrix')]

rhs_vector_getters = [('vector', 'get_vector')] #,
                      #('vector_range', 'get_vector_range'),
                      #('vector_slice', 'get_vector_slice')]

solvers = [('cg', 'p.tags.CG'),
           #('mixed_precision_cg', 'p.tags.MixedPrecisionCG'),
           ('bicgstab', 'p.tags.BiCGStab'),
           ('gmres', 'p.tags.GMRES')]

preconditioners = [('no_preconditioner', 'p.tags.NoPreconditioner',
                    ['compressed_matrix', 'coordinate_matrix',
                     'ell_matrix', 'hyb_matrix']),
                   ('ichol0', 'p.tags.ICHOL0', ['compressed_matrix']),
                   ('ilu0', 'p.tags.ILU0', ['compressed_matrix']),
                   ('ilut', 'p.tags.ILUT', ['compressed_matrix']),
                   ('block_ilu0', 'p.tags.BlockILU0', ['compressed_matrix']),
                   ('block_ilut', 'p.tags.BlockILUT', ['compressed_matrix']),
                   ('jacobi', 'p.tags.Jacobi', ['compressed_matrix']),
                   ('row_scaling', 'p.tags.RowScaling', ['compressed_matrix', 'coordinate_matrix']),
                   #('amg', 'p.tags.AMG', ['compressed_matrix']),
                   ('spai', 'p.tags.SPAI', ['compressed_matrix']),
                   ('fspai', 'p.tags.FSPAI', ['compressed_matrix'])]


for d_t_, solver_, sparse_type_, vector_getter_, precond_ in product(dtype_tolerances, solvers, matrix_types, rhs_vector_getters, preconditioners):
    dt_ = d_t_[0]
    tol_ = d_t_[1]
    solver_name = solver_[0]
    solver_tag_name = solver_[1]
{'fraction_non_alphanumeric': 0.16356255969436484, 'fraction_numerical': 0.01002865329512894, 'mean_word_length': 2.707079646017699, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4017669', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1382, 'n_words': 244}