Many solver in TAO require a line search. While these solver always
offer a default line search, alternative line searches can also be used.
Line searches must have the form:
int L(TAO_SOLVER tao,TaoVec *xx,TaoVec *gg,TaoVec *dx, TaoVec *ww,
double *f, double *step,double *gdx,int *flg,void *lsctx);
In this routine the first argument is the TAO solver, the second argument
is the current solution vector, the third argument is the gradient at
the current point, the fourth argument is the step direction, the fourth
vector is a work vector, the fifth argument is the function value, the
sixth argument is the step length, the seventh argument is the inner
product of the gradient and direction vector used for the Armijo condition,
the eighth argument is a flag indicating success or
failure of the line search, and the last argument is a pointer to
a structure that can be used to define the line search. When the
routine is finished the solution vector xx, gradient vector gg,
function value f, step size step, and flg should be
updated to reflect the new solution.
This routine can be set with the function
int TaoSetLineSearch(TAO_SOLVER solver,
int (*setup)(TAO_SOLVER, void*),
int (*options)(TAO_SOLVER,void*),
int (*line)(TAO_SOLVER,TaoVec*,TaoVec*,TaoVec*,TaoVec*,
double*,double*,double*,int*,void*),
int (*viewit)(TAO_SOLVER,void*),
int (*destroy)(TAO_SOLVER,void*),
void *ctx);
In this routine, the fourth argument is the function pointer to the line
search routine, and the seventh argument is the pointer that will be passed
to the line search routine. The other arguments are optional function
pointers than can be used to set up, view, and deallocate the solver.