SCIPpp
SCIPpp copied to clipboard
Accelerate summation of variables
Summing up variables via linear expression's operator += takes a lot of runtime. It would be nice to have a method that quickly creates a sum from a range of variables.
An idea is to add an additional c'tor so that multiple variables together create one linear expression. Just sketching:
LinExpr(const std::span<Var>& vars);
LinExpr(const std::span<Var>& vars, const std::span<double>& coeffs);
This requires an update to C++20, and is a bit ugly, at least my first idea: see branch issue-32-speedup-linexpr
I think spans are great, but moving to cxx 20 is a big change. Maybe it suffices to use iterator starts and ends?