On Feb 13, 2009, at 1:47 PM, Sébastien Labbé wrote:

> Hi,
>
> I am currently getting trouble with a sum of many (a thousand) SR  
> vectors. As an example in sage 3.2.3 :
>
> sage: v=vector((1, sqrt(3)/2 ))
> sage: sum([v]*900)
> (900, 450*sqrt(3))
> sage: sum([v]*1000)
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (849, 0))
>
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (849, 0))
>
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (849, 0))

This is probably some pexpect issue with large inputs. Though it's  
not a solution to SR vectors, you might want to see if you could work  
in another ring. It would probably be a lot faster too.

sage: K.<sqrt3> = QuadraticField(3)
sage: v = vector([1, sqrt3/2])
sage: sum([v]*900)
(900, 450*sqrt3)
sage: sum([v]*1000)
(1000, 500*sqrt3)
sage: time sum([v]*1000)
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00 s
(1000, 500*sqrt3)
sage: time sum([v]*100000)
CPU times: user 0.38 s, sys: 0.00 s, total: 0.38 s
Wall time: 0.39 s
(100000, 50000*sqrt3)

- Robert


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

Reply via email to