#include "petscmat.h" PetscErrorCode MatGetSubMatrix(Mat mat,IS isrow,IS iscol,MatReuse cll,Mat *newmat)Collective on Mat Many br
mat | - the original matrix Many br | |
isrow | - parallel IS containing the rows this processor should obtain Many br | |
iscol | - parallel IS containing all columns you wish to keep. Each process should list the columns that will be in IT's "diagonal part" in the new matrix. Many br | |
cll | - either MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX Many br |
Many br
Some matrix types place restrictions on the row and column indices, such Many bras that they be sorted or that they be equal to each other. Many br
The index sets may not have duplicate entries. Many br
The first time this is called you should use a cll of MAT_INITIAL_MATRIX, Many brthe MatGetSubMatrix() routine will create the newmat for you. Any additional calls Many brto this routine with a mat of the same nonzero structure and with a call of MAT_REUSE_MATRIX Many brwill reuse the matrix generated the first time. You should call MatDestroy() on newmat when Many bryou are finished using it. Many br
The communicator of the newly obtained matrix is ALWAYS the same as the communicator of Many brthe input matrix. Many br
If iscol is NULL then all columns are obtained (not supported in Fortran). Many br
1 2 0 | 0 3 0 | 0 4 Proc0 0 5 6 | 7 0 0 | 8 0 9 0 10 | 11 0 0 | 12 0 ------------------------------------- 13 0 14 | 15 16 17 | 0 0 Proc1 0 18 0 | 19 20 21 | 0 0 0 0 0 | 22 23 0 | 24 0 ------------------------------------- Proc2 25 26 27 | 0 0 28 | 29 0 30 0 0 | 31 32 33 | 0 34Many br
Suppose isrow = [0 1 | 4 | 6 7] and iscol = [1 2 | 3 4 5 | 6]. The resulting submatrix is Many br
2 0 | 0 3 0 | 0 Proc0 5 6 | 7 0 0 | 8 ------------------------------- Proc1 18 0 | 19 20 21 | 0 ------------------------------- Proc2 26 27 | 0 0 28 | 29 0 0 | 31 32 33 | 0Many br
Level:advanced
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages