Class Scine::Utils::IRCOptimizerBase¶
-
class
IRCOptimizerBase
¶ The base class for all IRC optimizers.
The main purpose of this base class is to hide the template parameter(s) of the derived class(es).
Subclassed by Scine::Utils::IRCOptimizer< OptimizerType >
Public Functions
-
IRCOptimizerBase
()¶ Default constructor.
-
virtual
~IRCOptimizerBase
()¶ Virtual default destructor.
-
virtual int
optimize
(AtomCollection &atoms, const Eigen::VectorXd &mode, bool forward = true) = 0¶ The main functionality of the IRC optimizer.
This function wraps the optimize functions of the underlying optimizer.
- Return
int The final number of optimization cycles carried out.
- Parameters
atoms
: The AtomCollection (Geometry) to be optimized.
-
virtual void
setSettings
(const Settings &settings) = 0¶ Function to apply the given settings to underlying classes.
- Parameters
settings
: The new settings.
-
virtual Settings
getSettings
() const = 0¶ Get the public settings as a Utils::Settings object.
- Return
Settings A settings object with the current settings.
-
virtual void
addObserver
(std::function<void(const int&, const double&, const Eigen::VectorXd&)> function) = 0¶ Add an observer function that will be triggered in each iteration.
- Parameters
function
: A function to be executed in every loop of the optimization. The function will have access to the current cycle count, the current value and to a const reference of the current parameters.
-
virtual void
clearObservers
() = 0¶ Clear all existing observer functions.
For optimization problems with very fast evaluations of the underlying function the removal of all observers can increase performance as the observers are given as std::functions and can not be added via templates.
Public Members
-
double
initialStepSize
= 0.01¶ The size of the initial step along the chosen mode.
-
bool
transformCoordinates
= true¶ Switch to transform the coordinates from Cartesian into an internal space.
The optimization will be carried out in the internal coordinate space possibly accellerating convergence.
-