# MatSetLayouts
Sets the `PetscLayout` objects for rows and columns of a matrix 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatSetLayouts(Mat A, PetscLayout rmap, PetscLayout cmap)
```
Logically Collective


## Input Parameters

- ***A -*** the matrix
- ***rmap -*** row layout
- ***cmap -*** column layout





## Note
The `PetscLayout` objects are usually created automatically for the matrix so this routine rarely needs to be called.


## See Also
 `Mat`, `PetscLayout`, `MatCreateVecs()`, `MatGetLocalToGlobalMapping()`, `MatGetLayouts()`

## Level
advanced

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


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
