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

# MatRestoreRow

Frees any temporary space allocated by MatGetRow().

### Synopsis

    #include "petscmat.h"
    PetscErrorCode MatRestoreRow(Mat mat,PetscInt row,PetscInt *ncols,const PetscInt *cols[],const PetscScalar *vals[])

Not Collective Many br

### Input Parameters

| mat | - the matrix Many br
| row | - the row to get Many br
| ncols, cols | - the number of nonzeros and their columns Many br
| vals | - if nonzero the column values Many br

### Notes

This routine should be called after you have finished examining the entries. Many br

This routine zeros out ncols, cols, and vals. This is to prevent accidental Many brus of the array after it has been restored. If you pass NULL, it will Many brnot zero the pointers. Use of cols or vals after MatRestoreRow is invalid. Many br

### Fortran Notes

The calling sequence from Fortran is Many br

       MatRestoreRow(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) output

Many brWhere maxcols >= maximum nonzeros in any row of the matrix. Many br

In Fortran MatRestoreRow() MUST be called after MatGetRow() Many brbefore another call to MatGetRow() can be made. Many br

Many br

### See Also

MatGetRow()

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/mat/examples/tutorials/ex16.c.html