The first argument is always the TAO structure. This structure may be used to obtain the vectors used to store the variables and the function gradient, evaluate a function and gradient, solve a set of linear equations, perform a line search, and apply a convergence test.
The second argument is specific to this solver. This pointer will be set
in the initialization routine and cast to an appropriate type in
the other routines. To implement the Fletcher - Reeves conjugate
gradient algorithm, for instance, the following structure may
be useful.
typedef struct{ double beta; TaoVec *gg; TaoVec *dx; /* step direction */ TaoVec *ww; /* work vector */ } TAO_CG;This structure contains two work vectors and a scalar. Vectors for the solution and gradient are not needed here because the TAO structure has pointers to them.