def test_sparse_multiply():
    numpy = pytest.importorskip('numpy')
    pytest.importorskip('scipy')
    import scipy.sparse as ss
    la = numpy.linalg
    mat = numpy.random.randn(10, 10)
    s_mat = ss.csr_matrix(mat)
    vec = numpy.random.randn(10)
    mat_vec = (s_mat * vec)
    from pymbolic.algorithm import csr_matrix_multiply
    mat_vec_2 = csr_matrix_multiply(s_mat, vec)
    assert (la.norm((mat_vec - mat_vec_2)) < 1e-14)
def test_sparse_multiply():
    numpy = pytest.importorskip('numpy')
    pytest.importorskip('scipy')
    import scipy.sparse as ss
    la = numpy.linalg
    mat = numpy.random.randn(10, 10)
    s_mat = ss.csr_matrix(mat)
    vec = numpy.random.randn(10)
    mat_vec = (s_mat * vec)
    from pymbolic.algorithm import csr_matrix_multiply
    mat_vec_2 = csr_matrix_multiply(s_mat, vec)
    assert (la.norm((mat_vec - mat_vec_2)) < 1e-14)