#7377: Symbolic Ring to Maxima via EclObject
---------------------------+------------------------------------------------
   Reporter:  nbruin       |       Owner:  nbruin      
       Type:  enhancement  |      Status:  new         
   Priority:  major        |   Milestone:  sage-feature
  Component:  symbolics    |    Keywords:              
     Author:  Nils Bruin   |    Upstream:  N/A         
   Reviewer:               |      Merged:              
Work_issues:               |  
---------------------------+------------------------------------------------

Comment(by nbruin):

 The latest patch must be applied after {{{abstract-maxima}}} and
 {{{maxlib}}}. It adds routines {{{sr_to_max}}} and {{{max_to_sr}}} that
 try to translate between maxima's internal datastructure and SR while
 avoiding string transformations as much as possible. It falls back to the
 old interface to establish many of its symbol and operator translations,
 but takes note of them and uses a dictionary directly the next time
 around. It also avoids the overhead of binding expressions to maxima
 variables.

 to go back and forth, {{{maxima_lib.MaximaElement()}}} as a new function
 {ecl()} which passes back the underlying EclObject. Conversely,
 {{{maxima_lib.maxima}}} accepts EclObjects and returns a corresponding
 expect interface object.

 This patch also rewrite calculus integral, limit and sum to directly pass
 back and forth to maxima. There is a lot of overhead in SR itself, so
 speed gains are not that big. New times are:
 {{{
 sage: timeit("integral(cos(x),x)")
 625 loops, best of 3: 1.1 ms per loop
 sage: timeit("integral(cos(x^2),x)")
 5 loops, best of 3: 31.2 ms per loop
 }}}
 where old were
 {{{
 sage: timeit("integral(cos(x),x)")
 25 loops, best of 3: 8.08 ms per loop
 sage: timeit("integral(cos(x^2),x)")
 5 loops, best of 3: 37 ms per loop
 }}}

 It is easy to swap the old and new interfaces: simply comment/uncomment
 the appropriate lines in {{{calculus.py}}} to define the appropriate
 calculus.maxima

 There are 7 doctest failures in {{{calculus.py}}}. All of them are
 whitespace, errors and changed precision in floats:
 the binary interface passes {{{double}}}s directly, so there are no digits
 rounded. This affects some doctests. In other words, as far is
 {{{calculus.py}}} is concerned the two interfaces are functionally
 equivalent.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7377#comment:8>
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 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.

Reply via email to