[petsc-users] Product of matrix row times a vector

Jed Brown jed at jedbrown.org
Thu Jan 30 16:26:01 CST 2020


"Smith, Barry F. via petsc-users" <petsc-users at mcs.anl.gov> writes:

>   MatGetSubMatrix() and then do the product on the sub matrix then VecSum

If you're only doing it once or the relevant rows are changing, it may
be cheaper to multiply the whole matrix by a vector instead of creating
a submatrix.  If you have many of these to do at the same time, I'd
suggest creating a sparse matrix and doing the sparse matrix product.


More information about the petsc-users mailing list