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

Fix the variable permutation performed at the end of level 1 fold. #90

Merged
merged 2 commits into from
Aug 13, 2023

Conversation

antoinemine
Copy link
Owner

Level 0 fold operation requires the indice of folded variables to be sorted. However, level 1 fold takes as argument a list of variable names, which does not necessarily give a sorted list of variable indices. Hence, level 1 fold applis the level 0 fold on the sorted variable indices, and then corrects the result by permuting variable indices until the fist variable in the argument list (i.e., the destination) contains the result of the fold (instead of the variable with the lowest index).

Previously, the code performed a rotation to the right, which was not correct and provided wrong results in some cases. A rotation to the left is actually needed, instead. This PR fixes the rotation.

@rmonat
Copy link
Contributor

rmonat commented Aug 11, 2023

This fixes the issue I encountered, thank you @antoinemine!

@antoinemine antoinemine merged commit 7b61890 into master Aug 13, 2023
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

Successfully merging this pull request may close these issues.

2 participants