petsc-3.7.1 2016-05-15
Report Typos and Errors

MatGetValues

Gets a block of values from a matrix.

Synopsis

#include "petscmat.h" 
PetscErrorCode MatGetValues(Mat mat,PetscInt m,const PetscInt idxm[],PetscInt n,const PetscInt idxn[],PetscScalar v[])
Not Collective; currently only returns a local block Many br

Input Parameters

mat - the matrix Many br
v - a logically two-dimensional array for storing the values Many br
m, idxm - the number of rows and their global indices Many br
n, idxn - the number of columns and their global indices Many br

Notes

The user must allocate space (m*n PetscScalars) for the values, v. Many brThe values, v, are then returned in a row-oriented format, Many branalogous to that used by default in MatSetValues(). Many br

MatGetValues() uses 0-based row and column numbers in Many brFortran as well as in C. Many br

MatGetValues() requires that the matrix has been assembled Many brwith MatAssemblyBegin()/MatAssemblyEnd(). Thus, calls to Many brMatSetValues() and MatGetValues() CANNOT be made in succession Many brwithout intermediate matrix assembly. Many br

Negative row or column indices will be ignored and those locations in v[] will be Many brleft unchanged. Many br

Many br

See Also

MatGetRow(), MatGetSubMatrices(), MatSetValues()

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