[petsc-users] MatCreateSeqAIJ( ) Quesion

Lu Qiyue luqiyue at gmail.com
Tue Jul 9 20:49:32 CDT 2013

Dear All:
I am using a modified version of ex72.c in
directory to create a matrix with COO format.

In the line:
ierr = MatCreateSeqAIJ(PETSC_COMM_WORLD,m,n,

The 'nz' is set to (m*n/nnz). And from documents, nz is:
*nz *- number of nonzeros per row (same for all rows)


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?

If only one value here, should it be the largest number of non-zeroes among
all rows?


Qiyue Lu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130709/77de00e3/attachment-0001.html>

More information about the petsc-users mailing list