Decleration of the Conjugate Gradients optimizer. More...
#include <ConjugateGradients.h>
Public Member Functions | |
| ConjugateGradients (std::shared_ptr< ObjectiveFunction > a_objf, const Parameters &a_params) | |
| Conjugate Gradients optimizer constructor. | |
| ~ConjugateGradients ()=default | |
| Conjugant Gradient deconstructor. | |
| int | step (double a_maxMove) override |
| Calls the next step in the algorithm. | |
| int | run (size_t a_maxIterations, double a_maxMove) override |
| Runs the conjugate gradient. | |
| Eigen::VectorXd | getStep () |
| Gets the direction of the next step. | |
| Public Member Functions inherited from eonc::Optimizer | |
| Optimizer (std::shared_ptr< ObjectiveFunction > a_objf, const OptimizerConfig &a_config) | |
| Optimizer (std::shared_ptr< ObjectiveFunction > a_objf, OptType a_optype, const OptimizerConfig &a_config) | |
| Optimizer (std::shared_ptr< ObjectiveFunction > a_objf, const Parameters &a_params) | |
| Optimizer (std::shared_ptr< ObjectiveFunction > a_objf, OptType a_optype, const Parameters &a_params) | |
| virtual | ~Optimizer () |
Private Member Functions | |
| int | single_step (double a_maxMove) |
| Steps the conjugate gradient. | |
| int | line_search (double a_maxMove) |
| Steps the conjugate gradient. | |
Private Attributes | |
| Eigen::VectorXd | m_direction |
| Current step direction of the conjugate gradient. | |
| Eigen::VectorXd | m_directionOld |
| Algorithms previous step direction. | |
| Eigen::VectorXd | m_directionNorm |
| Normalised version of the current direction vector. | |
| Eigen::VectorXd | m_force |
| Current force vector. | |
| Eigen::VectorXd | m_forceOld |
| Previous force vector. | |
| eonc::log::FileScoped | m_log {"cg", "_cg.log"} |
| size_t | m_cg_i |
| Counts the number of discrete steps until algorithm convergence. | |
Additional Inherited Members | |
| Protected Attributes inherited from eonc::Optimizer | |
| const OptimizerConfig | m_optConfig |
| std::shared_ptr< ObjectiveFunction > | m_objf |
Decleration of the Conjugate Gradients optimizer.
Definition at line 38 of file ConjugateGradients.h.
|
inline |
Conjugate Gradients optimizer constructor.
| std::shared_ptr<ObjectiveFunction> | m_objf that tells the optimizer how to run |
| const | Parameters& m_params defined by the config.init file |
Definition at line 46 of file ConjugateGradients.h.
|
default |
Conjugant Gradient deconstructor.
| Eigen::VectorXd ConjugateGradients::getStep | ( | ) |
Gets the direction of the next step.
Definition at line 17 of file ConjugateGradients.cpp.
|
private |
Steps the conjugate gradient.
Checks for convergence based on the ratio of the projected force along a line to the norm of the total force
Definition at line 57 of file ConjugateGradients.cpp.
|
overridevirtual |
Runs the conjugate gradient.
Implements eonc::Optimizer.
Definition at line 192 of file ConjugateGradients.cpp.
|
private |
Steps the conjugate gradient.
Checks for convergence based on the change in displacement or direction
Definition at line 114 of file ConjugateGradients.cpp.
|
overridevirtual |
Calls the next step in the algorithm.
Either calls the single_step or line_search method depending on the parameters
Implements eonc::Optimizer.
Definition at line 45 of file ConjugateGradients.cpp.
|
private |
Counts the number of discrete steps until algorithm convergence.
Definition at line 84 of file ConjugateGradients.h.
|
private |
Current step direction of the conjugate gradient.
Definition at line 72 of file ConjugateGradients.h.
|
private |
Normalised version of the current direction vector.
Definition at line 76 of file ConjugateGradients.h.
|
private |
Algorithms previous step direction.
Definition at line 74 of file ConjugateGradients.h.
|
private |
Current force vector.
Definition at line 78 of file ConjugateGradients.h.
|
private |
Previous force vector.
Definition at line 80 of file ConjugateGradients.h.
|
private |
Definition at line 81 of file ConjugateGradients.h.