-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add IteratorOfPartitionsSet
an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
#4074
Add IteratorOfPartitionsSet
an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
#4074
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution. I have some minor, optional suggestions; but one thing is rather important to me: please give a reference for the algorithm, and/or an explanation for what it does.
Error( "<s> must be a set" ); | ||
fi; | ||
|
||
nextIterator := function(iter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please insert a comment which explains what this algorithm is? E.g. if it has a name, give that; if there is a reference, give that?
I know that a lot of existing code doesn't that kind of thing either -- but I think that's a major issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a description. Is this satisfactory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just the mention of "restricted growth strings" is super helpful, as that allowed me to find papers discussing it, and also find it in TAOCP Volume 4A by Knuth.
I've taken the liberty of squashing your commits and fixing a few more formatting issues and typos. I also change s := s
to s := Immutable(s)
, to be resilient against changes to the input set during the iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, cheers!
Returns an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can be merged once tests passed.
IteratorOfPartitionsSet
an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
IteratorOfPartitionsSet
an iterator for all unordered partitions of a set into pairwise disjoint nonempty setsIteratorOfPartitionsSet
an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
Description
Added an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
Text for release notes
Added an iterator for all unordered partitions of a set into pairwise disjoint nonempty sets
Checklist for pull request reviewers
proper formatting
usage of relevant labels
release notes: not needed
orrelease notes: to be added
bug
orenhancement
ornew feature
stable-4.X
add thebackport-to-4.X
labelbuild system
,documentation
,kernel
,library
,tests
runnable tests
lines changed in commits are sufficiently covered by the tests
adequate pull request title
well formulated text for release notes
relevant documentation updates
sensible comments in the code