:orphan:
# TaoLineSearchRegister
Adds a line-search algorithm to the registry 
## Synopsis
```
#include "petsctaolinesearch.h" 
PetscErrorCode TaoLineSearchRegister(const char sname[], PetscErrorCode (*func)(TaoLineSearch))
```
Not Collective


## Input Parameters

- ***sname -*** name of a new user-defined solver
- ***func -*** routine to Create method context



## Sample usage
```none
   TaoLineSearchRegister("my_linesearch", MyLinesearchCreate);
```


Then, your solver can be chosen with the procedural interface via
```none
TaoLineSearchSetType(ls, "my_linesearch")
```
or at runtime via the option
```none
-tao_ls_type my_linesearch
```




## Note
`TaoLineSearchRegister()` may be called multiple times to add several user-defined solvers.


## See Also
 [](ch_tao), `Tao`, `TaoLineSearch`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/linesearch/interface/taolinesearch.c.html#TaoLineSearchRegister">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)  
