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

## Input Parameters

- ***A -*** the matrix
- ***type -*** A constant defined in `NormType` or `ReductionType`: `NORM_2`, `NORM_1`, `NORM_INFINITY`, `REDUCTION_SUM_REALPART`,
`REDUCTION_SUM_IMAGINARYPART`, `REDUCTION_MEAN_REALPART`, `REDUCTION_MEAN_IMAGINARYPART`



## Output Parameter

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





## Note
Each process has ALL the column reductions 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.


## Developer Note
This routine is primarily intended as a back-end.
`MatGetColumnNorms()`, `MatGetColumnSums()`, and `MatGetColumnMeans()` are implemented using this routine.


## See Also
 `ReductionType`, `NormType`, `MatGetColumnNorms()`, `MatGetColumnSums()`, `MatGetColumnMeans()`

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mpiaij.c.html#MatGetColumnReductions_MPIAIJ">MatGetColumnReductions_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aij.c.html#MatGetColumnReductions_SeqAIJ">MatGetColumnReductions_SeqAIJ in src/mat/impls/aij/seq/aij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/mpi/mpibaij.c.html#MatGetColumnReductions_MPIBAIJ">MatGetColumnReductions_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/seq/baij.c.html#MatGetColumnReductions_SeqBAIJ">MatGetColumnReductions_SeqBAIJ in src/mat/impls/baij/seq/baij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/mpi/mpidense.c.html#MatGetColumnReductions_MPIDense">MatGetColumnReductions_MPIDense in src/mat/impls/dense/mpi/mpidense.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/dense.c.html#MatGetColumnReductions_SeqDense">MatGetColumnReductions_SeqDense in src/mat/impls/dense/seq/dense.c</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)  
