#include "petscmat.h" PetscErrorCode MatCreateSeqAIJFromTriple(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt i[],PetscInt j[],PetscScalar a[],Mat *mat,PetscInt nz,PetscBool idx)Collective
comm | - must be an MPI communicator of size 1 | |
m | - number of rows | |
n | - number of columns | |
i | - row indices | |
j | - column indices | |
a | - matrix values | |
nz | - number of nonzeros | |
idx | - 0 or 1 based |
mat | - the matrix |
The format which is used for the sparse matrix input, is equivalent to a row-major ordering.. i.e for the following matrix, the input data expected is
1 0 0 2 0 3 4 5 6
i = {0,1,1,2,2,2} j = {0,0,2,0,1,2} v = {1,2,3,4,5,6}