#5402: Sparse determinants are slow
---------------------------------------+------------------------------------
Reporter: jbandlow | Owner: was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.6
Component: linear algebra | Resolution:
Keywords: determinant | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Charles Bouillaguet | Merged in:
Dependencies: | Stopgaps:
---------------------------------------+------------------------------------
Comment (by kcrisman):
I get the same thing. With a heavy load on the same computer (accounting
for non-sparse slowdown),
{{{
sage: dd = {(0,0):1}
sage: %timeit matrix(8,dd).det()
5 loops, best of 3: 207 µs per loop
sage: %timeit matrix(8,dd,sparse = False).det()
625 loops, best of 3: 240 µs per loop
sage: %timeit matrix(100,dd).det()
25 loops, best of 3: 11.2 ms per loop
sage: %timeit matrix(100,dd,sparse = False).det()
25 loops, best of 3: 23.3 ms per loop
}}}
Maybe the way we make dictionary-defined matrices dense with
`sparse=False` is suboptimal?
I like the patch, though it would be nice if you could find someone who
has worked with caching before just to check that that code is correct - I
haven't really used it in the past and don't have time to find similar
examples in the code now, my apologies.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5402#comment:10>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.