:orphan:
# TaoDefaultComputeHessianColor
Computes the Hessian using colored finite differences. 
## Synopsis
```
#include "petsctao.h"  
PetscErrorCode TaoDefaultComputeHessianColor(Tao tao, Vec V, Mat H, Mat B, void *ctx)
```
Collective


## Input Parameters

- ***tao -*** the Tao context
- ***V   -*** compute Hessian at this point
- ***ctx -*** the color object of type `MatFDColoring`



## Output Parameters

- ***H -*** Hessian matrix (not altered in this routine)
- ***B -*** newly computed Hessian matrix to use with preconditioner (generally the same as H)





## See Also
 `Tao`, `MatColoring`, `TaoSetHessian()`, `TaoDefaultComputeHessian()`, `SNESComputeJacobianDefaultColor()`, `TaoSetGradient()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/fdiff.c.html#TaoDefaultComputeHessianColor">src/tao/interface/fdiff.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/minsurf2.c.html">src/tao/unconstrained/tutorials/minsurf2.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/fdiff.c)


[Index of all Tao routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
