TaoGAAppSetObjectiveAndGradientRoutine

Sets a routine for function and gradient evaluation.

Synopsis

#include "taoapp_ga.h" 
int TaoGAAppSetObjectiveAndGradientRoutine(TAO_GA_APPLICATION gaapp, int (*funcgrad)(TAO_GA_APPLICATION,GAVec,double*,GAVec, void*),void *ctx)
Collective on TAO_GA_APPLICATION

Input Parameters

gaapp - the TAO_GA_APPLICATION context
funcgrad - routine for evaluating the function and gradient
ctx - optional user-defined context for private data for the function and gradient evaluation routine (may be TAO_NULL)

Calling sequence of funcgrad

    funcgrad (TAO_GA_APPLICATION tao,GAVec x,double *f,GAVec g,void *ctx);

tao - TAO_GA_APPLICATION application context
x - input vector
f - function value
g - gradient vector
ctx - optional user-defined context

Notes

The user may call TaoGAAppSetObjectiveAndGradientRoutine() to set a routine that evaluates both the function and gradient. Alternatively, the user may call both TaoGAAppSetObjectiveRoutine() and TaoGAAppSetGradientRoutine() to set separate routines for function and gradient evaluation.

Using a single routine to compute the function and gradient, as specified via TaoGAAppSetObjectiveAndGradientRoutine(), may enable better performance for applications in which many of the function and gradient computations are identical.

Options Database Keys

-tao_view_gradient -view the gradient after each iteration

Keywords

GAApplication, set, function

See Also

TaoGAAppSetGradientRoutine(), TaoGAAppSetObjectiveRoutine(), TaoComputeFunctionGradient()

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