petsc-3.7.1 2016-05-15
Report Typos and Errors

# TaoSetConvergenceHistory

Sets the array used to hold the convergence history.

### Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoSetConvergenceHistory(Tao tao, PetscReal *obj, PetscReal *resid, PetscReal *cnorm, PetscInt *lits, PetscInt na,PetscBool reset)

Logically Collective on Tao Many br

### Input Parameters

| tao | - the Tao solver context Many br
| obj | - array to hold objective value history Many br
| resid | - array to hold residual history Many br
| cnorm | - array to hold constraint violation history Many br
| lits | - integer array holds the number of linear iterations for each Tao iteration Many br
| na | - size of obj, resid, and cnorm Many br
| reset | - PetscTrue indicates each new minimization resets the history counter to zero, Many brelse it continues storing new values for new minimizations after the old ones Many br

### Notes

If set, TAO will fill the given arrays with the indicated Many brinformation at each iteration. If 'obj','resid','cnorm','lits' are Many br*all* NULL then space (using size na, or 1000 if na is PETSC_DECIDE or Many brPETSC_DEFAULT) is allocated for the history. Many brIf not all are NULL, then only the non-NULL information categories Many brwill be stored, the others will be ignored. Many br

Any convergence information after iteration number 'na' will not be stored. Many br

This routine is useful, e.g., when running a code for purposes Many brof accurate performance monitoring, when no I/O should be done Many brduring the section of code that is being timed. Many br

Many br

### See Also

TaoGetConvergenceHistory()

Level:intermediate
Location:src/tao/interface/taosolver.c
Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/tao/leastsquares/examples/tutorials/chwirut1.c.html
src/tao/leastsquares/examples/tutorials/chwirut1f.F.html