Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If numerical approximations are good enough for you you can speed things up:

sage: m = random_matrix(ZZ, 100, 100, x=0, y=10^100)
sage: v = random_vector(ZZ, 100, x=0, y=10^100)
sage: timeit('m*v')
125 loops, best of 3: 7.37 ms per loop

this is much faster:

sage: mr = matrix(RDF,m)
sage: vr = vector(RDF,v)
sage: timeit('mr*vr')
625 loops, best of 3: 367 ┬Ás per loop

If you supply the code which gives your bottleneck people might be more helpful in optimization ideas.