Skip to content

Fix integer_partitions(0) #179

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 1 commit into
base: master
Choose a base branch
from

Conversation

inkydragon
Copy link
Member

@inkydragon inkydragon commented May 1, 2025

Fix #138, and half of #143

GAP result:
NOTE: we use the same order as GPA do.

GAP 4.11.1 of 2021-03-02

gap> Partitions( 0 );
[ [  ] ]
gap> Partitions( 1 );
[ [ 1 ] ]
gap> Partitions( 2 );
[ [ 1, 1 ], [ 2 ] ]
gap> Partitions( 5 );
[ [ 1, 1, 1, 1, 1 ], [ 2, 1, 1, 1 ], [ 2, 2, 1 ], [ 3, 1, 1 ], [ 3, 2 ], [ 4, 1 ], [ 5 ] ]

Wolfram:

In[2]:= IntegerPartitions[0]
Out[2]= {{}}
In[4]:= IntegerPartitions[1]
Out[4]= {{1}}
In[5]:= IntegerPartitions[2]
Out[5]= {{2},{1,1}}
In[6]:= IntegerPartitions[5]
Out[6]= {{5},{4,1},{3,2},{3,1,1},{2,2,1},{2,1,1,1},{1,1,1,1,1}}

@inkydragon inkydragon added the bug label May 1, 2025
Copy link

codecov bot commented May 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.89%. Comparing base (403dcb4) to head (c4d945a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #179   +/-   ##
=======================================
  Coverage   96.89%   96.89%           
=======================================
  Files           8        8           
  Lines         805      805           
=======================================
  Hits          780      780           
  Misses         25       25           

☔ 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.

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.

integer_partitions(0) should return [[]] instead of []
1 participant