Skip to content

Bugfix: include empty combination #129

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

Open
wants to merge 6 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

All modified and coverable lines are covered by tests ✅

Project coverage is 97.21%. Comparing base (2ad84aa) to head (df85dee).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #129   +/-   ##
=======================================
  Coverage   97.21%   97.21%           
=======================================
  Files           8        8           
  Lines         826      826           
=======================================
  Hits          803      803           
  Misses         23       23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@inkydragon inkydragon added the bug label May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants