# MatForwardSolve
Solves L x = b, given a factored matrix, A = LU, or U^T*D^(1/2) x = b, given a factored symmetric matrix, A = U^T*D*U, 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatForwardSolve(Mat mat, Vec b, Vec x)
```
Neighbor-wise Collective


## Input Parameters

- ***mat -*** the factored matrix
- ***b -*** the right-hand-side vector



## Output Parameter

- ***x -*** the result vector



## Notes
`MatSolve()` should be used for most applications, as it performs
a forward solve followed by a backward solve.

The vectors b and x cannot be the same,  i.e., one cannot
call `MatForwardSolve`(A,x,x).

For matrix in `MATSEQBAIJ` format with block size larger than 1,
the diagonal blocks are not implemented as D = D^(1/2) * D^(1/2) yet.
`MatForwardSolve()` solves U^T*D y = b, and
`MatBackwardSolve()` solves U x = y.
Thus they do not provide a symmetric preconditioner.




## See Also
 `MatBackwardSolve()`, `MatGetFactor()`, `MatSolve()`, `MatBackwardSolve()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatForwardSolve">src/mat/interface/matrix.c</A>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
