> > What dimensions are you talking about?
>
> Not *that* big, actually. It can easily be more than 1000 rows/columns
> (dense), but probably not much more than 3000. How much is the speed
> up in that dimensions?
>
> Cheers
>       Simon

I never checked those dimensions since i always considered them too small to 
be interesting, here are some times:

= matrix times vector =
sage: A = random_matrix(GF(2),1000,1000)
sage: v = random_matrix(GF(2),1000,1)
sage: %timeit A*v
1000 loops, best of 3: 216 µs per loop

sage: A = random_matrix(GF(2),3000,3000)
sage: v = random_matrix(GF(2),3000,1)
sage: %timeit A*v
1000 loops, best of 3: 808 µs per loop

= vector times scalar =
 doesn't make sense, really

= sum/difference of vectors =

sage: v = random_matrix(GF(2),1000,1)
sage: %timeit v+v
10000 loops, best of 3: 26.5 µs per loop

sage: v = random_matrix(GF(2),3000,1)
sage: %timeit v+v
10000 loops, best of 3: 62.8 µs per loop

sage: v = random_matrix(GF(2),1,3000
sage: %timeit v+v
100000 loops, best of 3: 8.09 µs per loop

sage: v = random_matrix(GF(2),1,1000)
sage: %timeit v+v # looks like a lot of calling overhead
100000 loops, best of 3: 7.95 µs per loop

= echelon form of a matrix =
sage: A = random_matrix(GF(2),1000,1000)
sage: %time A.echelonize()
CPU times: user 0.01 s, sys: 0.00 s, total: 0.01 s
Wall time: 0.01 s

sage: A = random_matrix(GF(2),3000,3000)
sage: %time A.echelonize()
CPU times: user 0.05 s, sys: 0.00 s, total: 0.05 s
Wall time: 0.06 s

Generally, I'd advise to create matrices of with 1 row and n columns rather 
than the other way around to represent the vectors. In the M4RI library there 
is actually a function for multiplication with 'pre-transposed' 
vectors/matrices like this which will be faster. However, it is not exposed 
yet, but that is easy. ... maybe someone should write a Vectoer_dense_gf2 
class :-)

Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to