22 #ifndef UNFIT_UNITTESTS_NELDERMEADTESTFUNCTIONS_HPP_ 23 #define UNFIT_UNITTESTS_NELDERMEADTESTFUNCTIONS_HPP_ 28 #include "GenericCostFunction.hpp" 89 std::vector<double>
operator()(
const std::vector<double> &x)
91 std::vector<double> ret {0};
93 ret[0] = sqrt(fabs(x[0]));
96 ret[0] = std::numeric_limits<double>::infinity();
129 std::vector<double> ret {0};
133 else if (x[0] < -1.0) {
137 ret[0] = std::numeric_limits<double>::infinity();
162 std::vector<double> f_i(3, 0.0);
163 if ((x[0] < 1.26 && x[0] > 1.24) && (x[1] < 0.51 && x[1] > 0.49)) {
164 f_i[0] = std::numeric_limits<double>::infinity();
165 f_i[1] = std::numeric_limits<double>::infinity();
166 f_i[2] = std::numeric_limits<double>::infinity();
168 else if (x[0] < 0.9 || x[0] > 2.1 || x[1] < 0.9 || x[1] > 2.1) {
174 f_i[0] = x[0] + x[1];
175 f_i[1] = x[0] + x[1];
176 f_i[2] = x[0] + x[1];
221 std::vector<double> ret {0};
222 ret[0] = sqrt(fabs(x[0]*x[0] - 4*x[0] + x[1]*x[1] - x[1] - x[0]*x[1]));
303 std::vector<double> ret {0};
304 ret[0] = sqrt(sqrt(x[1]*x[1] + x[0]*x[0]));
384 std::vector<double> ret {0};
385 ret[0] = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
427 std::vector<double> ret {0};
428 ret[0] = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2] + x[3]*x[3] + x[4]*x[4]);
467 std::vector<double> ret {0};
468 ret[0] = sqrt(fabs(1/((x[0] - 1.05)*x[1]*x[2])));
507 std::vector<double> ret {0};
508 ret[0] = sqrt(1/(x[0]*x[0]) + 1/(x[1]*x[1]));
547 std::vector<double> ret {0};
548 ret[0] = sqrt(fabs(1/((x[0] - 0.95)*x[1]*x[2])));
584 std::vector<double> ret {0};
585 ret[0] = (fabs(-1/(x[0]*x[1] + x[0]*(x[0] - 3))));
625 std::vector<double> ret {0};
626 if (x[0] < 1 && x[1]>1.025) {
627 ret[0] = 1/(x[0]-x[0]);
630 ret[0] = 5*x[0]*x[0] + x[1]*x[1];
632 ret[0] = sqrt(ret[0]);
672 std::vector<double> ret {0};
673 ret[0] = (x[0]-90)*(x[0]-90) + (x[1]+50)*(x[1]+50) + 1/(x[0]-102);
675 ret[0] += 1/(1 - (0.5*x[0]+x[1]+48.5));
678 ret[0] = sqrt(fabs(ret[0]));
715 std::vector<double> ret {0};
716 ret[0] = ((x[0] + 10*x[1])*(x[0] + 10*x[1]) + 5*(x[2] -
717 x[3])*(x[2] - x[3]) + (x[1] - 2*x[2])*(x[1] - 2*x[2])*(x[1] -
718 2*x[2])*(x[1] - 2*x[2]) + 10*(x[0] - x[3])*(x[0] -
719 x[3])*(x[0] - x[3])*(x[0] - x[3]));
721 ret[0] = sqrt(fabs(ret[0]));
749 const double temp = (x[0] >= 1.0) ? x[0] : 1.0;
750 std::vector<double> ret {0};
751 ret[0] = (std::numeric_limits<double>::max()*1000.0*temp);
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:670
Definition: NelderMeadTestFunctions.hpp:564
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:127
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:545
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:89
Definition: NelderMeadTestFunctions.hpp:524
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:219
Definition: NelderMeadTestFunctions.hpp:146
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:505
Definition: Bounds.hpp:27
Definition: NelderMeadTestFunctions.hpp:68
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:747
Definition: NelderMeadTestFunctions.hpp:361
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:160
Definition: NelderMeadTestFunctions.hpp:198
Definition: GenericCostFunction.hpp:36
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:623
Definition: NelderMeadTestFunctions.hpp:729
Definition: NelderMeadTestFunctions.hpp:106
Definition: NelderMeadTestFunctions.hpp:404
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:713
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:465
Definition: NelderMeadTestFunctions.hpp:694
Definition: NelderMeadTestFunctions.hpp:648
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:425
Definition: NelderMeadTestFunctions.hpp:444
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:301
Definition: NelderMeadTestFunctions.hpp:601
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:582
std::vector< double > operator()(const std::vector< double > &x)
Definition: NelderMeadTestFunctions.hpp:382
Definition: NelderMeadTestFunctions.hpp:280
Definition: NelderMeadTestFunctions.hpp:484