:orphan:
# TaoLineSearchSetType
Sets the algorithm used in a line search 
## Synopsis
```
#include "petsctaolinesearch.h" 
PetscErrorCode TaoLineSearchSetType(TaoLineSearch ls, TaoLineSearchType type)
```
Collective


## Input Parameters

- ***ls -*** the `TaoLineSearch` context
- ***type -*** the `TaoLineSearchType` selection



## Options Database Key

- ***-tao_ls_type <type> -*** select which method Tao should use at runtime





## See Also
 [](ch_tao), `Tao`, `TaoLineSearch`, `TaoLineSearchType`, `TaoLineSearchCreate()`, `TaoLineSearchGetType()`,
`TaoLineSearchApply()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/linesearch/interface/taolinesearch.c.html#TaoLineSearchSetType">src/tao/linesearch/interface/taolinesearch.c</A>


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


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