MCPcopy Create free account
hub / github.com/davisking/dlib / complex_holder_table

Function complex_holder_table

dlib/test/global_optimization.cpp:88–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86// ----------------------------------------------------------------------------------------
87
88 double complex_holder_table ( double x0, double x1)
89 {
90 // The regular HolderTable function
91 //return -std::abs(sin(x0)*cos(x1)*exp(std::abs(1-std::sqrt(x0*x0+x1*x1)/pi)));
92
93 // My more complex version of it with discontinuities and more local minima.
94 double sign = 1;
95 for (double j = -4; j < 9; j += 0.5)
96 {
97 if (j < x0 && x0 < j+0.5)
98 x0 += sign*0.25;
99 sign *= -1;
100 }
101 // HolderTable function tilted towards 10,10
102 return -std::abs(sin(x0)*cos(x1)*exp(std::abs(1-std::sqrt(x0*x0+x1*x1)/pi))) +(x0+x1)/10 + sin(x0*10)*cos(x1*10);
103 }
104
105// ----------------------------------------------------------------------------------------
106

Callers 3

test_find_max_globalFunction · 0.85
test_find_min_globalFunction · 0.85

Calls 3

absFunction · 0.85
expFunction · 0.85
sqrtFunction · 0.50

Tested by

no test coverage detected