#include "petscmat.h" PetscErrorCode MatSeqBAIJSetPreallocation(Mat B,PetscInt bs,PetscInt nz,const PetscInt nnz[])Collective on MPI_Comm Many br
B | - the matrix Many br | |
bs | - size of block, the blocks are ALWAYS square. One can use MatSetBlockSizes() to set a different row and column blocksize but the row Many brblocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs() Many br | |
nz | - number of block nonzeros per block row (same for all rows) Many br | |
nnz | - array containing the number of block nonzeros in the various block rows Many br(possibly different for each block row) or NULL Many br |
Many br
You can call MatGetInfo() to get information on how effective the preallocation was; Many brfor example the fields mallocs,nz_allocated,nz_used,nz_unneeded; Many brYou can also run with the option -info and look for messages with the string Many brmalloc in them to see if additional memory allocation was needed. Many br
The block AIJ format is fully compatible with standard Fortran 77 Many brstorage. That is, the stored row and column indices can begin at Many breither one (as in Fortran) or zero. See the users' manual for details. Many br
Specify the preallocated storage with either nz or nnz (not both). Many brSet nz=PETSC_DEFAULT and nnz=NULL for PETSc to control dynamic memory Many brallocation. See Users-Manual: ch_mat for details. Many br
Level:intermediate
Location:src/mat/impls/baij/seq/baij.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages