Hello,

I'm presently using the following to convert scipy.sparse csr matrices to petsc.

   pM = PETSc.Mat().createAIJ(size=M.shape, csr =(M.indptr, M.indices,
   M.data))

This however doesn't seem to work when M is rectangular. For this case I have to do

   pM = PETSc.Mat().createAIJ(size=M.T.shape, csr =(M.indptr,
   M.indices, M.data))

i.e., I need to use the shape of the transpose of the matrix.

Does this have something to do with the way the csr format is interpreted in the petsc4py wrappings or in PETSc itself?

--
Nidish

Reply via email to