# SNESLineSearchGetVecs
Gets the vectors from the `SNESLineSearch` context 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchGetVecs(SNESLineSearch linesearch, Vec *X, Vec *F, Vec *Y, Vec *W, Vec *G)
```
Not Collective on but the vectors are parallel


## Input Parameter

- ***linesearch -*** linesearch context



## Output Parameters

- ***X -*** Solution vector
- ***F -*** Function vector
- ***Y -*** Search direction vector
- ***W -*** Solution work vector
- ***G -*** Function work vector



## Notes
At the beginning of a line search application, X should contain a
solution and the vector F the function computed at X.  At the end of the
line search application, X should contain the new solution, and F the
function evaluated at the new solution.

These vectors are owned by the `SNESLineSearch` and should not be destroyed by the caller




## See Also
 `SNESLineSearch`, `SNESLineSearchGetNorms()`, `SNESLineSearchSetVecs()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex1f.F90.html">src/snes/tutorials/ex1f.F90.html</A><BR>


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