OpenLB 1.7
|
Optimization algorithm: BarzilaiBorwein. More...
#include <optimizerBarzilaiBorwein.h>
Public Member Functions | |
OptimizerBarzilaiBorwein (int dim, S eps, int maxIt, S lambda, int maxStepAttempts, std::string stepCondition, bool verboseOn=true, const std::string fname="", const std::string logFileName="", bool withUpperBound=false, S upperBound=S(), bool withLowerBound=false, S lowerBound=S(), bool vectorBounds=false, S controlEps=S(std::numeric_limits< double >::epsilon()), std::vector< OptimizerLogType > gplotAnalysis={}) | |
void | checkDerivativeZero () |
virtual void | computeDirection () |
Public Member Functions inherited from olb::opti::OptimizerLineSearch< S, C > | |
OptimizerLineSearch (int dimCtrl, S eps, int maxIt, S lambda, int maxStepAttempts, std::string stepCondition, bool verboseOn=true, const std::string fname="", const std::string logFileName="", bool withUpperBound=false, S upperBound=S(), bool withLowerBound=false, S lowerBound=S(), bool vectorBounds=false, S controlEps=S(std::numeric_limits< double >::epsilon()), bool failOnMaxIter=true, std::vector< OptimizerLogType > gplotAnalysis={}) | |
Construction of an OptimizerLineSearch. | |
virtual | ~OptimizerLineSearch () |
void | checkBound () |
void | boundControl () |
bool | smallerValue (const S &tempValue) |
bool | noCondition (const S &tempValue) |
bool | armijoWolfeConditions (const S &tempValue) |
void | quadraticInterpolationStep (const S &tempValue) |
void | backtrackingLineSearch (S &tempValue, S lambda, bool(OptimizerLineSearch::*condition)(const S &)) |
virtual void | optimizationStep () |
Optimization step: line search. | |
Public Member Functions inherited from olb::opti::Optimizer< S, C > | |
Optimizer (int dimCtrl, S eps, int maxIt, bool verboseOn=true, const std::string fname="", const std::string logFileName="", bool withUpperBound=false, S upperBound=S(), bool withLowerBound=false, S lowerBound=S(), bool vectorBounds=false, S controlEps=S(std::numeric_limits< double >::epsilon()), bool failOnMaxIter=true, std::vector< OptimizerLogType > gplotAnalysis={}) | |
virtual | ~Optimizer () |
void | maxIterationReached () |
virtual void | optimize () |
virtual void | optimize (OptiCase< S, C > &optiCase) |
void | simulate () |
void | simulate (OptiCase< S, C > &optiCase) |
void | evaluateObjective (const C &control, S &result) |
void | computeDerivatives (const C &control, C &derivatives) |
void | print (int it) |
Prints information of the current optimization step it. | |
void | setControl (C &control) |
const C & | getControl () const |
const C & | getDerivative () const |
const S & | getObjective () const |
int | getIteration () const |
void | writeControlToFile (const std::string fname="control.dat") |
Writes the current control variables linewise into file fname. | |
void | readControlFromFile (const std::string fname="control.dat") |
Reads the latest control variables from file fname. | |
void | setStartValue (S startValue) |
OptiCase< S, C > * | getOptiCase () |
void | setOptiCase (OptiCase< S, C > *optiCase) |
void | setGnuplotData () |
void | setReferenceControl (C result) |
set the reference value for the control vector (exact solution) | |
Additional Inherited Members | |
Public Attributes inherited from olb::opti::Optimizer< S, C > | |
Gnuplot< S > | gplot |
std::vector< OptimizerLogType > | _gplotAnalysis |
For defining what kind of gnuplot analysis is wanted, if empty vector - no analysis, value, control and derivative are the possible options. | |
Protected Attributes inherited from olb::opti::OptimizerLineSearch< S, C > | |
S | _lambda |
Lambda start value. | |
C | _direction |
Search direction. | |
bool | _lowerBoundFlag |
bool | _upperBoundFlag |
int | _maxStepAttempts |
Maximal number of step attempts for conditioned line search. | |
C | _nextDerivative |
bool | _nextDerivFlag |
std::string | _stepCondition |
bool(OptimizerLineSearch::* | _stepConditionFunction )(const S &) |
void(OptimizerLineSearch::* | _stepLengthFunction )(const S &) |
Protected Attributes inherited from olb::opti::Optimizer< S, C > | |
int | _dimCtrl |
Number of controlled variables. | |
C | _control |
Vector of controlled variables (size _dimCtrl) | |
S | _value |
Value of the objective functional evaluated for controlled variables saved in _control. | |
C | _derivative |
Vector of derivatives of the object functional with respect to the controlled variables. | |
int | _it |
Current iteration no. | |
int | _maxIt |
Maximal number of iteration. | |
bool | _failOnMaxIter |
Fail when max number of iteration reached. | |
S | _eps |
Optimizer stops if |_derivatives| < _eps. | |
bool | _verboseOn |
Verbose. | |
bool | _withUpperBound |
Bounded versions. | |
bool | _withLowerBound |
bool | _vectorBounds |
C | _boundedControl |
C | _upperBound |
C | _lowerBound |
bool | _controlsConverged |
For setting tolerance of controls. | |
S | _controlEps |
OptiCase< S, C > * | _optiCase |
Provides the Optimizer with methods to evaluate the value of an object functional and compute derivatives. | |
C | _referenceControl |
control vector to compare with (for numerical evaluation) | |
Optimization algorithm: BarzilaiBorwein.
OptimizerBarzilaiBorwein optimizes an optimization problem which is given in OptiCase. OptiCase provides therefore methods to evaluate an object functional and compute derivatives. BarzilaiBorwein searches along the direction of the derivative to find a lower value of the evaluated object functional. Thereby the steplength is adjusted to be an approximation of the Hessian. Barzilai-Borwein is therefore a "quasi" quasi Newton method.
This class is not intended to be derived from.
Definition at line 56 of file optimizerBarzilaiBorwein.h.
|
inline |
Definition at line 71 of file optimizerBarzilaiBorwein.h.
|
inline |
Definition at line 95 of file optimizerBarzilaiBorwein.h.
References olb::opti::OptimizerLineSearch< S, C >::_direction, and olb::util::euklidN().
|
inlinevirtual |
Implements olb::opti::OptimizerLineSearch< S, C >.
Definition at line 104 of file optimizerBarzilaiBorwein.h.
References olb::opti::Optimizer< S, C >::_control, olb::opti::Optimizer< S, C >::_derivative, olb::opti::Optimizer< S, C >::_dimCtrl, olb::opti::OptimizerLineSearch< S, C >::_direction, olb::opti::Optimizer< S, C >::_it, olb::opti::OptimizerLineSearch< S, C >::_lambda, olb::opti::OptimizerLineSearch< S, C >::_nextDerivative, olb::opti::OptimizerLineSearch< S, C >::_nextDerivFlag, olb::opti::OptimizerBarzilaiBorwein< S, C >::checkDerivativeZero(), olb::opti::Optimizer< S, C >::computeDerivatives(), and olb::util::euklidN().