Hi Ondrej
I tried to compare a naive implementation of Knonecker in Python with what
Karatsuba that
Sympy currently uses for multiplication. I have modified pernici's code
for Kronecker.
https://github.com/shivamvats/sympy/commit/99b1fa5fecccb7a46b19d0863b4e8f3315f555da
```
res = 2*x+1
t1 = clock()
for i in range(1000):
res = R.dup_pack_mul(2*x+1, res)
t2 = clock()
print(t2-t1)
31.3395597935
```
```res = 2*x+1
t1 = clock()
for i in range(1000):
res = R.dup_mul(2*x+1, res)
t2 = clock()
print(t2-t1)
6.16460609436
```
Karatsuba, and even normal multiplication is faster than Kronecker by a
large factor.
The main reason is of course, that we should use a fast library for the
integer multiplication.
Moreover, how much padding needs to be done, is also not a trivial question.
So, I too, think we should use sparse representation to optimise Sympy
for no.
Shivam
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/650b3e20-5897-472e-ad62-49145aeefc30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.