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

Method function_spec

dlib/global_optimization/global_function_search.cpp:447–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445// ----------------------------------------------------------------------------------------
446
447 function_spec::function_spec(
448 matrix<double,0,1> bound1,
449 matrix<double,0,1> bound2
450 ) :
451 lower(std::move(bound1)), upper(std::move(bound2))
452 {
453 DLIB_CASSERT(lower.size() == upper.size());
454 for (long i = 0; i < lower.size(); ++i)
455 {
456 if (upper(i) < lower(i))
457 std::swap(lower(i), upper(i));
458 DLIB_CASSERT(upper(i) != lower(i), "The upper and lower bounds can't be equal.");
459 }
460 is_integer_variable.assign(lower.size(), false);
461 }
462
463// ----------------------------------------------------------------------------------------
464

Callers 1

Calls 5

moveFunction · 0.85
roundFunction · 0.85
swapFunction · 0.50
sizeMethod · 0.45
assignMethod · 0.45

Tested by 1