Skip to main content
`Ctrl`+`K`

# TaoTermCreateHessianMatrices

Create the matrices that can be inputs to `TaoTermComputeHessian()`

## Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoTermCreateHessianMatrices(TaoTerm term, Mat *H, Mat *Hpre)

Collective

## Input Parameter

- term - a `TaoTerm`

## Output Parameters

- H - (optional) a matrix that can store the Hessian computed in `TaoTermComputeHessian()`

- Hpre - (optional) a matrix from which a preconditioner can be computed in `TaoTermComputeHessian()`

## Note

Before Hessian matrices can be created, the size of the solution vector space must be set (see the ways this can be done in `TaoTermCreateSolutionVec()`). If the term is a `TAOTERMSHELL`, `TaoTermShellSetCreateHessianMatrices()` must be called. Most `TaoTerm`s use `TaoTermCreateHessianMatricesDefault()` to create their Hessian matrices: the behavior of that function can be controlled by `TaoTermSetCreateHessianMode()`.

## See Also

TaoTerm: composable objective function terms, `TaoTerm`, `TaoTermComputeHessian()`, `TaoTermShellSetCreateHessianMatrices()`, `TaoTermCreateSolutionVec()`, `TaoTermCreateHessianMatricesDefault()`, `TaoTermGetCreateHessianMode()`, `TaoTermSetCreateHessianMode()`, `TaoTermIsCreateHessianMatricesDefined()`

## Level

advanced

## Location

src/tao/term/interface/taoterm.c

## Implementations

TaoTermCreateHessianMatrices_Callbacks() in src/tao/term/impls/callbacks/taotermcallbacks.c
TaoTermCreateHessianMatrices_Halfl2squared() in src/tao/term/impls/halfl2squared/taotermhalfl2squared.c
TaoTermCreateHessianMatrices_L1() in src/tao/term/impls/l1/taoterml1.c
TaoTermCreateHessianMatrices_Quadratic() in src/tao/term/impls/quadratic/taotermquadratic.c
TaoTermCreateHessianMatrices_Sum() in src/tao/term/impls/sum/taotermsum.c

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