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

Function py_find_min_global

tools/python/src/global_optimization.cpp:192–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190// ----------------------------------------------------------------------------------------
191
192py::tuple py_find_min_global (
193 py::object f,
194 py::list bound1,
195 py::list bound2,
196 py::list is_integer_variable,
197 unsigned long num_function_calls,
198 double solver_epsilon = 0
199)
200{
201 DLIB_CASSERT(len(bound1) == len(bound2));
202 DLIB_CASSERT(len(bound1) == len(is_integer_variable));
203
204 auto func = [&](const matrix<double,0,1>& x)
205 {
206 return call_func(f, x);
207 };
208
209 auto result = find_min_global(func, list_to_mat(bound1), list_to_mat(bound2),
210 list_to_bool_vector(is_integer_variable), max_function_calls(num_function_calls),
211 solver_epsilon);
212
213 return py::make_tuple(mat_to_list(result.x),result.y);
214}
215
216py::tuple py_find_min_global2 (
217 py::object f,

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
call_funcFunction · 0.85
find_min_globalFunction · 0.85
list_to_matFunction · 0.85
list_to_bool_vectorFunction · 0.85
make_tupleFunction · 0.85
mat_to_listFunction · 0.85
max_function_callsClass · 0.50

Tested by

no test coverage detected