tao-2.1-p0 2012-07-24

TaoLineSearchSetObjectiveAndGradientRoutine

Sets the objective/gradient evaluation routine for the line search

Synopsis

#include "taolinesearch.h" 
PetscErrorCode TaoLineSearchSetObjectiveAndGradientRoutine(TaoLineSearch ls, PetscErrorCode(*func)(TaoLineSearch ls, Vec x, PetscReal *, Vec g, void*), void *ctx)
Logically Collective on TaoLineSearch

Input Parameter

ls - the TaoLineSearch context
func - the objective and gradient evaluation routine
ctx - the (optional) user-defined context for private data

Calling sequence of func

     func (TaoLinesearch ls, Vec x, PetscReal *f, Vec g, void *ctx);

x - input vector
f - function value
g - gradient vector
ctx (optional) user- defined context

Note

Use this routine only if you want the line search objective and gradient evaluation routines to be different from the TaoSolver's objective and gradient evaluation routines.

Note

Some algorithms (lcl, gpcg) set their own objective routine for the line search, application programmers should be wary of overriding the default objective routine.

See Also

TaoLineSearchCreate(), TaoLineSearchSetObjectiveRoutine(), TaoLineSearchSetGradientRoutine(), TaoLineSearchUseTaoSolverRoutines()

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