[petsc-users] Does PETSc have some functions like A.*B, A./B in Matlab?

Jed Brown jed at 59a2.org
Sun Feb 21 14:29:27 CST 2010


On Sun, 21 Feb 2010 14:19:48 -0600, Yujie <recrusader at gmail.com> wrote:
> It is not only for A./B. If one wants to do A.*B, it is not necessary to
> guarantee the nonzeros of B. Generally, I think MatGetValues() will be good
> choice although you need to judge whether the entries are zero when doing
> A./B.

MatGetValues requires you to know the nonzero pattern of B (or in the
case of .*, the union of the nonzeros of A and B).  What problem are you
trying to solve where you need to do this operation?  Perhaps we can
suggest a better way.

Jed


More information about the petsc-users mailing list