Commit f6ce2bde authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

R: update update callback API

parent 358dc7d2
Pipeline #5475 passed with stage
in 3 minutes and 22 seconds
......@@ -35,24 +35,27 @@ r_solver_started_cb(const baryonyx::solver_parameters& /*params*/)
}
static void
r_solver_updated_cb(const baryonyx::result& r)
r_solver_updated_cb(int remaining_constraints,
double value,
int loop,
double duration)
{
if (r.status != baryonyx::result_status::success) {
if (remaining_constraints > 0) {
Rprintf(" - Constraints remaining: %d (loop: %d t: %fs)\n",
r.remaining_constraints,
r.loop,
r.duration);
remaining_constraints,
loop,
duration);
} else {
if (r.loop >= 0)
if (loop >= 0)
Rprintf(" - Solution found: %f (loop: %d t: %fs)\n",
r.solutions.back().value,
r.loop,
r.duration);
value,
loop,
duration);
else
Rprintf(" - Solution found via push: %f (loop: %d t: %fs)\n",
r.solutions.back().value,
-r.loop,
r.duration);
value,
-loop,
duration);
}
R_FlushConsole();
......
Supports Markdown
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