[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
/src/mat/examples/tests
directory to create a matrix with COO format.

In the line:
ierr = MatCreateSeqAIJ(PETSC_COMM_WORLD,m,n,
(m*n/nnz),PETSC_NULL,&A);CHKERRQ(ierr);

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

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateSeqAIJ.html


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?

Thanks

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