<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hello,<br></div><div><br></div><div>I want to use MatZeroRows function (<a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatZeroRows.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatZeroRows.html</a>).<br></div><div><br></div><div>It is said in the documentation that the last two arguments are optional, i.e. x and b vectors:</div><div><em><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;">PetscErrorCode  MatZeroRows(Mat mat,PetscInt numRows,const PetscInt rows[],PetscScalar diag,<strong>Vec x</strong>,<strong>Vec</strong></span></em><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><strong> b</strong></span><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;">)</span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;">However, a call to </span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><em>MatZeroRows(mat,numRows,rows,diag)</em> </span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;">does not seem to work because the last two input arguments are required.<br></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><br></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;">In examples, e.g. <a href="http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex3.c.html" data-mce-href="http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex3.c.html">src/ksp/ksp/examples/tutorials/ex3.c.html</a>, it seems that optional arguments are passed by putting some zero values instead of vectors:<br></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><em>MatZeroRows(mat,numRows,rows,diag,<strong>0</strong>,<strong>0</strong>)</em></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true"><br></span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true">Is this the right way to use MatZeroRows function when one does not want to pass x and b vectors as input arguments?</span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true"><br></span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true">Best,<br></span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true"><br></span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true">Cédric<br></span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true"><br></span></span></span></span></div><div><span data-mce-bogus="true"><span data-mce-style="font-family: times new roman,new york,times,serif;" style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;" data-mce-style="font-family: times new roman,new york,times,serif;"><span data-mce-bogus="true"><br></span></span></span></span></div></div></body></html>