:orphan:
# MatSolveAdd
Computes x = y + inv(A)*b, given a factored matrix. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatSolveAdd(Mat mat, Vec b, Vec y, Vec x)
```
Neighbor-wise Collective


## Input Parameters

- ***mat -*** the factored matrix
- ***b -*** the right-hand-side vector
- ***y -*** the vector to be added to



## Output Parameter

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





## Note
The vectors `b` and `x` cannot be the same.  I.e., one cannot
call `MatSolveAdd`(A,x,y,x).


## See Also
 [](ch_matrices), `Mat`, [Matrix Factorization](sec_matfactor), `MatSolve()`, `MatGetFactor()`, `MatSolveTranspose()`, `MatSolveTransposeAdd()`

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aijfact.c.html#MatSolveAdd_SeqAIJ">MatSolveAdd_SeqAIJ in src/mat/impls/aij/seq/aijfact.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/elemental/matelem.cxx.html#MatSolveAdd_Elemental">MatSolveAdd_Elemental in src/mat/impls/elemental/matelem.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/scalapack/matscalapack.c.html#MatSolveAdd_ScaLAPACK">MatSolveAdd_ScaLAPACK in src/mat/impls/scalapack/matscalapack.c</A><BR>


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