smooth
A C++ library for Lie theory
|
Trust region algorithms for determining step size. More...
#include <optional>
#include <utility>
#include <Eigen/Cholesky>
#include <Eigen/Sparse>
#include <Eigen/SparseCholesky>
#include "smooth/version.hpp"
Go to the source code of this file.
Functions | |
template<typename D2 , typename D3 > | |
SMOOTH_BEGIN_NAMESPACE auto | solve_linear_ldlt (const auto &J, const Eigen::MatrixBase< D2 > &d, const Eigen::MatrixBase< D3 > &r, const double lambda, std::optional< std::reference_wrapper< double > > dphi={}) -> Eigen::Vector< typename std::decay_t< decltype(J)>::Scalar, std::decay_t< decltype(J)>::ColsAtCompileTime > |
Solve least-squares problem using LDL' decomposition. | |
template<typename D2 , typename D3 > | |
auto | solve_trust_region (const auto &J, const Eigen::MatrixBase< D2 > &d, const Eigen::MatrixBase< D3 > &r, const double Delta) -> std::pair< Eigen::Vector< typename std::decay_t< decltype(J)>::Scalar, std::decay_t< decltype(J)>::ColsAtCompileTime >, double > |
Approximately solve trust-region step determination problem. | |
Trust region algorithms for determining step size.
Definition in file tr_solver.hpp.
SMOOTH_BEGIN_NAMESPACE auto solve_linear_ldlt | ( | const auto & | J, |
const Eigen::MatrixBase< D2 > & | d, | ||
const Eigen::MatrixBase< D3 > & | r, | ||
const double | lambda, | ||
std::optional< std::reference_wrapper< double > > | dphi = {} |
||
) | -> Eigen::Vector<typename std::decay_t<decltype(J)>::Scalar, std::decay_t<decltype(J)>::ColsAtCompileTime> |
Solve least-squares problem using LDL' decomposition.
The problem is
[in] | J | matrix of size M x N |
[in] | d | positive vector of size N representing diagonal of D |
[in] | r | vector of size M |
[in] | lambda | non-zero number |
[out] | dphi | optionally calculate derivative ϕ'(λ) |
ϕ is the norm of the scaled solution as a function of λ:
The system (1) is solved via LDLt factorization of the left-hand side of the normal equations
Definition at line 48 of file tr_solver.hpp.
auto solve_trust_region | ( | const auto & | J, |
const Eigen::MatrixBase< D2 > & | d, | ||
const Eigen::MatrixBase< D3 > & | r, | ||
const double | Delta | ||
) | -> std:: pair<Eigen::Vector<typename std::decay_t<decltype(J)>::Scalar, std::decay_t<decltype(J)>::ColsAtCompileTime>, double> |
Approximately solve trust-region step determination problem.
The step determination problem is to find the minimizing dx of
J | matrix of size M x N |
d | vector of size N representing diagonal of D |
r | vector of size M |
Delta | trust region size |
It can be shown that (1) is equivalent to
for some λ that satisfies the complimentarity condition λ (|| D dx || - Δ) = 0.
in turn, (2) is equivalent to
which is the least-squares solution to
with normal equations
Definition at line 132 of file tr_solver.hpp.