petsc-3.7.5 2017-01-01
Report Typos and Errors


Allocates memory for a sparse sequential matrix in AIJ format (the default sequential PETSc format).


#include "petscmat.h"  
PetscErrorCode  MatSeqBAIJSetPreallocationCSR(Mat B,PetscInt bs,const PetscInt i[],const PetscInt j[], const PetscScalar v[])
Collective on MPI_Comm

Input Parameters

B - the matrix
i - the indices into j for the start of each local row (starts with zero)
j - the column indices for each local row (starts with zero) these must be sorted for each row
v - optional values in the matrix


The order of the entries in values is specified by the MatOption MAT_ROW_ORIENTED. For example, C programs may want to use the default MAT_ROW_ORIENTED=PETSC_TRUE and use an array v[nnz][bs][bs] where the second index is over rows within a block and the last index is over columns within a block row. Fortran programs will likely set MAT_ROW_ORIENTED=PETSC_FALSE and use a Fortran array v(bs,bs,nnz) in which the first index is over rows within a block column and the second index is over columns within a block.


matrix, aij, compressed row, sparse

See Also

MatCreate(), MatCreateSeqBAIJ(), MatSetValues(), MatSeqBAIJSetPreallocation(), MATSEQBAIJ

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages