[petsc-users] Efficient computation of A'*A

Jed Brown jed at 59A2.org
Wed Jun 15 12:00:15 CDT 2011


On Wed, Jun 15, 2011 at 18:54, Alexander Grayver <agrayver at gfz-potsdam.de>wrote:

> I've got simple question.
> What is the most efficient way to compute B = A'*A using petsc?
> Matrix A is sparse MPIAIJ.
>

What are you going to do with B = A'*A?

The most efficient thing is MatCreateTranspose() which does no computation.

http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateTranspose.html


If you need B assembled, then create a diagonal matrix and use MatPtAP()

http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatPtAP.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110615/a14508c2/attachment.htm>


More information about the petsc-users mailing list