I'm not getting complete permutations. if I try to get all of the
permutations of the numbers from 1 to 14, using a simple script, it
terminates early. I've tried this on fc5 native and fc6 as a vmware guest
and get the same result. it appears to stop cleanly, just early.
Have I built the code wrongly or something? I took that standard _0.912
tarball. I cannot even work out how to debug this. The reproduceability on
different platforms makes me think it's an overflow problem, but I don't
see anything obvious in that loop value. I see no symptoms of memory
leakage.
this program:
---cut here---
import probstat
values = [i+1 for i in range (14)]
gen = probstat.Permutation (values)
loop = 1
for i in gen:
if loop %1000000 == 0: print loop
loop += 1
-- cut here --
stops after it has printed 1278000000. loop is 1278945281, i is:
[1, 4, 11, 2, 8, 7, 13, 14, 12, 5, 9, 6, 10, 3]
loop should be around 87 billion, not 1.27 billion
Nobody/Anonymous
None
None
Public
|
Date: 2007-01-24 21:45
|