can you avoid sums for initialisation?

sage: P.<x>=PolynomialRing(QQ)
sage: time p=P(dict([(i,1) for i in range(9999)]))
CPU times: user 0.07 s, sys: 0.00 s, total: 0.07 s
Wall time: 0.07 s

On Nov 26, 2:43 pm, Nathann Cohen <nathann.co...@gmail.com> wrote:
> R = PolynomialRing(QQ, 'x')
> x = R.gen()
> sum([x^i for i in range(2,9999)])
>
> This is still very slow ( even if the values are larger ) :-/
>
> Nathann

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

Reply via email to