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

integer_partitions should be deprecated in favour of partitions(n::Integer) #81

Open
jessebett opened this issue Jul 11, 2019 · 0 comments

Comments

@jessebett
Copy link

integer_partitions(n) should be deprecated in favour of partitions(n::Integer).

Additionally, partitions is not documented in the readme.

These functions currently do not behave the same:
In the 0 case, both are broken, the partitions case discussed in #79 :

julia> integer_partitions(0)
0-element Array{Array{Int64,1},1}

julia> partitions(0)|>collect
1-element Array{Array{Int64,1},1}:
 #undef

but should return [[]]

For n>0 the results of integer_partitions is sorted opposite to partitions:

julia> collect(partitions(3))
3-element Array{Array{Int64,1},1}:
 [3]
 [2, 1]
 [1, 1, 1]

julia> integer_partitions(3)
3-element Array{Array{Int64,1},1}:
 [1, 1, 1]
 [2, 1]
 [3]
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

1 participant