dirkschumacher / ompr

R package to model Mixed Integer Linear Programs
https://dirkschumacher.github.io/ompr/
Other
269 stars 35 forks source link

S3 #403

Closed dirkschumacher closed 2 years ago

dirkschumacher commented 2 years ago

Closes #399

dirkschumacher commented 2 years ago

TODO: think about moving the NonceManager inside the MIPModel object.

dirkschumacher commented 2 years ago

TODO: think about moving the NonceManager inside the MIPModel object.

The problem here is that each LinearFunction would need a reference to a model. If you copy the counter on-write, then we would need to update all model references on all AbstractFunction objects whenever we modify the model. If the counter is a reference, then it might cause problems when serialising a model and later continue working on it. I settle now with a counter within ompr's namespace. As this is only a safeguard feature that should fine I think.

dirkschumacher commented 2 years ago

It seems these changes significantly improve the performance with a larger number of variables. See this tweet