#15931: Implement a proper hash function for (combinatorial) free module
elements
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.2
Component: linear algebra | Resolution:
Keywords: | Merged in:
Authors: Nicolas M. ThiƩry | Reviewers: Florent Hivert
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/nthiery/ticket/15931 | e8fe5eb8943debdb457c38d3264167d66e7b2b14
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nthiery):
Apparently, yes; here is the timing after adding a @cached_method:
{{{
sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: B = F.basis()
sage: f = B['a'] + 3*B['c']
sage: %timeit hash(f)
1000000 loops, best of 3: 582 ns per loop
}}}
It's almost an order of magnitude faster (more with larger elements),
assuming we often recompute the hash value of elements.
Do we want to do this?
--
Ticket URL: <http://trac.sagemath.org/ticket/15931#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.