I believe there is a bug in sage's Combinations.random_element(). Unfortunately, it's difficult (but not impossible) to reproduce. I need to search millions of combinations from a large set. In many cases, Combinations.random_element() works great. But if I have a largest enough set, then it will crash overnight, after 100's of thousands of calls. The crash always seems to be in the call to cardinality just before randint and unrank. The number of trials before the crash appears to be dependent on the random seed, as well as the cardinality of the set. I'm guessing the gap sub-process is getting gummed up somehow - maybe a memory leak?
Rather than re-creating the bug, I propose that the value returned from cardinality be cached in the Combinations class. Making calls to a gap subprocess sounds like a heavy-weight thing to do for every random call. Should I submit an "enhancement" ticket? Matthew -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.