# TaoSetType
Sets the method for the unconstrained minimization solver. 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoSetType(Tao tao, TaoType type)
```
Collective


## Input Parameters

- ***solver -*** the Tao solver context
- ***type -*** a known method



## Options Database Key

- ***-tao_type <type> -*** Sets the method; use -help for a list
of available methods (for instance, "-tao_type lmvm" or "-tao_type tron")



## Available methods include

- ***`TAONLS` -*** nls Newton's method with line search for unconstrained minimization
- ***`TAONTR` -*** ntr Newton's method with trust region for unconstrained minimization
- ***`TAONTL` -*** ntl Newton's method with trust region, line search for unconstrained minimization
- ***`TAOLMVM` -*** lmvm Limited memory variable metric method for unconstrained minimization
- ***`TAOCG` -*** cg Nonlinear conjugate gradient method for unconstrained minimization
- ***`TAONM` -*** nm Nelder-Mead algorithm for derivate-free unconstrained minimization
- ***`TAOTRON` -*** tron Newton Trust Region method for bound constrained minimization
- ***`TAOGPCG` -*** gpcg Newton Trust Region method for quadratic bound constrained minimization
- ***`TAOBLMVM` -*** blmvm Limited memory variable metric method for bound constrained minimization
- ***`TAOLCL` -*** lcl Linearly constrained Lagrangian method for pde-constrained minimization
- ***`TAOPOUNDERS` -*** pounders Model-based algorithm for nonlinear least squares





## See Also
 `Tao`, `TaoCreate()`, `TaoGetType()`, `TaoType`


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/taosolver.c.html#TaoSetType">src/tao/interface/taosolver.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex20opt_ic.c.html">src/ts/tutorials/ex20opt_ic.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex20opt_p.c.html">src/ts/tutorials/ex20opt_p.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/burgers_spectral.c.html">src/tao/unconstrained/tutorials/burgers_spectral.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/eptorsion1.c.html">src/tao/unconstrained/tutorials/eptorsion1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/eptorsion2.c.html">src/tao/unconstrained/tutorials/eptorsion2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/eptorsion2f.F90.html">src/tao/unconstrained/tutorials/eptorsion2f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/eptorsion3.c.html">src/tao/unconstrained/tutorials/eptorsion3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/minsurf1.c.html">src/tao/unconstrained/tutorials/minsurf1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/minsurf2.c.html">src/tao/unconstrained/tutorials/minsurf2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/rosenbrock1.c.html">src/tao/unconstrained/tutorials/rosenbrock1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/rosenbrock1f.F90.html">src/tao/unconstrained/tutorials/rosenbrock1f.F90.html</A><BR>


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


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