petsc-3.3-p7 2013-05-11

MatRestoreArray

Restores the matrix after MatGetArray() has been called.

Synopsis

#include "petscmat.h" 
PetscErrorCode  MatRestoreArray(Mat mat,PetscScalar *v[])
Not Collective

Input Parameter

mat - the matrix
v - the location of the values

Fortran Note

This routine is used differently from Fortran, e.g.,
        Mat         mat
        PetscScalar mat_array(1)
        PetscOffset i_mat
        PetscErrorCode ierr
        call MatGetArray(mat,mat_array,i_mat,ierr)

  C  Access first local entry in matrix; note that array is
  C  treated as one dimensional
        value = mat_array(i_mat + 1)

        [... other code ...]
        call MatRestoreArray(mat,mat_array,i_mat,ierr)

See the <a href="../../docs/manual.pdf#Chapter 9 PETSc for Fortran Users">Fortran chapter of the users manual</a> src/mat/examples/tests for details

See Also

MatGetArray(), MatRestoreArrayF90()

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

Examples

src/ksp/ksp/examples/tutorials/ex30.c.html