[petsc-users] addition of two matrices

Jed Brown jed at 59A2.org
Sat May 15 08:22:07 CDT 2010


On Sat, 15 May 2010 15:00:07 +0200, Umut Tabak <u.tabak at tudelft.nl> wrote:
> Dear all,
> 
> How can I add two matrices? More openly, I have an expression
> 
> A^T * M* A  + B^T *K*B
> 
> I find M*A and K*B with MatMatMult then form the 1st and 2nd expression 
> with MatMatMultTranspose and I would like to add the two eventually. I 
> could not find a function in the documentation, maybe missed.

Look at the docs for MatPtAP() and MatAXPY().

Jed


More information about the petsc-users mailing list