[petsc-users] Optional arguments of MatZeroRows

Cedric Doucet cedric.doucet at inria.fr
Wed Aug 13 03:20:48 CDT 2014


It seems that 
MatZeroRows(mat,numRows,rows,diag, NULL , NULL ) 
also works. 

Is it better to pass NULL instead of 0? 

Cédric 

----- Mail original -----

> De: "Cedric Doucet" <cedric.doucet at inria.fr>
> À: petsc-users at mcs.anl.gov
> Envoyé: Mercredi 13 Août 2014 10:09:40
> Objet: [petsc-users] Optional arguments of MatZeroRows

> Hello,

> I want to use MatZeroRows function (
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatZeroRows.html
> ).

> It is said in the documentation that the last two arguments are optional,
> i.e. x and b vectors:
> PetscErrorCode MatZeroRows(Mat mat,PetscInt numRows,const PetscInt
> rows[],PetscScalar diag, Vec x , Vec b )
> However, a call to
> MatZeroRows(mat,numRows,rows,diag)
> does not seem to work because the last two input arguments are required.

> In examples, e.g. src/ksp/ksp/examples/tutorials/ex3.c.html , it seems that
> optional arguments are passed by putting some zero values instead of
> vectors:
> MatZeroRows(mat,numRows,rows,diag, 0 , 0 )

> Is this the right way to use MatZeroRows function when one does not want to
> pass x and b vectors as input arguments?

> Best,

> Cédric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140813/72e654c8/attachment.html>


More information about the petsc-users mailing list