Skip to main content
`Ctrl`+`K`

# TaoSetMaximumIterations

Sets a maximum number of iterates to be used in `TaoSolve()`

## Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoSetMaximumIterations(Tao tao, PetscInt maxits)

Logically Collective

## Input Parameters

- tao - the `Tao` solver context

- maxits - the maximum number of iterates (>=0), use `PETSC_UNLIMITED` to have no bound

## Options Database Key

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

## Note

Use `PETSC_DETERMINE` to use the default maximum number of iterations that was set when the object’s type was set.

## Developer Note

DeprAlso accepts the deprecated negative values to indicate no limit

## See Also

TAO: Optimization Solvers, `Tao`, `TaoSetTolerances()`, `TaoSetMaximumFunctionEvaluations()`

## Level

intermediate

## Location

src/tao/interface/taosolver.c

## Examples

src/tao/unconstrained/tutorials/rosenbrock3.c
src/tao/unconstrained/tutorials/rosenbrock2.c

Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages