TaoGetHessian#

Gets the function to compute the Hessian as well as the location to store the matrix.

Synopsis#

#include "petsctao.h" 
PetscErrorCode TaoGetHessian(Tao tao, Mat *H, Mat *Hpre, PetscErrorCode (**func)(Tao tao, Vec x, Mat H, Mat Hpre, PetscCtx ctx), PetscCtxRt ctx)

Not Collective

Input Parameter#

  • tao - the Tao context

Output Parameters#

  • H - Matrix used for the hessian

  • Hpre - Matrix that will be used to construct the preconditioner, can be the same as H

  • func - Hessian evaluation routine

  • ctx - user-defined context for private data for the Hessian evaluation routine

Calling sequence of func#

  • tao - the Tao context

  • x - input vector

  • H - Hessian matrix

  • Hpre - matrix used to construct the preconditioner, usually the same as H

  • ctx - [optional] user-defined Hessian context

Notes#

In addition to specifying an objective function using callbacks such as TaoSetObjectiveAndGradient() and TaoSetHessian(), users can specify objective functions with TaoAddTerm().

TaoGetHessian() will always return the callback specified with TaoSetHessian(), even if the objective function has been changed by calling TaoAddTerm().

See Also#

TAO: Optimization Solvers, Tao, TaoType, TaoGetObjective(), TaoGetGradient(), TaoGetObjectiveAndGradient(), TaoSetHessian(), TaoGetHessianMatrices()

Level#

beginner

Location#

src/tao/interface/taosolver_hj.c


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