# MatDenseRestoreSubMatrix
Returns access to a block of columns of a dense matrix obtained from MatDenseGetSubMatrix(). 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatDenseRestoreSubMatrix(Mat A, Mat *v)
```
Collective


## Input Parameters

- ***mat -*** the Mat object
- ***v -*** the Mat object (may be NULL)





## See Also
 `MATDENSE`, `MATDENSECUDA`, `MATDENSEHIP`, `MatDenseGetColumnVec()`, `MatDenseRestoreColumnVec()`, `MatDenseGetSubMatrix()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/dense.c.html#MatDenseRestoreSubMatrix">src/mat/impls/dense/seq/dense.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/mpi/mpidense.c.html#MatDenseRestoreSubMatrix_MPIDense">MatDenseRestoreSubMatrix_MPIDense in src/mat/impls/dense/mpi/mpidense.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/cuda/densecuda.cu.html#MatDenseRestoreSubMatrix_SeqDenseCUDA">MatDenseRestoreSubMatrix_SeqDenseCUDA in src/mat/impls/dense/seq/cuda/densecuda.cu</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/dense.c.html#MatDenseRestoreSubMatrix_SeqDense">MatDenseRestoreSubMatrix_SeqDense in src/mat/impls/dense/seq/dense.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/hip/densehip.hip.c.html#MatDenseRestoreSubMatrix_SeqDenseHIP">MatDenseRestoreSubMatrix_SeqDenseHIP in src/mat/impls/dense/seq/hip/densehip.hip.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/dense/seq/dense.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
