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

Function complex_holder_table

dlib/test/global_optimization.cpp:176–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174// ----------------------------------------------------------------------------------------
175
176 double complex_holder_table ( double x0, double x1)
177 {
178 // The regular HolderTable function
179 //return -std::abs(sin(x0)*cos(x1)*exp(std::abs(1-std::sqrt(x0*x0+x1*x1)/pi)));
180
181 // My more complex version of it with discontinuities and more local minima.
182 double sign = 1;
183 for (double j = -4; j < 9; j += 0.5)
184 {
185 if (j < x0 && x0 < j+0.5)
186 x0 += sign*0.25;
187 sign *= -1;
188 }
189 // HolderTable function tilted towards 10,10
190 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);
191 }
192
193// ----------------------------------------------------------------------------------------
194

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