# MatGetColumnNorms
Gets the norms of each column of a sparse or dense matrix. 
## Synopsis
```
#include "petscmat.h"  
PetscErrorCode MatGetColumnNorms(Mat A, NormType type, PetscReal norms[])
```

## Input Parameters

- ***A -*** the matrix
- ***type -*** `NORM_2`, `NORM_1` or `NORM_INFINITY`



## Output Parameter

- ***norms -*** an array as large as the TOTAL number of columns in the matrix





## Note
Each process has ALL the column norms after the call. Because of the way this is computed each process gets all the values,
if each process wants only some of the values it should extract the ones it wants from the array.


## See Also
 `NormType`, `MatNorm()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/utils/getcolv.c.html#MatGetColumnNorms">src/mat/utils/getcolv.c</A>

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/utils/getcolv.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)  
