Esempio n. 1
0
 def test_bsr(self):
     a = sp.kron(rand_matrix(2), eye(2, sparse=True), format='bsr')
     b = convert_mat_to_petsc(a)
     assert b.getType() == 'seqbaij'
     assert b.getBlockSize() == 2
Esempio n. 2
0
 def test_dense(self):
     a = rand_matrix(3)
     b = convert_mat_to_petsc(a)
     assert b.getType() == 'seqdense'
Esempio n. 3
0
 def test_csr(self):
     a = rand_matrix(2, sparse=True, density=0.5)
     b = convert_mat_to_petsc(a)
     assert b.getType() == 'seqaij'