Sage: Ticket #15296: LinearMatroid can't use sets for fundamentals
https://trac.sagemath.org/ticket/15296
<p>
Several methods in <a class="missing wiki">LinearMatroid?</a> have an option <code>fundamentals</code>. Internally, this gets used as a set, and we test things like <code>p in fundamentals</code>. Even though both <code>p</code> and the elements of <code>fundamentals</code> come from the same ring or field, it is not guaranteed (and sometimes false) that <code>p == q</code> implies <code>hash(p) == hash(q)</code>.
</p>
<p>
The default behavior of these methods should therefore be to test for equality with each member of <code>fundamentals</code>, instead of relying on the <code>in</code> keyword. An optional argument (such as <code>use_fast_fundamental_test</code> with default option False can be used to speed up computations when appropriate.
</p>
<p>
See <a class="new ticket" href="https://trac.sagemath.org/ticket/15297" title="#15297: defect: Elements from a Field of Fractions that compare equal should have ... (new)">#15297</a> for a change that makes the fast_fundamental_test work for a larger group of fields.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/15296
Trac 1.2StefanWed, 16 Oct 2013 19:42:50 GMTdescription changed
https://trac.sagemath.org/ticket/15296#comment:1
https://trac.sagemath.org/ticket/15296#comment:1
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/15296?action=diff&version=1">diff</a>)
</li>
</ul>
TicketFor batch modificationsThu, 30 Jan 2014 21:20:52 GMTmilestone changed
https://trac.sagemath.org/ticket/15296#comment:2
https://trac.sagemath.org/ticket/15296#comment:2
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.1</em> to <em>sage-6.2</em>
</li>
</ul>
TicketFor batch modificationsTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/15296#comment:3
https://trac.sagemath.org/ticket/15296#comment:3
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
TicketFor batch modificationsSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/15296#comment:4
https://trac.sagemath.org/ticket/15296#comment:4
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
TicketRudi PendavinghTue, 09 Jun 2015 17:20:27 GMT
https://trac.sagemath.org/ticket/15296#comment:5
https://trac.sagemath.org/ticket/15296#comment:5
<p>
Hi Stefan,
</p>
<p>
There are several methods in <a class="missing wiki">LinearMatroid?</a> that need to be adjusted for this, roughly _line_ratios() through _cross_ratio_test() in the linear_matroid.pyx source. I would suggest writing a second version for each of these routines which is safe for field of fractions, keeping the unsafe but fast version to use for `safe' fields. The initializer of <a class="missing wiki">LinearMatroid?</a> should sniff out the unsafe fields and make sure that in such cases the safe methods get called throughout.
</p>
<p>
Now in c++ I would know how to do this, simply let the initializer replace the the pointers to the unsafe methods by pointers to their corresponding safe versions, but can this be done in cython? If so, I propose I write the safe versions and you fix up the initializer to finish up.
</p>
<p>
Rudi
</p>
<p>
</p>
Ticket