Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

Bug in integer_partitions(0)

Open laurentbartholdi opened this issue 2 years ago • 0 comments

integer_partitions(0) returns the empty list, while there is a partition of 0, namely Int[].

The error is in src/partitions.c:459, which should return Vector{Int}[[]] or [Int[]].

There is also a problem with partitions(0):

julia> partitions(0)
Combinatorics.IntegerPartitions(0)

julia> collect(ans)
1-element Vector{Vector{Int64}}:
 #undef

julia> integer_partitions(0)
Vector{Int64}[]

laurentbartholdi avatar Nov 06 '23 13:11 laurentbartholdi