MatMult

Satish Balay balay at mcs.anl.gov
Wed Feb 11 13:14:03 CST 2009


On Wed, 11 Feb 2009, Yixun Liu wrote:

> Hi,
> I saw MatMult() is used in ex2 as,
> Vec u, b;
> ierr = MatMult(A,u,b);
> 
> MatMult is defined as,
> PetscErrorCode  MatMult(Mat mat,Vec x,Vec y)
> 
> Should be PetscErrorCode  MatMult(Mat mat,Vec x,Vec &y)?

Vec is an object - not an array. So the current syntax is correct.

You should notice 'VecDuplicate(u,&b);' where the object 'b' gets
created.

Satish


More information about the petsc-users mailing list