|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
#include <multipose_solver_function.h>
Public Member Functions | |
| MultiposeSolverFunctionT (const Skeleton *skel, const ParameterTransformT< T > *parameterTransform, std::span< const int > universal, size_t frames) | |
| ~MultiposeSolverFunctionT () override | |
| MultiposeSolverFunctionT (const MultiposeSolverFunctionT &)=default | |
| MultiposeSolverFunctionT & | operator= (const MultiposeSolverFunctionT &)=default |
| MultiposeSolverFunctionT (MultiposeSolverFunctionT &&) noexcept=default | |
| MultiposeSolverFunctionT & | operator= (MultiposeSolverFunctionT &&) noexcept=default |
| double | getError (const Eigen::VectorX< T > ¶meters) final |
| double | getGradient (const Eigen::VectorX< T > ¶meters, Eigen::VectorX< T > &gradient) final |
| void | initializeJacobianComputation (const Eigen::VectorX< T > ¶meters) override |
| size_t | getJacobianBlockCount () const override |
| Returns the number of Jacobian blocks available. | |
| size_t | getJacobianBlockSize (size_t blockIndex) const override |
| Returns the maximum number of rows for a specific Jacobian block. | |
| double | computeJacobianBlock (const Eigen::VectorX< T > ¶meters, size_t blockIndex, Eigen::Ref< Eigen::MatrixX< T > > jacobianBlock, Eigen::Ref< Eigen::VectorX< T > > residualBlock, size_t &actualRows) override |
| void | finalizeJacobianComputation () override |
| Optional cleanup after all Jacobian blocks have been computed. | |
| void | updateParameters (Eigen::VectorX< T > ¶meters, const Eigen::VectorX< T > &gradient) final |
| void | setEnabledParameters (const ParameterSet ¶meterSet) final |
| Specifies which parameters should be optimized. | |
| void | addErrorFunction (size_t frame, SkeletonErrorFunctionT< T > *errorFunction) |
| size_t | getNumFrames () const |
| const ModelParametersT< T > & | getFrameParameters (const size_t frame) const |
| void | setFrameParameters (size_t frame, const ModelParametersT< T > ¶meters) |
| Eigen::VectorX< T > | getUniversalParameters () const |
| Eigen::VectorX< T > | getJoinedParameterVector () const |
| void | setJoinedParameterVector (const Eigen::VectorX< T > &joinedParameters) |
| ParameterSet | getUniversalParameterSet () const |
| ParameterSet | getUniversalLocatorParameterSet () const |
| Public Member Functions inherited from momentum::SolverFunctionT< T > | |
| virtual | ~SolverFunctionT ()=default |
| virtual double | getError (const VectorX< T > ¶meters)=0 |
| Evaluates the objective function at the given parameter values. | |
| virtual double | getGradient (const VectorX< T > ¶meters, VectorX< T > &gradient)=0 |
| Computes the gradient of the objective function. | |
| double | getJacobian (const VectorX< T > ¶meters, MatrixX< T > &jacobian, VectorX< T > &residual, size_t &actualRows) |
| Computes the Jacobian matrix for least squares problems. | |
| virtual void | getHessian (const VectorX< T > ¶meters, MatrixX< T > &hessian) |
| Computes the Hessian matrix of second derivatives. | |
| virtual double | getJtJR (const VectorX< T > ¶meters, MatrixX< T > &jtj, VectorX< T > &jtr) |
| Computes JᵀJ and JᵀR for Gauss-Newton optimization. | |
| virtual double | getJtJR_Sparse (const VectorX< T > ¶meters, SparseMatrix< T > &jtj, VectorX< T > &jtr) |
| Computes sparse JᵀJ and JᵀR for large-scale problems. | |
| virtual void | initializeJacobianComputation (const VectorX< T > ¶meters)=0 |
| Initializes Jacobian computation for the given parameters. | |
| virtual double | computeJacobianBlock (const VectorX< T > ¶meters, size_t blockIndex, Eigen::Ref< MatrixX< T > > jacobianBlock, Eigen::Ref< VectorX< T > > residualBlock, size_t &actualRows)=0 |
| Computes a specific Jacobian block. | |
| virtual double | getSolverDerivatives (const VectorX< T > ¶meters, MatrixX< T > &hess, VectorX< T > &grad) |
| Computes derivatives needed by the solver. | |
| virtual void | updateParameters (VectorX< T > ¶meters, const VectorX< T > &gradient)=0 |
| Updates parameters using the computed step direction. | |
| size_t | getNumParameters () const |
| Returns the total number of parameters in the optimization problem. | |
| size_t | getActualParameters () const |
| Returns the number of parameters currently enabled for optimization. | |
| virtual void | storeHistory (std::unordered_map< std::string, MatrixX< T > > &history, size_t iteration, size_t maxIterations_) |
| Records solver state for debugging and analysis. | |
Friends | |
| class | MultiposeSolverT< T > |
Additional Inherited Members | |
| Protected Attributes inherited from momentum::SolverFunctionT< T > | |
| size_t | numParameters_ {} |
| Total number of parameters in the optimization problem. | |
| size_t | actualParameters_ {} |
| Number of parameters currently enabled for optimization. | |
| ResizeableMatrix< T > | tJacobian_ |
| Pre-allocated temporary storage for block-wise JtJ computation. | |
| ResizeableMatrix< T > | tResidual_ |
Definition at line 20 of file multipose_solver_function.h.
| momentum::MultiposeSolverFunctionT< T >::MultiposeSolverFunctionT | ( | const Skeleton * | skel, |
| const ParameterTransformT< T > * | parameterTransform, | ||
| std::span< const int > | universal, | ||
| size_t | frames ) |
|
overridedefault |
|
default |
|
defaultnoexcept |
| void momentum::MultiposeSolverFunctionT< T >::addErrorFunction | ( | size_t | frame, |
| SkeletonErrorFunctionT< T > * | errorFunction ) |
Definition at line 366 of file multipose_solver_function.cpp.
References MT_CHECK.
|
override |
Definition at line 291 of file multipose_solver_function.cpp.
References getJacobianBlockSize(), getNumFrames(), and MT_PROFILE_FUNCTION.
|
overridevirtual |
Optional cleanup after all Jacobian blocks have been computed.
Called after all blocks have been processed. Default implementation does nothing.
Reimplemented from momentum::SolverFunctionT< T >.
Definition at line 346 of file multipose_solver_function.cpp.
|
final |
Definition at line 175 of file multipose_solver_function.cpp.
References getNumFrames(), and MT_CHECK.
|
inlinenodiscard |
Definition at line 58 of file multipose_solver_function.h.
|
final |
Definition at line 200 of file multipose_solver_function.cpp.
References getNumFrames(), and MT_CHECK.
|
nodiscardoverridevirtual |
Returns the number of Jacobian blocks available.
Each block corresponds to one error function or constraint group
Implements momentum::SolverFunctionT< T >.
Definition at line 270 of file multipose_solver_function.cpp.
References getNumFrames().
|
nodiscardoverridevirtual |
Returns the maximum number of rows for a specific Jacobian block.
This is the maximum size; actual rows may be fewer (returned via actualRows)
| blockIndex | Index of the block (0 to getJacobianBlockCount()-1) |
Implements momentum::SolverFunctionT< T >.
Definition at line 275 of file multipose_solver_function.cpp.
References getNumFrames().
Referenced by computeJacobianBlock(), and initializeJacobianComputation().
|
nodiscard |
Definition at line 105 of file multipose_solver_function.cpp.
References getNumFrames(), and momentum::SolverFunctionT< T >::numParameters_.
|
inlinenodiscard |
Definition at line 54 of file multipose_solver_function.h.
Referenced by computeJacobianBlock(), getError(), getGradient(), getJacobianBlockCount(), getJacobianBlockSize(), getJoinedParameterVector(), getUniversalLocatorParameterSet(), getUniversalParameterSet(), initializeJacobianComputation(), MultiposeSolverFunctionT(), and setEnabledParameters().
|
nodiscard |
Definition at line 158 of file multipose_solver_function.cpp.
References getNumFrames().
|
nodiscard |
Definition at line 100 of file multipose_solver_function.cpp.
References momentum::EigenStrongType< Derived, EigenType >::v.
|
nodiscard |
Definition at line 147 of file multipose_solver_function.cpp.
References getNumFrames().
|
override |
Definition at line 245 of file multipose_solver_function.cpp.
References getJacobianBlockSize(), getNumFrames(), MT_CHECK, and MT_PROFILE_FUNCTION.
|
default |
|
defaultnoexcept |
|
finalvirtual |
Specifies which parameters should be optimized.
Default implementation does nothing
| parameterSet | Bitset where each bit indicates if the corresponding parameter is enabled |
Reimplemented from momentum::SolverFunctionT< T >.
Definition at line 60 of file multipose_solver_function.cpp.
References momentum::SolverFunctionT< T >::actualParameters_, and getNumFrames().
| void momentum::MultiposeSolverFunctionT< T >::setFrameParameters | ( | size_t | frame, |
| const ModelParametersT< T > & | parameters ) |
Definition at line 90 of file multipose_solver_function.cpp.
References MT_CHECK, and momentum::EigenStrongType< Derived, EigenType >::size().
| void momentum::MultiposeSolverFunctionT< T >::setJoinedParameterVector | ( | const Eigen::VectorX< T > & | joinedParameters | ) |
Definition at line 124 of file multipose_solver_function.cpp.
|
final |
Definition at line 352 of file multipose_solver_function.cpp.
References MT_CHECK.
|
friend |
Definition at line 90 of file multipose_solver_function.h.