ecole icon indicating copy to clipboard operation
ecole copied to clipboard

BoundsIntegral performance improvement

Open AntoinePrv opened this issue 3 years ago • 1 comments

Describe the problem or improvement suggested

Right now, the complete history of bounds is stored in the event handler and the integral is recomputed from start before taking a difference.

Describe the solution you would like

Only store the values since the last call to extract and compute directly the integral difference from this. Something like

auto const& primal_bounds = ...

auto inegral = Reward{0.};
if(...){
    integral = compute_primal_integral(primal_bounds);
} else {
    ...
}

handler.clear_all_but_last();
// No need to compute diff anymore
return integral;

Additional context

#144

AntoinePrv avatar Jun 15 '21 15:06 AntoinePrv

We can further improve the code, and get rid of the vector altogether by accumulating the integral on-the-fly without storing all intermediate bound values.

Let's keep this issue open until we do it when we have time.

gasse avatar Jun 29 '21 19:06 gasse