This API is currently available in C++ and Python.

class OEOptimizer2

The OEOptimizer2 abstract class defines the interface for optimizing a set of variables for which a function, gradients and second derivatives (elements oh Hessian matrix) can be evaluated. Implementations of OEOptimizer2 use function values, gradients and second derivatives of function during optimization.

The OEOptimizer2 class defines the following public methods:
The following classes derive from this class:


double operator()(OEFunc2 &function, const double *var, double *opt_var)
double operator()(OEFunc2 &function, OECheckpoint1 *check, const double *var,
                  double *opt_var)

These virtual methods define the interface for optimizing a set of variables with the use of evaluated function values. The reference to the function object is passed as a first argument. Initial values of variables are passed in the array var. The optimized variables are returned in the array opt_var. Both operators return the value of the corresponding optimized function value. The second operator takes a pointer to the OECheckpoint1 object that can be used to monitor the progress of an optimization.


unsigned GetIterLimit() const

See SetIterLimit.


double GetTolerance() const

See SetTolerance.


void SetIterLimit(unsigned int itmax)

Defines the interface for setting the maximum number of iterations that an optimizer derived from the OEOptimizer2 will attempt while trying to identify a converged minimum function value. Optimization will cease if the iteration limit is reached without finding a converged minimum.


void SetTolerance(double t)

Defines the interface for setting the gradient convergence criteria. Depending on the implementation it might be the root mean square gradient, gradient norm or gradient dot product. Optimization will terminate normally if the convergence criteria set by this method is achieved during an optimization.