Skip to content

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

Open
@jessebett

Description

@jessebett

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions