#include "petscmat.h" PetscErrorCode MatSeqBAIJSetPreallocation(Mat B,PetscInt bs,PetscInt nz,const PetscInt nnz)Collective on MPI_Comm
|A||- the matrix|
|bs||- size of block|
|nz||- number of block nonzeros per block row (same for all rows)|
|nnz||- array containing the number of block nonzeros in the various block rows (possibly different for each block row) or PETSC_NULL|
You can call MatGetInfo() to get information on how effective the preallocation was; for example the fields mallocs,nz_allocated,nz_used,nz_unneeded; You can also run with the option -info and look for messages with the string malloc in them to see if additional memory allocation was needed.
The block AIJ format is fully compatible with standard Fortran 77 storage. That is, the stored row and column indices can begin at either one (as in Fortran) or zero. See the users' manual for details.
Specify the preallocated storage with either nz or nnz (not both). Set nz=PETSC_DEFAULT and nnz=PETSC_NULL for PETSc to control dynamic memory allocation. See the <A href="../../docs/manual.pdf#nameddest=ch_mat">Mat chapter of the users manual</A> for details.
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages