Skip to main content
`Ctrl`+`K`

# MatDiagonalRestoreDiagonal

Restore the diagonal of a `MATDIAGONAL`

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatDiagonalRestoreDiagonal(Mat A, Vec *diag)

## Input Parameters

- A - the `MATDIAGONAL`

- diag - the `Vec` obtained from `MatDiagonalGetDiagonal()`

## Note

Use `MatDiagonalSet()` to change the values by copy, rather than reference.

## See Also

Matrices, `MATDIAGONAL`, `MatCreateDiagonal()`, `MatDiagonalGetDiagonal()`

## Level

developer

## Location

src/mat/impls/diagonal/diagonal.c

## Implementations

MatDiagonalRestoreDiagonal_Diagonal() in src/mat/impls/diagonal/diagonal.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages