25 #include "LevenbergMarquardtBase.hh"
30 LM_Compute(
const int numResiduals,
const int numParameters,
38 LM_parameters_.
newsize(numParameters);
39 LM_residuals_.
newsize(numResiduals);
40 LM_Jacobian_.
newsize(numResiduals, numParameters);
42 numResiduals, numParameters,
44 LM_tolerance_, LM_maxIters_);
48 residuals = LM_residuals_;
50 for (
int j = 0; j < numResiduals; j++)
51 LM_squaredSum_ += LM_residuals_[j]*LM_residuals_[j];
58 const int numParameters,
68 LM_parameters_.
newsize(numParameters);
69 LM_residuals_.
newsize(numResiduals);
70 LM_Jacobian_.
newsize(numResiduals, numParameters);
73 this, numResiduals, numParameters,
74 startX, resultX, epsilon,
75 LM_tolerance_, LM_maxIters_);
79 residuals = LM_residuals_;
81 for (
int j = 0; j < numResiduals; j++)
82 LM_squaredSum_ += LM_residuals_[j]*LM_residuals_[j];
88 numResiduals, resultX, LM_Jacobian_, epsilon);
long int LevenbergMarquardtExtended(minpack_funcder_mn fun, void *p, long int m, long int n, Vector< double > &InitialGuess, Vector< double > &Result, double Tolerance, long int MaxIter)
Solves an overdetermined system f(x) = 0 of m non-linear equations with n parameters using the extend...
Matrix< T > & newsize(Subscript M, Subscript N)
int LM_ComputeWithoutJacobian(const int numResiduals, const int numParameters, BIAS::Vector< double > &startX, BIAS::Vector< double > &resultX, BIAS::Vector< double > &residuals, const double epsilon=LM_DEF_EPSILON)
Compute Levenberg-Marquardt algorithm using the user defined target function f(x) implemented in LM_T...
Vector< T > & newsize(Subscript N)
void SetZero()
Sets all values to zero.
long int ComputeJacobian(minpack_func_mn fun, void *p, const int NumErrors, const Vector< double > &x, Matrix< double > &fjac, const double gradientEpsilon)
Compute the Jacobian J(x) of function f at x.
int LM_Compute(const int numResiduals, const int numParameters, BIAS::Vector< double > &startX, BIAS::Vector< double > &resultX, BIAS::Vector< double > &residuals)
Compute Levenberg-Marquardt algorithm using the user defined target function f(x) implemented in LM_T...