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

Function py_find_max_global

tools/python/src/global_optimization.cpp:146–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144// ----------------------------------------------------------------------------------------
145
146py::tuple py_find_max_global (
147 py::object f,
148 py::list bound1,
149 py::list bound2,
150 py::list is_integer_variable,
151 unsigned long num_function_calls,
152 double solver_epsilon = 0
153)
154{
155 DLIB_CASSERT(len(bound1) == len(bound2));
156 DLIB_CASSERT(len(bound1) == len(is_integer_variable));
157
158 auto func = [&](const matrix<double,0,1>& x)
159 {
160 return call_func(f, x);
161 };
162
163 auto result = find_max_global(func, list_to_mat(bound1), list_to_mat(bound2),
164 list_to_bool_vector(is_integer_variable), max_function_calls(num_function_calls),
165 solver_epsilon);
166
167 return py::make_tuple(mat_to_list(result.x),result.y);
168}
169
170py::tuple py_find_max_global2 (
171 py::object f,

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
call_funcFunction · 0.85
find_max_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