about MatMult()

Barry Smith bsmith at mcs.anl.gov
Tue Apr 22 15:48:47 CDT 2008


On Apr 22, 2008, at 3:16 PM, Yujie wrote:

> the following is about MatMult() in manual.
> "
> The parallel matrix can multiply a vector with n local entries,  
> returning a vector with m local entries.
> That is, to form the product
> MatMult(Mat A,Vec x,Vec y);
> the vectors x and y should be generated with
> VecCreateMPI(MPI Comm comm,n,N,&x);
> VecCreateMPI(MPI Comm comm,m,M,&y);
> "
> I am wondering whether I must create Vector "y" before I call  
> MatMult() regardless of parrellel and sequentail modes?

    y is the location where the product of A*x is stored; if it is not  
created before the call to MatMult() the program will
crash (or more likely generate an error message).

   Barry

>
> thanks a lot.
>
> Regards,
> Yujie




More information about the petsc-users mailing list