<div dir="ltr"><div><div>Dear All:<br></div>I am using a modified version of ex72.c in <br>/src/mat/examples/tests<br>directory to create a matrix with COO format. <br></div><br>In the line:<br><div><div><div>ierr = MatCreateSeqAIJ(PETSC_COMM_WORLD,m,n, (m*n/nnz),PETSC_NULL,&A);CHKERRQ(ierr);<br>
<br></div><div>The 'nz' is set to (m*n/nnz). And from documents, nz is:<br><b>nz </b>- number of nonzeros per row (same for all rows)
<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateSeqAIJ.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateSeqAIJ.html</a><br><br><br></div><div>I am wondering, why this value is set to be m*n/nnz? Looks obvious this is not the number of nonzeros per row. What's the rule for choosing nz? <br>
<br>If only one value here, should it be the largest number of non-zeroes among all rows?<br><br></div><div>Thanks<br><br></div><div>Qiyue Lu<br>
</div></div></div></div>