# SNESLineSearchCreate
Creates the line search context. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchCreate(MPI_Comm comm, SNESLineSearch *outlinesearch)
```
Logically Collective


## Input Parameters

- ***comm -*** MPI communicator for the line search (typically from the associated `SNES` context).



## Output Parameters

- ***outlinesearch -*** the new linesearch context





## Note
The preferred calling sequence for users is to use `SNESGetLineSearch()` to acquire the `SNESLineSearch` instance
already associated with the `SNES`.


## See Also
 `SNESLineSearch`, `LineSearchDestroy()`, `SNESGetLineSearch()`

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ncg/snesncg.c.html#SNESLineSearchCreate_NCGLinear">SNESLineSearchCreate_NCGLinear in src/snes/impls/ncg/snesncg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/basic/linesearchbasic.c.html#SNESLineSearchCreate_Basic">SNESLineSearchCreate_Basic in src/snes/linesearch/impls/basic/linesearchbasic.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/bt/linesearchbt.c.html#SNESLineSearchCreate_BT">SNESLineSearchCreate_BT in src/snes/linesearch/impls/bt/linesearchbt.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/cp/linesearchcp.c.html#SNESLineSearchCreate_CP">SNESLineSearchCreate_CP in src/snes/linesearch/impls/cp/linesearchcp.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/l2/linesearchl2.c.html#SNESLineSearchCreate_L2">SNESLineSearchCreate_L2 in src/snes/linesearch/impls/l2/linesearchl2.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/nleqerr/linesearchnleqerr.c.html#SNESLineSearchCreate_NLEQERR">SNESLineSearchCreate_NLEQERR in src/snes/linesearch/impls/nleqerr/linesearchnleqerr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/shell/linesearchshell.c.html#SNESLineSearchCreate_Shell">SNESLineSearchCreate_Shell in src/snes/linesearch/impls/shell/linesearchshell.c</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)  
