You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The indexing of cartesian products is off by one. In the Python documentation and Rust docs the index starts at 0.
However, the code asserts that the index ends at the length of the vector (and therefore starts at 1):
This should probably be changed in the docs as changing the code will break all implementations. However, starting the index at 1 is quite unintuitive when used in Rust and should be documented well.
The text was updated successfully, but these errors were encountered:
The indexing of cartesian products is off by one. In the Python documentation and Rust docs the index starts at 0.
However, the code asserts that the index ends at the length of the vector (and therefore starts at 1):
optimization-engine/src/constraints/cartesian_product.rs
Line 140 in d9c6dde
And then loops until index-1 (and therefore my final index should be N not N-1):
optimization-engine/src/constraints/cartesian_product.rs
Line 146 in d9c6dde
This should probably be changed in the docs as changing the code will break all implementations. However, starting the index at 1 is quite unintuitive when used in Rust and should be documented well.
The text was updated successfully, but these errors were encountered: