Matrix operation

billy at billy at
Mon Feb 20 15:23:38 CST 2006


I would like to do the following matrix-vector operation in PETSc:

h += (Diag(A) - A) * u

where A is a matrix, Diag(A) is a matrix and h, u are vectors. It is the
multiplication of a matrix with diagonals set to zero with a vector.

How can I do this in PETSc? because MatGetDiagonal gives a vector not a matrix. 


More information about the petsc-users mailing list