#6482: multivariate polynomial substitution has a design flaw
---------------------------------+------------------------------------------
Reporter: was | Owner: malb
Type: defect | Status: new
Priority: critical | Milestone: sage-4.1.1
Component: commutative algebra | Keywords:
Reviewer: | Author:
Merged: |
---------------------------------+------------------------------------------
Comment(by malb):
the main use-case for which I wrote it is (which **must** be fast):
{{{
sage: R.<x,y>=QQ[]
sage: g=x+y
sage: %timeit g.subs({x:2,y:1})
10000 loops, best of 3: 62.9 µs per loop
}}}
The performance for elements in R is:
{{{
sage: %timeit g.subs({x:x+1,y:x*y})
10000 loops, best of 3: 153 µs per loop
}}}
However, to my surprise {{{hom}}} is faster:
{{{
sage: R.<x,y>=QQ[]
sage: phi = R.hom([x+1,x*y])
sage: g=x+y
sage: %timeit phi(g)
10000 loops, best of 3: 45.8 µs per loop
}}}
Is it because it caches or is really just better code?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6482#comment:1>
Sage <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---