Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong documentation about Cartesian product constraint #345

Open
AlexanderKeijzer opened this issue Mar 29, 2024 · 0 comments
Open

Wrong documentation about Cartesian product constraint #345

AlexanderKeijzer opened this issue Mar 29, 2024 · 0 comments
Assignees

Comments

@AlexanderKeijzer
Copy link

AlexanderKeijzer commented Mar 29, 2024

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):

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.

@alphaville alphaville self-assigned this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants