#9061: Create an efficient SUM command
-------------------------+--------------------------------------------------
   Reporter:  ncohen     |       Owner:  jason, jkantor
       Type:  defect     |      Status:  new           
   Priority:  major      |   Milestone:  sage-4.4.3    
  Component:  numerical  |    Keywords:                
     Author:             |    Upstream:  N/A           
   Reviewer:             |      Merged:                
Work_issues:             |  
-------------------------+--------------------------------------------------

Comment(by jason):

 For me, the balanced_sum function gives these timings:

 {{{
 sage: p = MixedIntegerLinearProgram()
 sage: v = p.new_variable()
 sage: sage: %timeit sum([v[i] for i in xrange(900)])
 5 loops, best of 3: 1.48 s per loop
 sage: p = MixedIntegerLinearProgram()
 sage: v = p.new_variable()
 sage: %timeit sage.misc.misc.balanced_sum([v[i] for i in xrange(900)])
 25 loops, best of 3: 28.2 ms per loop
 }}}

 So I guess your function still wins (which isn't much of a surprise).

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