#7715: implement vectors mod 2 as M4RI matrices with one row
------------------------------+---------------------------------------------
Reporter: malb | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.3.1
Component: linear algebra | Keywords: vector, M4RI, matrix, GF(2)
Work_issues: | Author: Martin Albrecht
Upstream: N/A | Reviewer:
Merged: |
------------------------------+---------------------------------------------
Comment(by malb):
The speed-up provided by this patch is considerable (but not as much as
one would hope for). Here's the example from #3684:
'''Before'''
{{{
#!python
sage: A = random_matrix(GF(2),1000,2000)
sage: %time K = A.right_kernel()
CPU times: user 11.24 s, sys: 0.02 s, total: 11.25 s
Wall time: 11.42 s
}}}
'''After'''
{{{
#!python
sage: A = random_matrix(GF(2),1000,2000)
sage: %time K = A.right_kernel()
CPU times: user 0.15 s, sys: 0.00 s, total: 0.15 s
Wall time: 0.16 s
}}}
Speed-up: 11.25/0.15 = 75
----
Another example
'''Before'''
{{{
#!python
sage: VS = VectorSpace(GF(2),10^4)
sage: e = VS.random_element()
sage: f = VS.random_element()
sage: %timeit e+f
10000 loops, best of 3: 89.8 µs per loop
sage: %timeit e*f
10000 loops, best of 3: 146 µs per loop
}}}
'''After'''
{{{
#!python
sage: VS = VectorSpace(GF(2),10^4)
sage: e = VS.random_element()
sage: f = VS.random_element()
sage: %timeit e+f
1000000 loops, best of 3: 1.08 µs per loop
sage: %timeit e*f
100000 loops, best of 3: 2.47 µs per loop
}}}
Speed-ups: 83 and 59.
----
The attached patch might indeed depend on #3684.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7715#comment:1>
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.