Is there a way to get the size of an integer (really fast, like a  
macro getting the number of words)? One could perhaps override  
_strassen_default_cutoff (though I don't know how much overhead this  
would be for matrices with smallish entries).

One can always enforce it by doing M._multiply_strassen(N)

For huge Z, I wonder if it's still trying to do multi-modular? That  
would probably be bad. I'm also not sure how much of the dispatching  
is done in Linbox vs. Sage.

- Robert


On Oct 23, 2007, at 6:17 PM, David Harvey wrote:

>
> Hi,
>
> I'm interested in multiplying smallish matrices over Z with huge
> entries.
>
> On my machine, sage can multiply 3000000-bit integers in about 0.14s,
> and adding integers of that size takes about 1/1000 of the time:
>
> sage: x = ZZ.random_element(2^3000000)
> sage: y = ZZ.random_element(2^3000000)
> sage: timeit z = x * y
> 10 loops, best of 3: 141 ms per loop
> sage: timeit z = x + y
> 10000 loops, best of 3: 152 µs per loop
>
> So clearly for matrix multiply, we want to Strassen all the way to
> the bottom.
>
> But look at this:
>
> sage: M1 = matrix(8, 8, [ZZ.random_element(2^3000000) for i in range
> (64)])
> sage: M2 = matrix(8, 8, [ZZ.random_element(2^3000000) for i in range
> (64)])
> sage: time M3 = M1 * M2
> CPU times: user 69.43 s, sys: 2.29 s, total: 71.72 s
> Wall time: 71.76
>
> By my reckoning, it should only have to do 7*7*7 multiplies, which
> should take < 50s. It looks like it's really doing 8*8*8 multiplies.
>
> david
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to