# MatSetLocalToGlobalMapping
Sets a local-to-global numbering for use by the routine `MatSetValuesLocal()` to allow users to insert matrix entries using a local (per-processor) numbering. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatSetLocalToGlobalMapping(Mat x, ISLocalToGlobalMapping rmapping, ISLocalToGlobalMapping cmapping)
```
Not Collective


## Input Parameters

- ***x -*** the matrix
- ***rmapping -*** row mapping created with `ISLocalToGlobalMappingCreate()` or `ISLocalToGlobalMappingCreateIS()`
- ***cmapping -*** column mapping





## Note
If the matrix is obtained with `DMCreateMatrix()` then this may already have been called on the matrix


## See Also
 `Mat`, `DM`, `DMCreateMatrix()`, `MatGetLocalToGlobalMapping()`, `MatAssemblyBegin()`, `MatAssemblyEnd()`, `MatSetValues()`, `MatSetValuesLocal()`, `MatGetValuesLocal()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex48.c.html">src/snes/tutorials/ex48.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/bound/tutorials/plate2.c.html">src/tao/bound/tutorials/plate2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/bound/tutorials/plate2f.F90.html">src/tao/bound/tutorials/plate2f.F90.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/is/matis.c.html#MatSetLocalToGlobalMapping_IS">MatSetLocalToGlobalMapping_IS in src/mat/impls/is/matis.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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
