def test_sparse_formats_coo_construct(self, sformat_in, stype, mat_s): mat_s = mat_s.asformat(sformat_in) x = mat_s & mat_s & mat_s y = kronpow(mat_s, 3, stype=stype, coo_build=True) assert y.format == stype if stype is not None else "sformat_in" assert_allclose(x.A, y.A)
def test_sparse(self, mat_s): x = mat_s & mat_s & mat_s y = kronpow(mat_s, 3) assert_allclose(x.A, y.A)
def test_sparse_formats(self, stype, mat_s): x = mat_s & mat_s & mat_s y = kronpow(mat_s, 3, stype=stype) assert y.format == stype assert_allclose(x.A, y.A)
def test_dense(self, mat_d): x = mat_d & mat_d & mat_d y = kronpow(mat_d, 3) assert_allclose(x, y)