|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Dense implementation of the Gauss-Newton optimization algorithm. More...
#include <gauss_newton_solver.h>
Public Member Functions | |
| GaussNewtonSolverT (const SolverOptions &options, SolverFunctionT< T > *solver) | |
| Creates a solver with the specified options and function to optimize. | |
| std::string_view | getName () const override |
| Returns "GaussNewton" as the solver name. | |
| void | setOptions (const SolverOptions &options) final |
| Updates solver configuration, handling both base and Gauss-Newton specific options. | |
| const Eigen::MatrixX< T > & | getLastJtJ () const |
| const Eigen::VectorX< T > & | getLastJtR () const |
| Public Member Functions inherited from momentum::SolverT< T > | |
| SolverT (const SolverOptions &options, SolverFunctionT< T > *solver) | |
| Constructor with solver options and function to optimize. | |
| virtual | ~SolverT ()=default |
| double | solve (Eigen::VectorX< T > ¶ms) |
| Solves the optimization problem. | |
| virtual void | setEnabledParameters (const ParameterSet ¶meters) |
| Specifies which parameters should be optimized. | |
| const ParameterSet & | getActiveParameters () const |
| Returns the current set of enabled parameters. | |
| void | setParameters (const Eigen::VectorX< T > ¶ms) |
| Sets the current parameter values without solving. | |
| void | setStoreHistory (bool b) |
| Controls whether to store iteration history for debugging and analysis. | |
| const std::unordered_map< std::string, Eigen::MatrixX< T > > & | getHistory () const |
| Returns the history of the solver's iterations. | |
| size_t | getMinIterations () const |
| Returns the minimum number of iterations before checking convergence. | |
| size_t | getMaxIterations () const |
| Returns the maximum number of iterations before terminating. | |
| size_t | getNumParameters () const |
| const std::vector< double > & | getErrorHistory () const |
| Returns the history of objective function values over the iterations of the solve. | |
Protected Member Functions | |
| void | doIteration () final |
| Performs one iteration of the Gauss-Newton algorithm. | |
| void | initializeSolver () final |
| Initializes solver state before optimization begins. | |
Additional Inherited Members | |
| Protected Attributes inherited from momentum::SolverT< T > | |
| size_t | numParameters_ |
| Total number of parameters in the optimization problem. | |
| SolverFunctionT< T > * | solverFunction_ |
| Function to be optimized. | |
| Eigen::VectorX< T > | parameters_ |
| Current parameter values. | |
| ParameterSet | activeParameters_ |
| Bitset indicating which parameters are enabled for optimization. | |
| int | actualParameters_ |
| Number of parameters currently enabled for optimization. | |
| bool | newParameterPattern_ |
| Flag indicating parameter structure has changed. | |
| size_t | iteration_ {} |
| Current iteration count. | |
| double | error_ {} |
| Current objective function value. | |
| double | lastError_ {} |
| Previous iteration's objective function value. | |
| bool | storeHistory = false |
| Whether to record optimization progress for analysis. | |
| std::unordered_map< std::string, Eigen::MatrixX< T > > | iterationHistory_ |
| Recorded data from optimization process. | |
| std::vector< double > | errorHistory_ |
| History of objective function values over the iterations. | |
| bool | verbose_ = false |
| Whether to output detailed progress information. | |
Dense implementation of the Gauss-Newton optimization algorithm.
Minimizes non-linear least squares problems by iteratively approximating the objective function with a quadratic model based on first derivatives. Uses dense matrix operations for small to medium-sized parameter spaces.
Definition at line 67 of file gauss_newton_solver.h.
| momentum::GaussNewtonSolverT< T >::GaussNewtonSolverT | ( | const SolverOptions & | options, |
| SolverFunctionT< T > * | solver ) |
Creates a solver with the specified options and function to optimize.
Definition at line 19 of file gauss_newton_solver.cpp.
References momentum::GaussNewtonSolverBaseOptions::doLineSearch, momentum::GaussNewtonSolverBaseOptions::regularization, setOptions(), momentum::SolverT< T >::SolverT(), momentum::GaussNewtonSolverOptions::targetRowsPerChunk, and momentum::GaussNewtonSolverOptions::useBlockJtJ.
|
finalprotectedvirtual |
Performs one iteration of the Gauss-Newton algorithm.
Implements momentum::SolverT< T >.
Definition at line 224 of file gauss_newton_solver.cpp.
References momentum::SolverT< T >::actualParameters_, momentum::SolverT< T >::getMaxIterations(), momentum::SolverT< T >::iteration_, momentum::SolverT< T >::iterationHistory_, MT_PROFILE_EVENT, MT_PROFILE_FUNCTION, momentum::SolverT< T >::numParameters_, and momentum::SolverT< T >::storeHistory.
|
inline |
Definition at line 79 of file gauss_newton_solver.h.
|
inline |
Definition at line 82 of file gauss_newton_solver.h.
|
nodiscardoverridevirtual |
Returns "GaussNewton" as the solver name.
Implements momentum::SolverT< T >.
Definition at line 32 of file gauss_newton_solver.cpp.
|
finalprotectedvirtual |
Initializes solver state before optimization begins.
Implements momentum::SolverT< T >.
Definition at line 49 of file gauss_newton_solver.cpp.
|
finalvirtual |
Updates solver configuration, handling both base and Gauss-Newton specific options.
Reimplemented from momentum::SolverT< T >.
Definition at line 37 of file gauss_newton_solver.cpp.
References momentum::SolverT< T >::setOptions().
Referenced by GaussNewtonSolverT().