queso-0.57.1
|
A base class for handling optimisation of scalar functions. More...
#include <Optimizer.h>
Public Member Functions | |
BaseOptimizer () | |
Default constructor. More... | |
BaseOptimizer (OptimizerOptions options) | |
Constructor that takes an options object. More... | |
virtual | ~BaseOptimizer () |
Destructor. More... | |
virtual void | minimize (OptimizerMonitor *monitor)=0 |
Minimize the objective function, starting at m_initialPoint . More... | |
unsigned int | getMaxIterations () const |
Returns the maximum number of iterations the optimizer will do. More... | |
double | getTolerance () const |
Returns the tolerance used to test for an extremum in the optimizer. More... | |
double | getFiniteDifferenceStepSize () const |
Returns the step size used in the finite difference formula. More... | |
virtual std::string | getSolverType () const |
Gets the algorithm to use for minimisation. More... | |
virtual double | getFstepSize () const |
Gets the step size to use in gradient-free solvers. More... | |
virtual double | getFdfstepSize () const |
Gets the step to use in gradient-based solvers. More... | |
virtual double | getLineTolerance () const |
Gets the tolerance to use for line minimisation. More... | |
void | setMaxIterations (unsigned int maxIterations) |
Sets the maximum number of iterations to be used by the optimizer. More... | |
void | setTolerance (double tolerance) |
Sets the tolerance the optimizer will use to test for an extremum. More... | |
void | setFiniteDifferenceStepSize (double h) |
Sets the step to use in the finite difference derivative. More... | |
virtual void | setSolverType (std::string solverType) |
Sets the algorithm to use for minimisation. More... | |
virtual void | setFstepSize (double fstepSize) |
Sets the step size to use in gradient-free solvers. More... | |
virtual void | setFdfstepSize (double fdfstepSize) |
Sets the step to use in gradient-based solvers. More... | |
virtual void | setLineTolerance (double lineTolerance) |
Sets the tolerance to use for line minimisation. More... | |
Protected Attributes | |
unsigned int | m_maxIterations |
double | m_tolerance |
double | m_finiteDifferenceStepSize |
std::string | m_solverType |
double | m_fstepSize |
double | m_fdfstepSize |
double | m_lineTolerance |
ScopedPtr< OptimizerOptions >::Type | m_optionsObj |
A base class for handling optimisation of scalar functions.
This class defines the interface every optimizer must adhere to. All optimizers should subclass this class.
Definition at line 47 of file Optimizer.h.
QUESO::BaseOptimizer::BaseOptimizer | ( | ) |
Default constructor.
Definition at line 29 of file Optimizer.C.
References m_optionsObj.
QUESO::BaseOptimizer::BaseOptimizer | ( | OptimizerOptions | options | ) |
Constructor that takes an options object.
Definition at line 41 of file Optimizer.C.
References m_optionsObj.
|
virtual |
|
virtual |
Gets the step to use in gradient-based solvers.
Reimplemented in QUESO::GslOptimizer.
Definition at line 81 of file Optimizer.C.
References m_optionsObj.
double QUESO::BaseOptimizer::getFiniteDifferenceStepSize | ( | ) | const |
Returns the step size used in the finite difference formula.
Default value is 1e-4
Definition at line 63 of file Optimizer.C.
References m_optionsObj.
Referenced by QUESO::c_evaluate_derivative().
|
virtual |
Gets the step size to use in gradient-free solvers.
Reimplemented in QUESO::GslOptimizer.
Definition at line 75 of file Optimizer.C.
References m_optionsObj.
|
virtual |
Gets the tolerance to use for line minimisation.
Reimplemented in QUESO::GslOptimizer.
Definition at line 87 of file Optimizer.C.
References m_optionsObj.
unsigned int QUESO::BaseOptimizer::getMaxIterations | ( | ) | const |
Returns the maximum number of iterations the optimizer will do.
Default value is 100
Definition at line 51 of file Optimizer.C.
References m_optionsObj.
Referenced by QUESO::GslOptimizer::minimize_no_gradient(), and QUESO::GslOptimizer::minimize_with_gradient().
|
virtual |
Gets the algorithm to use for minimisation.
Reimplemented in QUESO::GslOptimizer.
Definition at line 69 of file Optimizer.C.
References m_optionsObj.
double QUESO::BaseOptimizer::getTolerance | ( | ) | const |
Returns the tolerance used to test for an extremum in the optimizer.
Default value is 1e-3
Definition at line 57 of file Optimizer.C.
References m_optionsObj.
Referenced by QUESO::GslOptimizer::minimize_no_gradient().
|
pure virtual |
Minimize the objective function, starting at m_initialPoint
.
m_initialPoint is handled in the derived class
Implemented in QUESO::GslOptimizer.
|
virtual |
Sets the step to use in gradient-based solvers.
Reimplemented in QUESO::GslOptimizer.
Definition at line 123 of file Optimizer.C.
References m_optionsObj.
void QUESO::BaseOptimizer::setFiniteDifferenceStepSize | ( | double | h | ) |
Sets the step to use in the finite difference derivative.
Definition at line 105 of file Optimizer.C.
References m_optionsObj.
|
virtual |
Sets the step size to use in gradient-free solvers.
Reimplemented in QUESO::GslOptimizer.
Definition at line 117 of file Optimizer.C.
References m_optionsObj.
|
virtual |
Sets the tolerance to use for line minimisation.
Reimplemented in QUESO::GslOptimizer.
Definition at line 129 of file Optimizer.C.
References m_optionsObj.
void QUESO::BaseOptimizer::setMaxIterations | ( | unsigned int | maxIterations | ) |
Sets the maximum number of iterations to be used by the optimizer.
Definition at line 93 of file Optimizer.C.
References m_optionsObj.
|
virtual |
Sets the algorithm to use for minimisation.
Reimplemented in QUESO::GslOptimizer.
Definition at line 111 of file Optimizer.C.
References m_optionsObj.
void QUESO::BaseOptimizer::setTolerance | ( | double | tolerance | ) |
Sets the tolerance the optimizer will use to test for an extremum.
Definition at line 99 of file Optimizer.C.
References m_optionsObj.
|
protected |
Definition at line 122 of file Optimizer.h.
|
protected |
Definition at line 119 of file Optimizer.h.
|
protected |
Definition at line 121 of file Optimizer.h.
|
protected |
Definition at line 123 of file Optimizer.h.
|
protected |
Definition at line 117 of file Optimizer.h.
|
protected |
Definition at line 126 of file Optimizer.h.
Referenced by BaseOptimizer(), getFdfstepSize(), QUESO::GslOptimizer::getFdfstepSize(), getFiniteDifferenceStepSize(), getFstepSize(), QUESO::GslOptimizer::getFstepSize(), getLineTolerance(), QUESO::GslOptimizer::getLineTolerance(), getMaxIterations(), getSolverType(), QUESO::GslOptimizer::getSolverType(), getTolerance(), setFdfstepSize(), QUESO::GslOptimizer::setFdfstepSize(), setFiniteDifferenceStepSize(), setFstepSize(), QUESO::GslOptimizer::setFstepSize(), setLineTolerance(), QUESO::GslOptimizer::setLineTolerance(), setMaxIterations(), setSolverType(), QUESO::GslOptimizer::setSolverType(), and setTolerance().
|
protected |
Definition at line 120 of file Optimizer.h.
|
protected |
Definition at line 118 of file Optimizer.h.