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
