:orphan:
# MatRestrict
y = A*x or A'*x 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatRestrict(Mat A, Vec x, Vec y)
```
Neighbor-wise Collective


## Input Parameters

- ***mat   -*** the matrix
- ***x -*** the vector to be restricted



## Output Parameter

- ***y -*** the resulting vector





## Note
This allows one to use either the restriction or interpolation (its transpose)
matrix to do the restriction


## See Also
 [](ch_matrices), `Mat`, `MatMultAdd()`, `MatMultTransposeAdd()`, `MatInterpolate()`, `PCMG`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatRestrict">src/mat/interface/matrix.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex29.c.html">src/ts/tutorials/ex29.c</A><BR>


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


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