Ticket #4242 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

[with patch, positive reivew] Bugfix for dominates() method of partition.py

Reported by: jbandlow Owned by: mhansen
Priority: major Milestone: sage-3.1.3
Component: combinatorics Keywords:
Cc: sage-combinat Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

p.dominates(q) would give the wrong answer (True) if q had more boxes than p, but the first (length of p) parts of q were dominated by p. Attached patch fixes this.

Attachments

4242.patch Download (1.2 KB) - added by jbandlow 5 years ago.
trac_4242.patch Download (940 bytes) - added by mhansen 5 years ago.

Change History

Changed 5 years ago by jbandlow

comment:1 Changed 5 years ago by mhansen

  • Summary changed from Bugfix for dominates() method of partition.py (with patch; needs review) to [with patch, positive review] Bugfix for dominates() method of partition.py (with patch; needs review)

Thanks Jason! Looks good to me.

comment:2 Changed 5 years ago by mabshoff

  • Summary changed from [with patch, positive review] Bugfix for dominates() method of partition.py (with patch; needs review) to [with patch, positive review] Bugfix for dominates() method of partition.py

comment:3 Changed 5 years ago by mabshoff

  • Status changed from new to closed
  • Resolution set to fixed

Merged in Sage 3.1.3.alpha3

comment:4 Changed 5 years ago by mabshoff

  • Status changed from closed to reopened
  • Resolution fixed deleted

With the patch applied I get

sage -t  devel/sage/sage/combinat/partition.py              
**********************************************************************
File "/scratch/mabshoff/release-cycle/sage-3.1.3.alpha3/tmp/partition.py", line 604:
    sage: Partition([]).dominates([1])
Expected:
    False
Got:
    True
**********************************************************************

I assumed that at least the patched file would be doctested :(

Cheers,

Michael

comment:5 Changed 5 years ago by mabshoff

  • Summary changed from [with patch, positive review] Bugfix for dominates() method of partition.py to [with patch, needs work] Bugfix for dominates() method of partition.py

Changed 5 years ago by mhansen

comment:6 Changed 5 years ago by mabshoff

  • Summary changed from [with patch, needs work] Bugfix for dominates() method of partition.py to [with patch, positive reivew] Bugfix for dominates() method of partition.py

Looks good to me. Thanks Mike.

Cheers,

Michael

comment:7 Changed 5 years ago by mabshoff

  • Status changed from reopened to closed
  • Resolution set to fixed

Merged in Sage 3.1.3.rc0

comment:8 Changed 4 years ago by nthiery

  • Cc sage-combinat added; jbandlow removed
Note: See TracTickets for help on using tickets.