[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matrix addition



Hi,

I have a small (perhaps even silly) question concerning an addition of two matrices. Sorry in advance since I am quite new in using petsc.

Currently I am successfully using MatPtAP for the computation of a matrix Q = M^T*A*M with matrices M and A in my C++ code.
Now, I need to enlarge the functionality to use two matrices M1 and M2 together with A in order to calculate Q = M1^T*A*M1 + M2^T*A*M2.


I have been looking in the manual pages for a routine for adding up two matrices without success. Is there any way to do this and I just didn't see it? Or is there another possibility in order to compute my desired matrix Q?

Thank you
Tobias