# PCMatApply
Applies the preconditioner to multiple vectors stored as a `MATDENSE`. Like `PCApply()`, Y and X must be different matrices. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCMatApply(PC pc, Mat X, Mat Y)
```
Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***X -*** block of input vectors



## Output Parameter

- ***Y -*** block of output vectors





## See Also
 `PC`, `PCApply()`, `KSPMatSolve()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/interface/precon.c.html#PCMatApply">src/ksp/pc/interface/precon.c</A>

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/asm/asm.c.html#PCMatApply_ASM">PCMatApply_ASM in src/ksp/pc/impls/asm/asm.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/cholesky/cholesky.c.html#PCMatApply_Cholesky">PCMatApply_Cholesky in src/ksp/pc/impls/factor/cholesky/cholesky.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/icc/icc.c.html#PCMatApply_ICC">PCMatApply_ICC in src/ksp/pc/impls/factor/icc/icc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/ilu/ilu.c.html#PCMatApply_ILU">PCMatApply_ILU in src/ksp/pc/impls/factor/ilu/ilu.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/lu/lu.c.html#PCMatApply_LU">PCMatApply_LU in src/ksp/pc/impls/factor/lu/lu.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/qr/qr.c.html#PCMatApply_QR">PCMatApply_QR in src/ksp/pc/impls/factor/qr/qr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gasm/gasm.c.html#PCMatApply_GASM">PCMatApply_GASM in src/ksp/pc/impls/gasm/gasm.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hpddm/pchpddm.cxx.html#PCMatApply_HPDDM">PCMatApply_HPDDM in src/ksp/pc/impls/hpddm/pchpddm.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hpddm/pchpddm.cxx.html#PCMatApply_HPDDMShell">PCMatApply_HPDDMShell in src/ksp/pc/impls/hpddm/pchpddm.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/ksp/pcksp.c.html#PCMatApply_KSP">PCMatApply_KSP in src/ksp/pc/impls/ksp/pcksp.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mat/pcmat.c.html#PCMatApply_Mat">PCMatApply_Mat in src/ksp/pc/impls/mat/pcmat.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCMatApply_MG">PCMatApply_MG in src/ksp/pc/impls/mg/mg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/none/none.c.html#PCMatApply_None">PCMatApply_None in src/ksp/pc/impls/none/none.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCMatApply_Shell">PCMatApply_Shell in src/ksp/pc/impls/shell/shellpc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/spai/ispai.c.html#PCMatApply_SPAI">PCMatApply_SPAI in src/ksp/pc/impls/spai/ispai.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/svd/svd.c.html#PCMatApply_SVD">PCMatApply_SVD in src/ksp/pc/impls/svd/svd.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/interface/precon.c)


[Index of all PC routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
