#include "petscmat.h" PetscErrorCode MatBlockMatSetPreallocation(Mat B,PetscInt bs,PetscInt nz,const PetscInt nnz[])Collective on MPI_Comm
B | - The matrix | |
bs | - size of each block in matrix | |
nz | - number of nonzeros per block row (same for all rows) | |
nnz | - array containing the number of nonzeros in the various block rows (possibly different for each row) or NULL |
Specify the preallocated storage with either nz or nnz (not both). Set nz=PETSC_DEFAULT and nnz=NULL for PETSc to control dynamic memory allocation. For large problems you MUST preallocate memory or you will get TERRIBLE performance, see the users' manual chapter on matrices.
Level:intermediate
Location:src/mat/impls/blockmat/seq/blockmat.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages