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

Converted partition functions from tasks to iterators #4055

Merged
merged 2 commits into from
Aug 14, 2013

Conversation

kmsquire
Copy link
Member

  • Renamed integer_partitions -> partitions (multiple dispatch!)
  • Added partitions(n) variant to generate all integer partitions
  • Added npartitions, nsetpartitions functions
  • Updated docs

Notes

  • npartitions/nsetpartitions use manual memoizing to calculate the recurrence.
  • The npartitions/nsetpartitions might not be necessary to export. They're used by length.
  • These all might be better off in a package.

This should close #3989, except for the subsets function that Stefan suggested.

* Renamed integer_partitions -> partitions (multiple dispatch!)
* Added partitions(n) variant to generate all integer partitions
* Added npartitions, nsetpartitions functions
* Updated docs
Also speed up SetPartitions iteration
@StefanKarpinski
Copy link
Member

The fact that you can construct a partitions type of object and then take its length maybe indicates that we don't need to export npartitions and such, but if npartiations and nsetpartitions could be collapsed into a single function, maybe it makes sense. I certainly don't think they warrant a package since they're so closely related to this functionality. The subset functionality I mentioned is possibly subsumed by combinations since combinations(s,k) gives the number of subsets of size k of the collection s. Perhaps with no second argument combinations(s) should iterate all the subsets of s?

StefanKarpinski added a commit that referenced this pull request Aug 14, 2013
Converted partition functions from tasks to iterators
@StefanKarpinski StefanKarpinski merged commit 9e1727c into master Aug 14, 2013
stevengj added a commit that referenced this pull request Aug 14, 2013
IanButterworth pushed a commit that referenced this pull request Oct 21, 2024
…b6e99 (#56261)

Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: release-1.11
Julia branch: backports-release-1.11
Old commit: aba90d22b
New commit: 9438b6e99
Julia version: 1.11.1
Pkg version: 1.11.0(Does not match)
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@aba90d2...9438b6e

```
$ git log --oneline aba90d22b..9438b6e99
9438b6e99 Merge pull request #4055 from JuliaLang/backports-release-1.11
c83160aac REPLExt: use Base.isaccessibledir rather than isdir in completions (#4053)
7997ec320 REPLExt: run repl hint generation for modeswitch chars when not switching (#4054)
```

Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
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.

combinations, partitions functions should return iterators
3 participants