#7742: add a compose function to sage
--------------------------------+-------------------------------------------
   Reporter:  was               |       Owner:  AlexGhitza
       Type:  defect            |      Status:  new       
   Priority:  major             |   Milestone:  sage-4.3.1
  Component:  basic arithmetic  |    Keywords:            
Work_issues:                    |      Author:            
   Upstream:  N/A               |    Reviewer:            
     Merged:                    |  
--------------------------------+-------------------------------------------

Comment(by ncohen):

 I completely agree ! That's what we are doing in graph theory : first
 implement, then try to think about how to optimize it :-)

 I this case it should not be too different from these few lines ( if I
 make none of my usual mistakes )

 {{{
 if n==0:
     return "identity function"( no idea how it is called in Sage )

 if n%2 == 1:
     ff = compose(f, (n-1)/2, a)
     return f(ff(ff(a)))
 else:
     ff = compose(f, n/2, a)
     return ff(ff(a))
 }}}

 But perhaps the function "compose" should be a method of these symbolic
 callable expressions you mentionned, which would be called by this
 "compose" function : it may be interesting to compute symbolically the
 n^th composed of a function without evaluating it  :-)

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