#include "petscmat.h" PetscErrorCode MatCreateSeqBAIJWithArrays(MPI_Comm comm,PetscInt bs,PetscInt m,PetscInt n,PetscInt i[],PetscInt j[],PetscScalar a[],Mat *mat)Collective
comm | - must be an MPI communicator of size 1 | |
bs | - size of block | |
m | - number of rows | |
n | - number of columns | |
i | - row indices; that is i[0] = 0, i[row] = i[row-1] + number of elements in that row block row of the matrix | |
j | - column indices | |
a | - matrix values |
You cannot set new nonzero locations into this matrix, that will generate an error.
The i and j indices are 0 based
When block size is greater than 1 the matrix values must be stored using the BAIJ storage format (see the BAIJ code to determine this).
The order of the entries in values is the same as the block compressed sparse row storage format; that is, it is the same as a three dimensional array in Fortran values(bs,bs,nnz) that contains the first column of the first block, followed by the second column of the first block etc etc. That is, the blocks are contiguous in memory with column-major ordering within blocks.