-
Notifications
You must be signed in to change notification settings - Fork 184
Add EnumeratorOfPartitionsSet enumerator
#6384
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
Open
reiniscirpons
wants to merge
3
commits into
gap-system:master
Choose a base branch
from
reiniscirpons:add-more-enumerators
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+353
−5
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1169,14 +1169,16 @@ DeclareGlobalFunction("NrRestrictedPartitions"); | |||||||||||||
| ## | ||||||||||||||
| DeclareGlobalFunction( "IteratorOfPartitions" ); | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ############################################################################# | ||||||||||||||
| ## | ||||||||||||||
| #F IteratorOfPartitionsSet( <set> [, <k> [ <flag> ] ] ) | ||||||||||||||
| #F IteratorOfPartitionsSet( <set> [, <k> [, <flag> ] ] ) | ||||||||||||||
| #F EnumeratorOfPartitionsSet( <set> [, <k> [, <flag> ] ] ) | ||||||||||||||
| ## | ||||||||||||||
| ## <#GAPDoc Label="IteratorOfPartitionsSet"> | ||||||||||||||
| ## <ManSection> | ||||||||||||||
| ## <Func Name="IteratorOfPartitionsSet" Arg='set [, k [ flag ] ]'/> | ||||||||||||||
| ## <Heading>Iterator and enumerator of unordered set partitions</Heading> | ||||||||||||||
| ## <Func Name="IteratorOfPartitionsSet" Arg='set [, k [, flag ] ]'/> | ||||||||||||||
| ## <Func Name="EnumeratorOfPartitionsSet" Arg='set [, k [, flag ] ]'/> | ||||||||||||||
| ## | ||||||||||||||
| ## <Description> | ||||||||||||||
| ## <Ref Func="IteratorOfPartitionsSet" /> returns an iterator | ||||||||||||||
|
|
@@ -1187,12 +1189,36 @@ DeclareGlobalFunction( "IteratorOfPartitions" ); | |||||||||||||
| ## then only partitions of size <A>k</A> are computed. | ||||||||||||||
| ## If <A>k</A> is given and <A>flag</A> is equal to <K>true</K>, | ||||||||||||||
| ## then only partitions of size at most <A>k</A> are computed. | ||||||||||||||
| ## <P/> | ||||||||||||||
| ## <Ref Func="EnumeratorOfPartitionsSet"/> returns an enumerator | ||||||||||||||
| ## (see <Ref Attr="Enumerator" />) for all unordered partitions of the | ||||||||||||||
| ## set <A>set</A>. The arguments <A>k</A> and <A>flag</A> function in the | ||||||||||||||
| ## same manner as for the iterator. | ||||||||||||||
| ## <P/> | ||||||||||||||
| ## The ordering of the partitions from these functions can be different and | ||||||||||||||
| ## also different from the list returned by <Ref Func="PartitionsSet"/>. | ||||||||||||||
| ## <P/> | ||||||||||||||
| ## <Example> | ||||||||||||||
| ## gap> m:=[1..9];; | ||||||||||||||
| ## gap> Bell(9); | ||||||||||||||
| ## 21147 | ||||||||||||||
| ## gap> i := 0;; for c in PartitionsSet(m) do i := i+1; od; | ||||||||||||||
| ## gap> i; | ||||||||||||||
|
Comment on lines
+1205
to
+1206
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason not do just do
Suggested change
|
||||||||||||||
| ## 21147 | ||||||||||||||
| ## gap> cm := EnumeratorOfPartitionsSet(m);; | ||||||||||||||
| ## gap> cm[1000]; | ||||||||||||||
| ## [ [ 1, 2, 4, 9 ], [ 3, 6, 8 ], [ 5, 7 ] ] | ||||||||||||||
| ## gap> Position(cm, [[1, 3], [2, 5], [4], [6, 7, 8, 9]]); | ||||||||||||||
| ## 11001 | ||||||||||||||
| ## gap> cm[11001]; | ||||||||||||||
| ## [ [ 1, 3 ], [ 2, 5 ], [ 4 ], [ 6, 7, 8, 9 ] ] | ||||||||||||||
|
Comment on lines
+1211
to
+1214
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about this instead:
Suggested change
|
||||||||||||||
| ## </Example> | ||||||||||||||
| ## </Description> | ||||||||||||||
| ## </ManSection> | ||||||||||||||
| ## <#/GAPDoc> | ||||||||||||||
| ## | ||||||||||||||
| DeclareGlobalFunction( "IteratorOfPartitionsSet" ); | ||||||||||||||
|
|
||||||||||||||
| DeclareGlobalFunction( "EnumeratorOfPartitionsSet" ); | ||||||||||||||
|
|
||||||||||||||
| ############################################################################# | ||||||||||||||
| ## | ||||||||||||||
|
|
||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 am unsure with this comment.
The iterator accepts
<positive integer>and<set>as first argument.PartitionsSetaccepts only<set>.GAP proposes other function for
<positive integer>and its calledPartitions.I would profer to have primary function, focusing entirely each of these.
Same goes here, I would prefer to accept positive integer here too.