| 168 | } |
| 169 | |
| 170 | py::tuple py_find_max_global2 ( |
| 171 | py::object f, |
| 172 | py::list bound1, |
| 173 | py::list bound2, |
| 174 | unsigned long num_function_calls, |
| 175 | double solver_epsilon = 0 |
| 176 | ) |
| 177 | { |
| 178 | DLIB_CASSERT(len(bound1) == len(bound2)); |
| 179 | |
| 180 | auto func = [&](const matrix<double,0,1>& x) |
| 181 | { |
| 182 | return call_func(f, x); |
| 183 | }; |
| 184 | |
| 185 | auto result = find_max_global(func, list_to_mat(bound1), list_to_mat(bound2), max_function_calls(num_function_calls), solver_epsilon); |
| 186 | |
| 187 | return py::make_tuple(mat_to_list(result.x),result.y); |
| 188 | } |
| 189 | |
| 190 | // ---------------------------------------------------------------------------------------- |
| 191 |
nothing calls this directly
no test coverage detected