Some functions have been include to ease nonlinear optimization and equation system solving.
bool SolveNonLinearEquations(Eigen::VectorXd &y, Function <int(const Eigen::VectorXd &b, Eigen::VectorXd &residual)> Residual)
Given a system of non linear equations defined by Function Residual, and a set of initial values of the unknowns set in y, this function tries to obtain the set of y that zeroes the Residual.
The dimension of y (y.size()) has to be equal to the number of equations (residual.size()).
It uses a modification of the Powell's hybrid method ("dogleg"). The Jacobian is approximated using a forward-difference method.
The algorithm was ported in Eigen from MINPACK library.
bool NonLinearOptimization(Eigen::VectorXd &y, Eigen::Index numData, Function <int(const Eigen::VectorXd &y, Eigen::VectorXd &residual)>residual)
Given a number of numData records, the objective is to obtain in an iterative way the y unknown coefficients that minimizes, ideally to zero, the residual error of the Residual Function.
To improve the success of this calculation, y has to be initially filled with adequate initial guess of the unknowns.
Residual Function has to fill in every call residual[numData] Vector by applying the unknowns provisionally guessed values in y to the model to be solved.
The algorithm was ported in Eigen from MINPACK library.
|