queso-0.53.0
|
A base class for handling optimisation of scalar functions. More...
#include <Optimizer.h>
Public Member Functions | |
BaseOptimizer () | |
Default constructor. 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... | |
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... | |
Protected Attributes | |
unsigned int | m_maxIterations |
double | m_tolerance |
double | m_finiteDifferenceStepSize |
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 44 of file Optimizer.h.
QUESO::BaseOptimizer::BaseOptimizer | ( | ) |
Default constructor.
Definition at line 29 of file Optimizer.C.
|
virtual |
double QUESO::BaseOptimizer::getFiniteDifferenceStepSize | ( | ) | const |
Returns the step size used in the finite difference formula.
Default value is 1e-4
Definition at line 53 of file Optimizer.C.
References m_finiteDifferenceStepSize.
Referenced by QUESO::c_evaluate_derivative().
unsigned int QUESO::BaseOptimizer::getMaxIterations | ( | ) | const |
Returns the maximum number of iterations the optimizer will do.
Default value is 100
Definition at line 41 of file Optimizer.C.
References m_maxIterations.
Referenced by QUESO::GslOptimizer::minimize_no_gradient(), and QUESO::GslOptimizer::minimize_with_gradient().
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 47 of file Optimizer.C.
References m_tolerance.
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.
void QUESO::BaseOptimizer::setFiniteDifferenceStepSize | ( | double | h | ) |
Sets the step to use in the finite difference derivative.
Definition at line 71 of file Optimizer.C.
References m_finiteDifferenceStepSize.
void QUESO::BaseOptimizer::setMaxIterations | ( | unsigned int | maxIterations | ) |
Sets the maximum number of iterations to be used by the optimizer.
Definition at line 59 of file Optimizer.C.
References m_maxIterations.
void QUESO::BaseOptimizer::setTolerance | ( | double | tolerance | ) |
Sets the tolerance the optimizer will use to test for an extremum.
Definition at line 65 of file Optimizer.C.
References m_tolerance.
|
protected |
Definition at line 89 of file Optimizer.h.
Referenced by getFiniteDifferenceStepSize(), and setFiniteDifferenceStepSize().
|
protected |
Definition at line 87 of file Optimizer.h.
Referenced by getMaxIterations(), and setMaxIterations().
|
protected |
Definition at line 88 of file Optimizer.h.
Referenced by getTolerance(), and setTolerance().