Darwin
1.10(beta)
|
Interface for solving large-scale unconstrained optimization problems using L-BFGS. More...
Public Member Functions | |
drwnOptimizer () | |
default constructor | |
drwnOptimizer (unsigned n) | |
construct a problem with dimension n | |
drwnOptimizer (const drwnOptimizer &o) | |
copy constructor | |
void | initialize (unsigned n, const double *x=NULL) |
initialize an optimization problem of size n possibly with feasible starting point x ![]() | |
void | initialize (const double *x=NULL) |
initialize an optimization problem at feasible starting point x in ![]() | |
double | solve (unsigned maxiter, bool bMonitor=false) |
Solve the optimization problem for up to maxiter iterations to precision set by EPSF, EPSG, and EPSX static variables. Calls monitor function after each iteration if bMonitor is true. | |
virtual double | objective (const double *x) const =0 |
returns value of objective function at point x | |
virtual void | gradient (const double *x, double *df) const =0 |
populates gradient of objective function at point x | |
virtual double | objectiveAndGradient (const double *x, double *df) const |
returns value of objective function and populates gradient df at point x | |
unsigned | size () const |
dimension of optimization problem | |
double | operator[] (unsigned i) const |
returns the i-th component of the current solution | |
double & | operator[] (unsigned i) |
returns a reference to the i-th component of the current solution | |
virtual void | monitor (unsigned iter, double objValue) |
callback for each iteration during optimization (if bMonitor is true) | |
Public Attributes | |
unsigned | _n |
dimension of optimization problem (i.e., ![]() | |
double * | _x |
current feasible solution in ![]() | |
double * | _df |
gradient at _x in ![]() | |
Static Public Attributes | |
static double | EPSF = 1.0e-6 |
default tolerance on function convergence | |
static double | EPSG = 1.0e-3 |
deafult tolerance on gradient convergence | |
static double | EPSX = 1.0e-6 |
default tolerance on solution convergence | |
Interface for solving large-scale unconstrained optimization problems using L-BFGS.
Implements optimization using L-BFGS code is based on an implementation by Jorge Nocedal:
The derived class must override functions objective and gradient. It should also implement the objectiveAndGradient function for efficiency, and may override the monitor function. The monitor function can assume that _x contains the current estimate for the solution. Other functions should use the input argument.
This class tries to minimize the objective function define by objective.
The following simple example optimizes the one-dimensional function .