# TaoAppSetJacobianRoutine

Sets the function to compute the Jacobian of the equality constraint function as well as the location to store the matrix.

## Synopsis

    #include "tao.h"
    int TaoAppSetJacobianRoutine(TAO_APPLICATION taoapp,int (*jac)(TAO_APPLICATION,Vec,Mat*,Mat*,MatStructure*,void*),void *ctx)

Collective on TAO_APPLICATION and Mat

## Input Parameters

| taoapp | - the TAO_APPLICATION context
| jac | - Jacobian evaluation routine
| ctx | - [optional] user-defined context for private data for the Hessian evaluation routine (may be TAO_NULL)

## Calling sequence of func

       jac (TAO_APPLICATION taoapp,Vec x,Mat *J,Mat *JPre, void *ctx);

| taoapp | - the TAO_APPLICATION context
| x | - input vector
| J | - Jacobian matrix
| JPre | - matrix to precondition J
| ctx | - [optional] user-defined Hessian context

## Notes

The function jac() takes Mat * as the matrix arguments rather than Mat. This allows the Jacobian evaluation routine to replace J with a completely new new matrix structure (not just different matrix elements) when appropriate, for instance, if the nonzero structure is changing throughout the global iterations.

## Keywords

TAO_APPLICATION, Jacobian

## See Also

TaoAppSetJacobianMat(), TaoAppSetConstraintRoutine()

Level:intermediate
Location:src/petsctao/application/petscapp/tao_app_j.c
TAO Solver Index
Table of Contents

### Examples

src/complementarity/examples/tutorials/minsurf1.c.html
src/complementarity/examples/tutorials/blackscholes.c.html