# PCApplyBAorAB
Applies the preconditioner and operator to a vector. y = B*A*x or y = A*B*x. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCApplyBAorAB(PC pc, PCSide side, Vec x, Vec y, Vec work)
```
Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***side -*** indicates the preconditioner side, one of `PC_LEFT`, `PC_RIGHT`, or `PC_SYMMETRIC`
- ***x -*** input vector
- ***work -*** work vector



## Output Parameter

- ***y -*** output vector





## Note
If the `PC` has had `PCSetDiagonalScale()` set then D M A D^{-1} for left preconditioning or  D A M D^{-1} is actually applied. Note that the
specific `KSPSolve()` method must also be written to handle the post-solve "correction" for the diagonal scaling.


## See Also
 `PC`, `PCApply()`, `PCApplyTranspose()`, `PCApplyBAorABTranspose()`

## Level
developer

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


---
[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)  
