tao-2.1-p0 2012-07-24

TaoSetGradientRoutine

Sets the gradient evaluation routine for minimization

Synopsis

#include "taosolver.h" 
PetscErrorCode TaoSetGradientRoutine(TaoSolver tao,  PetscErrorCode (*func)(TaoSolver, Vec, Vec, void*),void *ctx) 
Logically collective on TaoSolver

Input Parameter

tao - the TaoSolver context
func - the gradient function
ctx - [optional] user-defined context for private data for the gradient evaluation routine (may be PETSC_NULL)

Calling sequence of func

     func (TaoSolver tao, Vec x, Vec g, void *ctx);

x - input vector
g - gradient value (output)
ctx - [optional] user-defined function context

See Also

TaoSetObjectiveRoutine(), TaoSetHessianRoutine() TaoSetObjectiveAndGradientRoutine()

Level:beginner
Location:src/interface/taosolver_fg.c
TAO Solver Index
Table of Contents

Examples

src/pde_constrained/examples/tutorials/elliptic.c.html
src/pde_constrained/examples/tutorials/parabolic.c.html
src/pde_constrained/examples/tutorials/hyperbolic.c.html