22 #ifndef UNFIT_UNITTESTS_LEVENBERGMARQUARDTTESTFUNCTIONS_HPP_ 23 #define UNFIT_UNITTESTS_LEVENBERGMARQUARDTTESTFUNCTIONS_HPP_ 27 #include "GenericCostFunction.hpp" 59 std::vector<double>
operator()(
const std::vector<double> &variable)
61 std::vector<double> result {0};
62 result[0] = variable[0]*variable[0] + 2*variable[0] + 1;
93 std::vector<double>
operator()(
const std::vector<double> &variable)
95 std::vector<double> result(3, 0.0);
96 result[0] = variable[0]*variable[0]*variable[0]*variable[0];
97 result[1] = 2*variable[0]*variable[0] * variable[1]*variable[1];
98 result[2] = variable[1]*variable[1]*variable[1]*variable[1];
129 std::vector<double>
operator()(
const std::vector<double> &variable)
131 std::vector<double> result(2, 0.0);
132 result[0] = (variable[0]-1)*(variable[0]-1);
133 result[1] = (variable[1]-1)*(variable[1]-1);
164 std::vector<double>
operator()(
const std::vector<double> &variable)
166 std::vector<double> result {0};
167 result[0] = 4*variable[0]*variable[0]*variable[0]*variable[0];
186 std::vector<double>
operator()(
const std::vector<double> &variable)
188 std::vector<double> residuals {0};
189 if (fabs(variable[0]) < 0.1) {
190 residuals[0] = std::numeric_limits<double>::quiet_NaN();
193 residuals[0] = variable[0]*variable[0];
std::vector< double > operator()(const std::vector< double > &variable)
Definition: LevenbergMarquardtTestFunctions.hpp:129
std::vector< double > operator()(const std::vector< double > &variable)
Definition: LevenbergMarquardtTestFunctions.hpp:186
Definition: Bounds.hpp:27
std::vector< double > operator()(const std::vector< double > &variable)
Definition: LevenbergMarquardtTestFunctions.hpp:93
Definition: LevenbergMarquardtTestFunctions.hpp:176
Definition: GenericCostFunction.hpp:36
std::vector< double > operator()(const std::vector< double > &variable)
Definition: LevenbergMarquardtTestFunctions.hpp:164
std::vector< double > operator()(const std::vector< double > &variable)
Definition: LevenbergMarquardtTestFunctions.hpp:59
Equation3 is defined as (x - 1)^2 + (y - 1)^2.
Definition: LevenbergMarquardtTestFunctions.hpp:111
Equation1 is defined as x^2 + 2x + 1.
Definition: LevenbergMarquardtTestFunctions.hpp:41
Equation4 is defined as 4x^4.
Definition: LevenbergMarquardtTestFunctions.hpp:146
Equation2 is defined as x^4 + 2x^2*y^2 + y^4.
Definition: LevenbergMarquardtTestFunctions.hpp:75