# 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



## Available methods include

- ***more-*** thuente - line search with a cubic model enforcing the strong Wolfe/curvature condition
- ***armijo -*** simple backtracking line search enforcing only the sufficient decrease condition
- ***unit -*** do not perform a line search and always accept unit step length



## Options Database Keys

- ***-tao_ls_type <more-*** thuente, armijo, unit> - select which method TAO should use at runtime





## See Also
 `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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
