# MatDiagonalScaleLocal
Scales columns of a matrix given the scaling values including the ghosted ones. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatDiagonalScaleLocal(Mat mat, Vec diag)
```
Not Collective


## Input Parameters

- ***mat -*** the matrix
- ***diag -*** the diagonal values, including ghost ones





## Notes
Works only for `MATMPIAIJ` and `MATMPIBAIJ` matrices

This allows one to avoid during communication to perform the scaling that must be done with `MatDiagonalScale()`


## See Also
 `Mat`, `MatDiagonalScale()`

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mmaij.c.html#MatDiagonalScaleLocal_MPIAIJ">MatDiagonalScaleLocal_MPIAIJ in src/mat/impls/aij/mpi/mmaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/mpi/mmbaij.c.html#MatDiagonalScaleLocal_MPIBAIJ">MatDiagonalScaleLocal_MPIBAIJ in src/mat/impls/baij/mpi/mmbaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sell/mpi/mmsell.c.html#MatDiagonalScaleLocal_MPISELL">MatDiagonalScaleLocal_MPISELL in src/mat/impls/sell/mpi/mmsell.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)  
