[petsc-users] Possible bug in PETSc4py Mat().CreateAIJ with rectangular matrices?
Matthew Knepley
knepley at gmail.com
Mon Aug 17 07:02:04 CDT 2020
On Mon, Aug 17, 2020 at 12:22 AM Nidish <nb25 at rice.edu> wrote:
> 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?
>
No. It sounds like something in scipy. These are just the number of rows
and columns.
Thanks,
Matt
> --
> Nidish
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200817/af20858c/attachment.html>
More information about the petsc-users
mailing list