Commit b8da437e authored by Davis King's avatar Davis King

Fixed bug in global_function_search's constructor taking initial function

evaluations.  It wasn't assigning these values into the entire state of the
solver, causing it to be a little busted if used.
parent 674e31ee
...@@ -628,6 +628,13 @@ namespace dlib ...@@ -628,6 +628,13 @@ namespace dlib
for (size_t i = 0; i < initial_function_evals.size(); ++i) for (size_t i = 0; i < initial_function_evals.size(); ++i)
{ {
functions[i]->ub = upper_bound_function(initial_function_evals[i], relative_noise_magnitude); functions[i]->ub = upper_bound_function(initial_function_evals[i], relative_noise_magnitude);
if (initial_function_evals.size() != 0)
{
auto best = max_scoring_element(initial_function_evals[i], [](const function_evaluation& e) { return e.y; }).first;
functions[i]->best_objective_value = best.y;
functions[i]->best_x = best.x;
}
} }
} }
......
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