Unverified Commit 0871081a authored by Robert Underwood's avatar Robert Underwood Committed by GitHub
Browse files

fix find_min_global finding wrong answers (#2284)



* fix find_min_global finding wrong answers

Previously, find_min_global would produce wrong output when passed
a collection of initial evaluations because the solver expected the
y-values to be multiplied by -1.  This fix does that when minimizing.

closes #2283

* fixed tabbing
Co-authored-by: default avatarDavis King <davis@dlib.net>
parent 4a53742f
......@@ -161,6 +161,11 @@ template <typename T> static auto go(T&& f, const matrix<double, 0, 1>& a) -> de
{
initial_function_evals.resize(specs.size());
}
for (auto& evals : initial_function_evals) {
for (auto& eval : evals) {
eval.y *= ymult;
}
}
global_function_search opt(specs, {initial_function_evals});
opt.set_solver_epsilon(solver_epsilon);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment