#12923: Comparison of vectors is O(n) even in the simple cases
------------------------------+---------------------------------------------
Reporter: hivert | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: linear algebra | Keywords: vector equality
Work issues: | Report Upstream: N/A
Reviewers: | Authors: Florent Hivert
Merged in: | Dependencies:
Stopgaps: |
------------------------------+---------------------------------------------
Comparison of large vectors in Sage is slow in a surprising way: even if
all
the entries of the vectors are different, the cost is proportional to the
length of the vector instead of having constant cost !
{{{
sage: l = 1000; m0 = vector(ZZ, [0]*l); m1 = vector(ZZ, [1]*l)
sage: %timeit m0 == m1
625 loops, best of 3: 656 盜 per loop
sage: l = 10000; m0 = vector(ZZ, [0]*l); m1 = vector(ZZ, [1]*l)
sage: %timeit m0 == m1
125 loops, best of 3: 5.66 ms per loop
sage: l = 100000; m0 = vector(ZZ, [0]*l); m1 = vector(ZZ, [1]*l)
sage: %timeit m0 == m1
5 loops, best of 3: 59.1 ms per loop
}}}
This seems to affect all the dense vectors independently from the base
ring.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12923>
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.