:orphan:
# SNESSetLineSearch
Sets the linesearch on the `SNES` instance. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetLineSearch(SNES snes, SNESLineSearch linesearch)
```
Collective


## Input Parameters

- ***snes -*** iterative context obtained from `SNESCreate()`
- ***linesearch   -*** the linesearch object





## Note
Use `SNESGetLineSearch()` to retrieve the preconditioner context (for example,
to configure it using the API).


## See Also
 [](ch_snes), `SNESGetLineSearch()`

## Level
developer

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


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


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