rust-or / rust-lp-modeler

Lp modeler written in Rust
MIT License
96 stars 29 forks source link

lp-sum panics on empty vector #41

Closed remysucre closed 3 years ago

remysucre commented 5 years ago

When calling sum on an empty vector, I got the panic from here:

https://github.com/jcavat/rust-lp-modeler/blob/ca7a3cd6ac30ed715a900c5049bc320f6328ad1d/src/dsl/variables.rs#L451

why can't we return 0 when the vector is empty?

jcavat commented 4 years ago

You are absolutely right ! I need to fix this