#include "petscmat.h" PetscErrorCode MatGetRow(Mat mat,PetscInt row,PetscInt *ncols,const PetscInt *cols[],const PetscScalar *vals[])Not Collective
mat | - the matrix | |
row | - the row to get |
ncols | - if not NULL, the number of nonzeros in the row | |
cols | - if not NULL, the column numbers | |
vals | - if not NULL, the values |
MatGetRow() always returns 0-based column indices, regardless of whether the internal representation is 0-based (default) or 1-based.
For better efficiency, set cols and/or vals to NULL if you do not wish to extract these quantities.
The user can only examine the values extracted with MatGetRow(); the values cannot be altered. To change the matrix entries, one must use MatSetValues().
You can only have one call to MatGetRow() outstanding for a particular matrix at a time, per processor. MatGetRow() can only obtain rows associated with the given processor, it cannot get rows from the other processors; for that we suggest using MatGetSubMatrices(), then MatGetRow() on the submatrix. The row index passed to MatGetRows() is in the global number of rows.
MatGetRow(matrix,row,ncols,cols,values,ierr) Mat matrix (input) integer row (input) integer ncols (output) integer cols(maxcols) (output) double precision (or double complex) values(maxcols) outputwhere maxcols >= maximum nonzeros in any row of the matrix.
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