# SNESLineSearchPostCheck
Hook to modify step direction or updated solution after a successful linesearch 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchPostCheck(SNESLineSearch linesearch, Vec X, Vec Y, Vec W, PetscBool *changed_Y, PetscBool *changed_W)
```
Logically Collective


## Input Parameters

- ***linesearch -*** The linesearch context
- ***X -*** The last solution
- ***Y -*** The step direction
- ***W -*** The updated solution, W = X + lambda*Y for some lambda



## Output Parameters

- ***changed_Y -*** Indicator if the direction Y has been changed.
- ***changed_W -*** Indicator if the new candidate solution W has been changed.



## Note
This calls any function provided with `SNESLineSearchSetPreCheck()`




## See Also
 `SNESGetLineSearch()`, `SNESLineSearchPreCheck()`, `SNESLineSearchSetPostCheck()`, `SNESLineSearchGetPostCheck()`, `SNESLineSearchSetPrecheck()`, `SNESLineSearchGetPrecheck()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/interface/linesearch.c.html#SNESLineSearchPostCheck">src/snes/linesearch/interface/linesearch.c</A>


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


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