Combinatorics.jl
Combinatorics.jl copied to clipboard
Bug in integer_partitions(0)
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}[]