# TaoGAAppSetGradientRoutine

Sets the gradient evaluation routine and gradient vector for use by the TAO_GA_APPLICATION routines.

## Synopsis

    #include "taoapp_ga.h"
    int TaoGAAppSetGradientRoutine(TAO_GA_APPLICATION gaapp, int (*grad)(TAO_GA_APPLICATION,GAVec,GAVec,void*),void *ctx)

Collective on TAO_GA_APPLICATION

## Input Parameters

| gaapp | - the TAO_GA_APPLICATION context
| grad | - gradient evaluation routine
| ctx | - [optional] user-defined function context

## Calling sequence of func

        grad (TAO_GA_APPLICATION gaapp,GAVec x,GAVec g,void *ctx);

| gaapp | - the TAO_GA_APPLICATION application context
| x | - input vector
| g | - gradient vector
| ctx | - user-defined function gradient context

## Note

This routine should be called before TaoSetApplication()

## Options Database Keys

-tao_view_gradient -view the gradient after each evaluation

## Keywords

GAApplication, set, function

## See Also

TaoGAAppSetObjectiveAndGradientRoutine(), TaoGAAppSetHessianRoutine()

Level:beginner
Location:src/external/globalarraytao/taoapp_ga.c
TAO Solver Index
Table of Contents