petsc-3.12.4 2020-02-04
Report Typos and Errors

# TaoSetHessianRoutine

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

### Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoSetHessianRoutine(Tao tao, Mat H, Mat Hpre, PetscErrorCode (*func)(Tao, Vec, Mat, Mat, void*), void *ctx)

Logically collective on Tao

### Input Parameters

| tao | - the Tao context
| H | - Matrix used for the hessian
| Hpre | - Matrix that will be used operated on by preconditioner, can be same as H
| func | - Hessian evaluation routine
| ctx | - [optional] user-defined context for private data for the Hessian evaluation routine (may be NULL)

### Calling sequence of func

       func(Tao tao,Vec x,Mat H,Mat Hpre,void *ctx);

| tao | - the Tao context
| x | - input vector
| H | - Hessian matrix
| Hpre | - preconditioner matrix, usually the same as H
| ctx | - [optional] user-defined Hessian context

### Level

beginner

### Location

src/tao/interface/taosolver_hj.c

### Examples

src/ts/examples/tutorials/ex20opt_p.c.html
src/ts/examples/tutorials/ex20opt_ic.c.html
src/tao/unconstrained/examples/tutorials/eptorsion1.c.html
src/tao/unconstrained/examples/tutorials/eptorsion2.c.html
src/tao/unconstrained/examples/tutorials/minsurf2.c.html
src/tao/unconstrained/examples/tutorials/rosenbrock1.c.html
src/tao/unconstrained/examples/tutorials/eptorsion2f.F.html
src/tao/unconstrained/examples/tutorials/rosenbrock1f.F90.html
src/tao/constrained/examples/tutorials/maros.c.html
src/tao/constrained/examples/tutorials/toy.c.html
src/tao/constrained/examples/tutorials/toyf.F90.html
Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages