[petsc-users] inplace MatPtAP
Jed Brown
jed at jedbrown.org
Tue Apr 28 13:39:54 CDT 2015
Patrick Lacasse <patrick.m.lacasse at gmail.com> writes:
> I have to compute a product Pt*A*P.
>
> My projection matrix P won't change the structure of A and I don't need to
> keep the original A.
> Is it possible to do it inplace (modify A instead of creating a new C)?
No.
> Do you think it is feasible to expend MatPtAP to mpiaij and/or sbaij
> matrices?
You want A to be SBAIJ and P MPIAIJ? (Block formats for P usually don't
make sense except for MAIJ because P often has non-square blocks.)
> There is more implementation of MatMatMult.
> Is it possible to do Pt*A and A*P directly into A (without creating a copy)?
No. (Not from laziness, but because the semantics of matrix-matrix
multiply don't work that way. We could allocate the memory internally
and free the old copies, but that amount of seeming mutability is a
terrible interface for users and it doesn't reduce peak memory usage.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150428/686b5340/attachment-0001.pgp>
More information about the petsc-users
mailing list