Opened 7 years ago

Closed 7 years ago

#12022 closed defect (fixed)

failing doctest in integer_vector.py (gale ryser theorem) / multiple solutions

Reported by: emil Owned by: mvngu
Priority: minor Milestone: sage-4.8
Component: doctest coverage Keywords: doctest, combinat, gale, ryser, multiple solutions
Cc: ncohen Merged in: sage-4.8.alpha3
Authors: Nathann Cohen Reviewers: Emil Widmann
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage -t -force_lib "devel/sage/sage/combinat/integer_vector.py"
**********************************************************************
File "/mnt/sda6/COMPILE/sage-4.7.2/devel/sage/sage/combinat/
integer_vector.py", line 262:
    sage: print gale_ryser_theorem(p1, p2)
Expected:
    [1 1 0]
    [1 0 1]
    [0 1 0]
Got:
    [0 1 1]
    [1 1 0]
    [1 0 0]
**********************************************************************
File "/mnt/sda6/COMPILE/sage-4.7.2/devel/sage/sage/combinat/
integer_vector.py", line 298:
    sage: print gale_ryser_theorem(p1, p2, algorithm="gale")
Expected:
    [1 1 1 0 0]
    [1 1 0 0 1]
    [1 0 1 0 0]
    [0 0 0 1 0]
Got:
    [1 0 1 1 0]
    [1 0 1 0 1]
    [1 1 0 0 0]
    [0 1 0 0 0]
**********************************************************************

This is about the gale ryser theorem. The row sum of the matrix should be p1 and the column sum of the matrix should be p2. For the first failing test: p1 = [2,2,1], p2 = [2,2,1] which is obviously true for both matrices.

Same is true for the second doctest error, both matrices have [3,3,2,1] [3,2,2,1,1] as row resp. column sum.

Proposed fix is to create a TEST section with an example with an unique solution and flag the above doctests as "no test"

reportet in: http://groups.google.com/group/sage-devel/browse_thread/thread/e1886d5ba5ade945

Attachments (1)

trac_12022.patch (1.1 KB) - added by ncohen 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by ncohen

  • Status changed from new to needs_review

Hello !

As in #12019, I think it is safe to just add "not tested" above the lines that print the matrices. In the "TESTS" section of the docstring, there is a much harder tests that creates many matrices and check them for correctness without printing them.

Nathann

Changed 7 years ago by ncohen

comment:2 Changed 7 years ago by jdemeyer

I would like to know on which system these failures occur. Sage has been widely tested on many different systems, so I'm surprised to see this failure.

comment:3 Changed 7 years ago by emil

  • Status changed from needs_review to positive_review

OK, I applied the test and it passes doctest now - fine for me. I appended system specs to ticket 12019

but here is the output of cat /proc/cpuinfu

/mnt/sda6/COMPILE/sage-4.7.2/devel/sage/sage/combinat/integer_vector.py"
sage -t -force_lib "devel/sage/sage/combinat/integer_vector.py"
	 [13.7 s]
 
----------------------------------------------------------------------
All tests passed!


root@sage-lite-vmserver:/mnt/sda6/COMPILE/sage-4.7.2 $cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 15
model name	: Intel(R) Core(TM)2 Duo CPU     E4600  @ 2.40GHz
stepping	: 13
cpu MHz		: 1200.000
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm
bogomips	: 4799.79
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 15
model name	: Intel(R) Core(TM)2 Duo CPU     E4600  @ 2.40GHz
stepping	: 13
cpu MHz		: 1200.000
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm
bogomips	: 4799.86
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

comment:4 Changed 7 years ago by jdemeyer

  • Authors set to Nathann Cohen
  • Reviewers set to Emil Widmann
  • Work issues create TEST section with unique solution, flag failing test as "no test" deleted

comment:5 Changed 7 years ago by jdemeyer

  • Merged in set to sage-4.8.alpha3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.