Skip to content

Bug in integer_partitions(0) #143

Open
@laurentbartholdi

Description

@laurentbartholdi

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}[]

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