An implementation of the Levenberg-Marquardt algorithm for least-square minimization.
Refer to this page for more details on the algorithm and its usage.
NUMTYPE | The numeric type for all the operations (float, double, or long double) |
USERPARAM | The type of the "y" input to the user supplied evaluation functor. Default type is a vector of NUMTYPE. |
Definition at line 33 of file CLevenbergMarquardt.h.
#include <mrpt/math/CLevenbergMarquardt.h>
Classes | |
struct | TResultInfo |
Public Types | |
typedef VECTORTYPE::Scalar | NUMTYPE |
typedef Eigen::Matrix< NUMTYPE, Eigen::Dynamic, Eigen::Dynamic > | matrix_t |
typedef VECTORTYPE | vector_t |
typedef void(* | TFunctorEval) (const VECTORTYPE &x, const USERPARAM &y, VECTORTYPE &out) |
The type of the function passed to execute. | |
typedef void(* | TFunctorIncrement) (VECTORTYPE &x_new, const VECTORTYPE &x_old, const VECTORTYPE &x_incr, const USERPARAM &user_param) |
The type of an optional functor passed to execute to replace the Euclidean addition "x_new = x_old + x_incr" by any other operation. | |
Static Public Member Functions | |
static void | execute (VECTORTYPE &out_optimal_x, const VECTORTYPE &x0, TFunctorEval functor, const VECTORTYPE &increments, const USERPARAM &userParam, TResultInfo &out_info, bool verbose=false, const size_t maxIter=200, const NUMTYPE tau=1e-3, const NUMTYPE e1=1e-8, const NUMTYPE e2=1e-8, bool returnPath=true, TFunctorIncrement x_increment_adder=NULL) |
Executes the LM-method, with derivatives estimated from functor is a user-provided function which takes as input two vectors, in this order: | |
static void | printf_debug (const char *frmt,...) |
Sends a formated text to "debugOut" if not NULL, or to cout otherwise. | |
typedef Eigen::Matrix<NUMTYPE,Eigen::Dynamic,Eigen::Dynamic> mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::matrix_t |
Definition at line 37 of file CLevenbergMarquardt.h.
typedef VECTORTYPE::Scalar mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::NUMTYPE |
Definition at line 36 of file CLevenbergMarquardt.h.
typedef void(* mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TFunctorEval) (const VECTORTYPE &x, const USERPARAM &y, VECTORTYPE &out) |
The type of the function passed to execute.
The user must supply a function which evaluates the error of a given point in the solution space.
x | The state point under examination. |
y | The same object passed to "execute" as the parameter "userParam". |
out | The vector of (non-squared) errors, of the average square root error, for the given "x". The functor code must set the size of this vector. |
Definition at line 46 of file CLevenbergMarquardt.h.
typedef void(* mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TFunctorIncrement) (VECTORTYPE &x_new, const VECTORTYPE &x_old, const VECTORTYPE &x_incr, const USERPARAM &user_param) |
The type of an optional functor passed to execute to replace the Euclidean addition "x_new = x_old + x_incr" by any other operation.
Definition at line 53 of file CLevenbergMarquardt.h.
typedef VECTORTYPE mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::vector_t |
Definition at line 38 of file CLevenbergMarquardt.h.
|
inlinestatic |
Executes the LM-method, with derivatives estimated from functor is a user-provided function which takes as input two vectors, in this order:
x_increment_adder Is an optional functor which may replace the Euclidean "x_new = x + x_increment" at the core of the incremental optimizer by any other operation. It can be used for example, in on-manifold optimizations.
Definition at line 82 of file CLevenbergMarquardt.h.
References ASSERT_, mrpt::math::estimateJacobian(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TResultInfo::final_sqr_err, mrpt::format(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TResultInfo::H, mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TResultInfo::iterations_executed, mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TResultInfo::last_err_vector, MRPT_END, MRPT_START, mrpt::math::norm(), mrpt::math::norm_inf(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::TResultInfo::path, and mrpt::utils::CDebugOutputCapable::printf_debug().
|
staticinherited |
Sends a formated text to "debugOut" if not NULL, or to cout otherwise.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().
Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 06:31:24 UTC 2023 |