#3841: [patch retracted] Use singular for calculus by default.
----------------------------+----------------------------------------------
Reporter: gfurnish | Owner: gfurnish
Type: | Status: closed
enhancement | Milestone: sage-duplicate/invalid/wontfix
Priority: major | Resolution: invalid
Component: calculus | Merged in:
Keywords: | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | Stopgaps:
Dependencies: |
----------------------------+----------------------------------------------
Changes (by chapoton):
* upstream: => N/A
Old description:
> This patch makes symbolic polynomials use libsingular via the ring
> interface by default.
> It also contains a large number of doctest changes because polynomials in
> Sage have a better ordering.
>
> {{{
> %cython
> from sage.calculus.calculus import var
> from sage.rings.integer cimport Integer
> from random import random
> def blah(rng):
> global five
> x,y = var('x,y')
> foo = x
> cdef i
> for i from 0<=i<rng:
> foo+= x**int(random()*1000)+y**int(random()*10000)+x+1
> return foo
>
> The python code used to test maxima was:
> sage: def blah(rng):
> foo = x
> for i in xrange(0, rng):
> foo+=x^int(random()*10000)+y^int(random()*10000)+x+1; foo =
> simplify(foo)
> return foo
>
> I'm well aware that I'm comparing cython timings to python timings.. but
> the cython overhead isn't the dominating factor here.
> The simplify exists to force it to go to maxima to evaluate the
> expression between additions (as singular does). Otherwise this is not a
> very fair/real world comparison if Maxima gets to build the entire
> addition and send it to Maxima as one batch (and only do the addition
> once as opposed to rng times).
>
> %timeit blah(10)
>
> 125 loops, best of 3: 1.98 ms per loop
>
> Maxima:
> CPU times: user 0.14 s, sys: 0.05 s, total: 0.18 s
> Wall time: 1.97 s
>
> %timeit blah(100)
>
> 25 loops, best of 3: 20.8 ms per loop
>
> Maxima:
> CPU times: user 3.30 s, sys: 1.16 s, total: 4.47 s
> Wall time: 28.89 s
>
> %timeit blah(1000)
>
> 5 loops, best of 3: 214 ms per loop
>
> Maxima: Raises exception
>
> %timeit blah(10000)
>
> 5 loops, best of 3: 2.09 s per loop
>
> }}}
New description:
This patch makes symbolic polynomials use libsingular via the ring
interface by default.
It also contains a large number of doctest changes because polynomials in
Sage have a better ordering.
{{{
%cython
from sage.calculus.calculus import var
from sage.rings.integer cimport Integer
from random import random
def blah(rng):
global five
x,y = var('x,y')
foo = x
cdef i
for i from 0<=i<rng:
foo+= x**int(random()*1000)+y**int(random()*10000)+x+1
return foo
The python code used to test maxima was:
sage: def blah(rng):
foo = x
for i in xrange(0, rng):
foo+=x^int(random()*10000)+y^int(random()*10000)+x+1; foo =
simplify(foo)
return foo
I'm well aware that I'm comparing cython timings to python timings.. but
the cython overhead isn't the dominating factor here.
The simplify exists to force it to go to maxima to evaluate the expression
between additions (as singular does). Otherwise this is not a very
fair/real world comparison if Maxima gets to build the entire addition and
send it to Maxima as one batch (and only do the addition once as opposed
to rng times).
%timeit blah(10)
125 loops, best of 3: 1.98 ms per loop
Maxima:
CPU times: user 0.14 s, sys: 0.05 s, total: 0.18 s
Wall time: 1.97 s
%timeit blah(100)
25 loops, best of 3: 20.8 ms per loop
Maxima:
CPU times: user 3.30 s, sys: 1.16 s, total: 4.47 s
Wall time: 28.89 s
%timeit blah(1000)
5 loops, best of 3: 214 ms per loop
Maxima: Raises exception
%timeit blah(10000)
5 loops, best of 3: 2.09 s per loop
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/3841#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac.
For more options, visit https://groups.google.com/d/optout.