:orphan:
# MatNorm
Calculates various norms of a matrix.
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatNorm(Mat mat, NormType type, PetscReal *nrm)
```
Collective
## Input Parameters
- ***mat -*** the matrix
- ***type -*** the type of norm, `NORM_1`, `NORM_FROBENIUS`, `NORM_INFINITY`
## Output Parameter
- ***nrm -*** the resulting norm
## See Also
[](ch_matrices), `Mat`
## Level
intermediate
## Location
src/mat/interface/matrix.c
## Examples
src/ksp/ksp/tutorials/ex21.c
src/ksp/ksp/tutorials/ex29.c
src/ksp/ksp/tutorials/ex34.c
src/ksp/ksp/tutorials/ex76.c
src/ksp/ksp/tutorials/ex77.c
src/ksp/ksp/tutorials/ex77f.F90
src/snes/tutorials/ex48.c
src/ts/tutorials/ex14.c
## Implementations
MatNorm_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatNorm_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatNorm_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatNorm_SeqBAIJ in src/mat/impls/baij/seq/baij2.c
MatNorm_ConstantDiagonal in src/mat/impls/cdiagonal/cdiagonal.c
MatNorm_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatNorm_SeqDense in src/mat/impls/dense/seq/dense.c
MatNorm_Elemental in src/mat/impls/elemental/matelem.cxx
MatNorm_H2OPUS in src/mat/impls/h2opus/cuda/math2opus.cu
MatNorm_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c
MatNorm_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij2.c
MatNorm_ScaLAPACK in src/mat/impls/scalapack/matscalapack.c
---
[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)