-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
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):
| assert!(x.len() == self.dimension(), "x has wrong size"); |
And then loops until index-1 (and therefore my final index should be N not N-1):
| c.project(&mut x[j..i]); |
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.
Metadata
Metadata
Assignees
Labels
No labels