Opened 8 years ago

Closed 8 years ago

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

Reported by: Owned by: emil mvngu minor sage-4.8 doctest coverage doctest, combinat, gale, ryser, multiple solutions ncohen sage-4.8.alpha3 Nathann Cohen Emil Widmann N/A

### 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"

### comment:1 Changed 8 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

### comment:2 Changed 8 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 8 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 8 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 8 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.