def test_many_args_dense_not_last_coo_construct(self, mat_s, mat_s2, mat_d, stype): c = kron(mat_s, mat_d, mat_s2, stype=stype, coo_build=True) assert c.format == (stype if stype is not None else "csr") c = kron(mat_d, mat_s, mat_s2, stype=stype, coo_build=True) assert c.format == (stype if stype is not None else "csr")
def test_kron_mixed_types(self, mat_d, mat_s): assert_allclose(kron(mat_d, mat_s).A, (sp.kron(mat_d, mat_s, 'csr')).A) assert_allclose(kron(mat_s, mat_s).A, (sp.kron(mat_s, mat_s, 'csr')).A)
def test_many_args_dense_not_last(self, mat_s, mat_s2, mat_d, stype): c = kron(mat_d, mat_s, mat_s2, stype=stype) assert c.format == (stype if stype is not None else "csr") c = kron(mat_s, mat_d, mat_s2, stype=stype) assert c.format == (stype if stype is not None else "csr")
def test_kron_multi_args(self, mat_d, mat_d2, mat_d3): assert_allclose(kron(mat_d), mat_d) assert_allclose(kron(mat_d, mat_d2, mat_d3), np.kron(np.kron(mat_d, mat_d2), mat_d3))