<div id="_htmlarea_default_style_" style="font:10pt arial,helvetica,sans-serif">Thanks Jed,<br><br>Actually, I'm going to use this product as a part
of the following expressions:<br><br>v'*A'*A*v<br>A'*A*v<br><br>I need it many times with different v, but constant A.<br><br>MatPtAP with unit matrix
seems to be ok, I guess.<br><br>Regards,<br>Alexander<br><br><br>On Wed, 15 Jun 2011 19:00:15 +0200<br> Jed Brown <jed@59A2.org>
wrote:<br>> On Wed, Jun 15, 2011 at 18:54, Alexander Grayver <br>><agrayver@gfz-potsdam.de>wrote:<br>> <br>>> I've got simple
question.<br>>> What is the most efficient way to compute B = A'*A using <br>>>petsc?<br>>> Matrix A is sparse
MPIAIJ.<br>>><br>> <br>> What are you going to do with B = A'*A?<br>> <br>> The most efficient thing is MatCreateTranspose() which
<br>>does no computation.<br>> <br>> http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateTranspose.html<br>>
<br>> <br>> If you need B assembled, then create a diagonal matrix <br>>and use MatPtAP()<br>> <br>>
http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatPtAP.html<br><br></div>