Newton's method for optimization.
More...
#include <Newton.h>
|
| | Newton (int nMaxIters=10, TScalar gtol=TScalar(1e-4), Index n=0) |
| | Construct a new Newton optimizer.
|
| |
| template<class FPrepareDerivatives, class FObjective, class FGradient, class FHessianInverseProduct, class TDerivedX> |
| TScalar | Solve (FPrepareDerivatives prepareDerivatives, FObjective f, FGradient g, FHessianInverseProduct Hinv, Eigen::MatrixBase< TDerivedX > &xk, std::optional< BackTrackingLineSearch< TScalar > > lineSearch=std::nullopt) |
| | Solve the optimization problem using Newton's method.
|
| |
|
|
int | nMaxIters |
| | Maximum number of iterations for the Newton solver.
|
| |
|
TScalar | gtol2 |
| | Gradient squared norm threshold for convergence.
|
| |
|
Eigen::Vector< TScalar, Eigen::Dynamic > | dxk |
| | Step direction.
|
| |
|
Eigen::Vector< TScalar, Eigen::Dynamic > | gk |
| | Gradient at current iteration.
|
| |
template<class TScalar = Scalar>
struct pbat::math::optimization::Newton< TScalar >
Newton's method for optimization.
- Template Parameters
-
◆ Newton()
Construct a new Newton optimizer.
- Parameters
-
| nMaxIters | Maximum number of iterations for the Newton solver |
| gtol | Gradient norm threshold for convergence |
| n | Number of degrees of freedom |
◆ Solve()
template<class TScalar>
template<class FPrepareDerivatives, class FObjective, class FGradient, class FHessianInverseProduct, class TDerivedX>
| TScalar pbat::math::optimization::Newton< TScalar >::Solve |
( |
FPrepareDerivatives | prepareDerivatives, |
|
|
FObjective | f, |
|
|
FGradient | g, |
|
|
FHessianInverseProduct | Hinv, |
|
|
Eigen::MatrixBase< TDerivedX > & | xk, |
|
|
std::optional< BackTrackingLineSearch< TScalar > > | lineSearch = std::nullopt ) |
|
inline |
Solve the optimization problem using Newton's method.
- Template Parameters
-
| FPrepareDerivatives | Callable type with signature prepareDerivatives(xk) -> void |
| FObjective | Callable type for the objective function with signature f(xk) -> fk |
| FGradient | Callable type for the gradient with signature g(xk) -> gk |
| FHessianInverseProduct | Callable type for the Hessian inverse product with signature Hinv(xk, gk) -> dxk |
| TDerivedX | Derived type for the input iterate |
- Parameters
-
| prepareDerivatives | Derivative (pre)computation function |
| f | Objective function |
| g | Gradient function |
| Hinv | Hessian inverse product function |
| xk | Current iterate |
| lineSearch | Optional line search object |
- Returns
- Squared norm of the gradient at the final iterate
The documentation for this struct was generated from the following file:
- C:/git/PhysicsBasedAnimationToolkit/source/pbat/math/optimization/Newton.h