# TaoSetMaximumIterations
Sets a maximum number of iterates. 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoSetMaximumIterations(Tao tao, PetscInt maxits)
```
Logically Collective on tao


## Input Parameters

- ***tao -*** the Tao solver context
- ***maxits -*** the maximum number of iterates (>=0)



## Options Database Keys

- ***-tao_max_it <its> -*** sets the maximum number of iterations





## See Also
 `TaoSetTolerances()`, `TaoSetMaximumFunctionEvaluations()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/rosenbrock2.c.html">src/tao/unconstrained/tutorials/rosenbrock2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/rosenbrock3.c.html">src/tao/unconstrained/tutorials/rosenbrock3.c.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)  
