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

Bugfix: include empty combination #129

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Stivanification
Copy link

@Stivanification Stivanification commented Dec 26, 2022

Closes Issues #86 and #123. Currently the output of combinations(a) does not include the empty combination, which is a bug. Also in the tests, we should have combinations([]) = [[]], i.e., an array that contains the empty set, not the empty set itself.

Stivanification and others added 5 commits January 5, 2017 17:00
This is a julia port of the sage VectorPartitions function originally written by Amritanshu Prasad (2013).

A vector partition of "vec" is a list of vectors with non-negative integer entries whose sum is "vec". The method vector_partitions creates all vector partitions of "vector" with all parts greater than or equal to "min" in lexicographic order recursively.

      INPUT:
     - "vec" -- a list of non-negative integers.
     EXAMPLES:
     If "min" is not specified, then the class of all vector partitions of
     "vec" is created::
         julia> vector_partitions([2, 2])
         9-element Array{Any,1}:
         Array{Int64,1}[[1,0],[1,0],[0,1],[0,1]]
         Array{Int64,1}[[2,0],[0,1],[0,1]]
         Array{Int64,1}[[1,1],[1,0],[0,1]]
         Array{Int64,1}[[2,1],[0,1]]
         Array{Int64,1}[[1,0],[1,0],[0,2]]
         Array{Int64,1}[[2,0],[0,2]]
         Array{Int64,1}[[1,2],[1,0]]
         Array{Int64,1}[[1,1],[1,1]]
         Array{Int64,1}[[2,2]]
@codecov
Copy link

codecov bot commented Dec 26, 2022

Codecov Report

Base: 96.85% // Head: 96.85% // No change to project coverage 👍

Coverage data is based on head (7ceb259) compared to base (d1b633b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #129   +/-   ##
=======================================
  Coverage   96.85%   96.85%           
=======================================
  Files           7        7           
  Lines         700      700           
=======================================
  Hits          678      678           
  Misses         22       22           
Impacted Files Coverage Δ
src/combinations.jl 85.27% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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

Successfully merging this pull request may close these issues.

1 participant