12 T franke_fun(T
x, T
y)
14 auto cx2 = (9 *
x - 2) * (9 *
x - 2);
15 auto cy2 = (9 *
y - 2) * (9 *
y - 2);
17 auto cx1 = (9 *
x + 1) * (9 *
x + 1);
18 auto cx7 = (9 *
x - 7) * (9 *
x - 7);
20 auto cy3 = (9 *
y - 3) * (9 *
y - 3);
21 auto cx4 = (9 *
x - 4) * (9 *
x - 4);
23 auto cy7 = (9 *
y - 7) * (9 *
y - 7);
25 return (3. / 4.) * exp(-(1. / 4.) * cx2 - (1. / 4.) * cy2) + (3. / 4.) * exp(-(1. / 49.) * cx1 - (9. / 10.) *
y - 1. / 10.) + (1. / 2.) * exp(-(1. / 4.) * cx7 - (1. / 4.) * cy3) - (1. / 5.) * exp(-cx4 - cy7);
29 T franke_fun(T
x, T
y, T
z)
31 auto cx2 = (9 *
x - 2) * (9 *
x - 2);
32 auto cy2 = (9 *
y - 2) * (9 *
y - 2);
33 auto cz2 = (9 *
z - 2) * (9 *
z - 2);
35 auto cx1 = (9 *
x + 1) * (9 *
x + 1);
36 auto cx7 = (9 *
x - 7) * (9 *
x - 7);
38 auto cy3 = (9 *
y - 3) * (9 *
y - 3);
39 auto cx4 = (9 *
x - 4) * (9 *
x - 4);
40 auto cy7 = (9 *
y - 7) * (9 *
y - 7);
42 auto cz5 = (9 *
z - 5) * (9 *
z - 5);
44 return 3. / 4. * exp(-1. / 4. * cx2 - 1. / 4. * cy2 - 1. / 4. * cz2) + 3. / 4. * exp(-1. / 49. * cx1 - 9. / 10. *
y - 1. / 10. - 9. / 10. *
z - 1. / 10.) + 1. / 2. * exp(-1. / 4. * cx7 - 1. / 4. * cy3 - 1. / 4. * cz5) - 1. / 5. * exp(-cx4 - cy7 - cz5);
48 T franke_fun_old(T
x, T
y, T
z)
50 auto cx2 = (9 *
x - 2) * (9 *
x - 2);
51 auto cy2 = (9 *
y - 2) * (9 *
y - 2);
52 auto cz2 = (9 *
z - 2) * (9 *
z - 2);
54 auto cx1 = (9 *
x + 1) * (9 *
x + 1);
55 auto cx7 = (9 *
x - 7) * (9 *
x - 7);
57 auto cy3 = (9 *
y - 3) * (9 *
y - 3);
58 auto cx4 = (9 *
x - 4) * (9 *
x - 4);
59 auto cy7 = (9 *
y - 7) * (9 *
y - 7);
61 auto cz5 = (9 *
y - 5) * (9 *
y - 5);
63 return 3. / 4. * exp(-1. / 4. * cx2 - 1. / 4. * cy2 - 1. / 4. * cz2) + 3. / 4. * exp(-1. / 49. * cx1 - 9. / 10. *
y - 1. / 10. - 9. / 10. *
z - 1. / 10.) + 1. / 2. * exp(-1. / 4. * cx7 - 1. / 4. * cy3 - 1. / 4. * cz5) - 1. / 5. * exp(-cx4 - cy7 - cz5);
77 res(0) = franke_fun(pt(0), pt(1)) * t;
78 else if (pt.size() == 3)
79 res(0) = franke_fun(pt(0), pt(1), pt(2)) * t;
91 res(0) = franke_fun(pt(0), pt(1)) * t;
92 else if (pt.size() == 3)
93 res(0) = franke_fun(pt(0), pt(1), pt(2)) * t;
105 res(0) = franke_fun(pt(0), pt(1)) * t;
106 else if (pt.size() == 3)
107 res(0) = franke_fun(pt(0), pt(1), pt(2)) * t;
126 res(0) = franke_fun(pt(0), pt(1)) * t;
127 else if (pt.size() == 3)
128 res(0) = franke_fun_old(pt(0), pt(1), pt(2)) * t;
140 res(0) = franke_fun(pt(0), pt(1)) * t;
141 else if (pt.size() == 3)
142 res(0) = franke_fun_old(pt(0), pt(1), pt(2)) * t;
154 res(0) = franke_fun(pt(0), pt(1)) * t;
155 else if (pt.size() == 3)
156 res(0) = franke_fun_old(pt(0), pt(1), pt(2)) * t;
VectorNd eval_fun(const VectorNd &pt, const double t) const override
FrankeProblem(const std::string &name)
VectorNd eval_fun(const VectorNd &pt, const double t) const override
FrankeProblemOld(const std::string &name)
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > VectorNd
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffGradPt