MatGetArray

Returns a pointer to the element values in the matrix. The result of this routine is dependent on the underlying matrix data-structure, and may not even work for certain matrix types. You MUST call MatRestoreArray() when you no longer need to access the array.

Synopsis

int MatGetArray(Mat mat,Scalar **v)
Not Collective

Input Parameter

mat -the matrix

Output Parameter

v -the location of the values

Currently only returns an array for the dense formats, giving access to the local portionof the matrix in the usual Fortran column oriented format.

Fortran Note

The Fortran interface is slightly different from that given below. See the Fortran chapter of the users manual andpetsc/src/mat/examples for details.

Keywords

matrix, array, elements, values

See Also

MatRestoreArray()

Location: src/mat/interface/matrix.c
Matrix Index
Table of Contents