251 template<
class Scalar>
313 std::vector<Jacobian>
js;
354 const std::vector<Jacobian> &js=std::vector<Jacobian>(),
355 Scalar tau=1.e-3,
int maxIterations=200,
356 Scalar minError = 1.e-6, Scalar lambdaMultiplier=10,
357 Scalar eps1 = 1.49012e-08, Scalar eps2 = 1.49012e-08,
358 const std::string &linSolver=
"svd");
360 const std::vector<JacobianMat> &js=std::vector<JacobianMat>(),
361 Scalar tau=1.e-3,
int maxIterations=200,
362 Scalar minError = 1.e-6, Scalar lambdaMultiplier=10,
363 Scalar eps1 = 1.49012e-08, Scalar eps2 = 1.49012e-08,
364 const std::string &linSolver=
"svd");
370 void setUseMultiThreading(
bool enable);
374 void init(
Function f,
int outputDim,
375 const std::vector<Jacobian> &js=std::vector<Jacobian>(),
376 Scalar tau=1.e-8,
int maxIterations=1000,
377 Scalar minError = 1.e-6, Scalar lambdaMultiplier=10,
378 Scalar eps1 = 1.49012e-08, Scalar eps2 = 1.49012e-08,
379 const std::string &linSolver=
"svd");
381 const std::vector<JacobianMat> &js=std::vector<JacobianMat>(),
382 Scalar tau=1.e-8,
int maxIterations=1000,
383 Scalar minError = 1.e-6, Scalar lambdaMultiplier=10,
384 Scalar eps1 = 1.49012e-08, Scalar eps2 = 1.49012e-08,
385 const std::string &linSolver=
"svd");
417 static Jacobian create_numerical_jacobian(
int o,
Function f,
float delta=1.E-5);
421 static std::vector<Jacobian> create_numerical_jacobians(
int n,
Function f,
float delta=1.e-5);
422 static std::vector<JacobianMat> create_numerical_jacobians(
int n,
FunctionMat f,
float delta=1.e-5);
432 static Data create_data(
const Params &p,
Function f,
int xDim,
int yDim,
433 int num=1000, Scalar minX=-5, Scalar maxX=5);
436 static void default_debug_callback(
const Result &r);
439 void setDebugCallback(
DebugCallback dbg=default_debug_callback);
DynMatrix< Scalar > Matrix
matrix type (used for input data)
Definition: LevenbergMarquardtFitter.h:257
icl::utils::Function< void, const Params &, const Vector &, Vector & > Jacobian
jacobian of F
Definition: LevenbergMarquardtFitter.h:286
Scalar eps1
minimum F'(parameters) threshold
Definition: LevenbergMarquardtFitter.h:304
icl::utils::Function< Matrix, const Params &, const Matrix & > FunctionMat
Definition: LevenbergMarquardtFitter.h:282
undocument this line if you encounter any issues!
Definition: Any.h:37
Scalar lambdaMultiplier
mulitplier that is used to increase/decreas lambda
Definition: LevenbergMarquardtFitter.h:303
DynColVector< Scalar > Params
parameter vector type
Definition: LevenbergMarquardtFitter.h:256
#define ICLMath_API
Definition: CompatMacros.h:173
Scalar initialError
initial error
Definition: LevenbergMarquardtFitter.h:262
Vector dy
buffer for current delta
Definition: LevenbergMarquardtFitter.h:320
bool useMat
flag whether matrices in the error function
Definition: LevenbergMarquardtFitter.h:299
utility structure that is used in the static create_data utlity method
Definition: LevenbergMarquardtFitter.h:275
icl::utils::Function< void, const Result & > DebugCallback
Optionally given debug callback, that is called in every iterations.
Definition: LevenbergMarquardtFitter.h:290
int maxIterations
maximum number of iterations
Definition: LevenbergMarquardtFitter.h:301
friend ICLMath_API std::ostream & operator<<(std::ostream &str, const Result &d)
overloaded ostream-operator
Definition: LevenbergMarquardtFitter.h:268
Utility structure, that represents a fitting result.
Definition: LevenbergMarquardtFitter.h:260
std::string linSolver
linear solver that is used
Definition: LevenbergMarquardtFitter.h:306
Matrix J
Jacobian Matrix (rows are Ji)
Definition: LevenbergMarquardtFitter.h:309
Function f
Function f.
Definition: LevenbergMarquardtFitter.h:295
Scalar error
reached error
Definition: LevenbergMarquardtFitter.h:263
Matrix y
outputs
Definition: LevenbergMarquardtFitter.h:277
Matrix y_est
current estimated outputs
Definition: LevenbergMarquardtFitter.h:318
std::vector< Jacobian > js
output buffers
Definition: LevenbergMarquardtFitter.h:313
Params params
final parameters
Definition: LevenbergMarquardtFitter.h:265
Scalar tau
used for initial damping parameter lambda
Definition: LevenbergMarquardtFitter.h:300
icl::utils::Function< void, const Params &, const Matrix &, Matrix & > JacobianMat
Definition: LevenbergMarquardtFitter.h:287
DynMatrix transp() const
matrix transposed
Definition: DynMatrix.h:979
Vector dst
b in Mx=b of linear system solved internally
Definition: LevenbergMarquardtFitter.h:308
DynColVector< Scalar > Vector
vector type
Definition: LevenbergMarquardtFitter.h:255
Scalar minError
minimum error threshold
Definition: LevenbergMarquardtFitter.h:302
std::vector< Scalar > lambdas
last lambdas (one per output)
Definition: LevenbergMarquardtFitter.h:264
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
ICLCV_API void error(const char *msg)
Display error message and terminate program.
icl::utils::Function< Vector, const Params &, const Vector & > Function
to-be-optimized function type y = f(params, x)
Definition: LevenbergMarquardtFitter.h:281
Matrix x
input (each row is a data sample)
Definition: LevenbergMarquardtFitter.h:276
std::vector< JacobianMat > jsMat
Definition: LevenbergMarquardtFitter.h:314
FunctionMat fMat
Function f.
Definition: LevenbergMarquardtFitter.h:296
Utility class implementing the multidimensional Levenberg Marquardt Algorithm for non-linear Optimiza...
Definition: LevenbergMarquardtFitter.h:252
Params params_new
new parameters (after update step)
Definition: LevenbergMarquardtFitter.h:317
Scalar eps2
minimum change in parameters threshold
Definition: LevenbergMarquardtFitter.h:305
bool useMultiThreading
flag whether multithreading is enabled
Definition: LevenbergMarquardtFitter.h:298
DebugCallback dbg
debug callback
Definition: LevenbergMarquardtFitter.h:316
Matrix H
Hessian Matrix (J^T J)
Definition: LevenbergMarquardtFitter.h:310
int iteration
number of iterations needed
Definition: LevenbergMarquardtFitter.h:261