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

Function find_min_bobyqa

dlib/optimization/optimization_bobyqa.h:3346–3392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3344 typename U
3345 >
3346 double find_min_bobyqa (
3347 const funct& f,
3348 T& x,
3349 long npt,
3350 const U& x_lower,
3351 const U& x_upper,
3352 const double rho_begin,
3353 const double rho_end,
3354 const long max_f_evals
3355 )
3356 {
3357 // The starting point (i.e. x) must be a column vector.
3358 COMPILE_TIME_ASSERT(T::NC <= 1);
3359
3360 // check the requirements. Also split the assert up so that the error message isn't huge.
3361 DLIB_CASSERT(is_col_vector(x) && is_col_vector(x_lower) && is_col_vector(x_upper) &&
3362 x.size() == x_lower.size() && x_lower.size() == x_upper.size() &&
3363 x.size() > 1 && max_f_evals > 1,
3364 "\tdouble find_min_bobyqa()"
3365 << "\n\t Invalid arguments have been given to this function"
3366 << "\n\t is_col_vector(x): " << is_col_vector(x)
3367 << "\n\t is_col_vector(x_lower): " << is_col_vector(x_lower)
3368 << "\n\t is_col_vector(x_upper): " << is_col_vector(x_upper)
3369 << "\n\t x.size(): " << x.size()
3370 << "\n\t x_lower.size(): " << x_lower.size()
3371 << "\n\t x_upper.size(): " << x_upper.size()
3372 << "\n\t max_f_evals: " << max_f_evals
3373 );
3374
3375 DLIB_CASSERT(x.size() + 2 <= npt && npt <= (x.size()+1)*(x.size()+2)/2 &&
3376 0 < rho_end && rho_end < rho_begin &&
3377 min(x_upper - x_lower) > 2*rho_begin &&
3378 min(x - x_lower) >= 0 && min(x_upper - x) >= 0,
3379 "\tdouble find_min_bobyqa()"
3380 << "\n\t Invalid arguments have been given to this function"
3381 << "\n\t ntp in valid range: " << (x.size() + 2 <= npt && npt <= (x.size()+1)*(x.size()+2)/2)
3382 << "\n\t npt: " << npt
3383 << "\n\t rho_begin: " << rho_begin
3384 << "\n\t rho_end: " << rho_end
3385 << "\n\t min(x_upper - x_lower) > 2*rho_begin: " << (min(x_upper - x_lower) > 2*rho_begin)
3386 << "\n\t min(x - x_lower) >= 0 && min(x_upper - x) >= 0: " << (min(x - x_lower) >= 0 && min(x_upper - x) >= 0)
3387 );
3388
3389
3390 bobyqa_implementation impl;
3391 return impl.find_min(f, x, npt, x_lower, x_upper, rho_begin, rho_end, max_f_evals);
3392 }
3393
3394// ----------------------------------------------------------------------------------------
3395

Callers 7

find_optimal_parametersFunction · 0.85
find_max_bobyqaFunction · 0.85
test_apqFunction · 0.85
test_powellFunction · 0.85
test_simpleFunction · 0.85
test_rosenFunction · 0.85
mainFunction · 0.85

Calls 4

is_col_vectorFunction · 0.85
find_minMethod · 0.80
minFunction · 0.50
sizeMethod · 0.45

Tested by 4

test_apqFunction · 0.68
test_powellFunction · 0.68
test_simpleFunction · 0.68
test_rosenFunction · 0.68