[Scipy-tickets] [SciPy] #1141: orthogonal_eval crashes

SciPy Trac scipy-tickets@scipy....
Fri May 28 05:01:06 CDT 2010


#1141: orthogonal_eval crashes
---------------------------+------------------------------------------------
 Reporter:  cjgohlke       |       Owner:  pv   
     Type:  defect         |      Status:  new  
 Priority:  normal         |   Milestone:  0.8.0
Component:  scipy.special  |     Version:  devel
 Keywords:                 |  
---------------------------+------------------------------------------------

Comment(by cjgohlke):

 Please discard the previously proposed patch. It does avoid the crash, but
 is not functional.

 I traced the problem to a single line in the eval_poly_chebyt function:

 {{{
 for m in range(k+1, 0, -1):
 }}}

 The following patch works for me (no crash, tests pass) and should also
 improve execution speed:

 {{{
 Index: orthogonal_eval.pyx
 ===================================================================
 --- orthogonal_eval.pyx (revision 6418)
 +++ orthogonal_eval.pyx (working copy)
 @@ -30,7 +30,7 @@
      b1 = -1
      b0 = 0
      x = 2*x
 -    for m in range(k+1, 0, -1):
 +    for m in range(k+1):
          b2 = b1
          b1 = b0
          b0 = x*b1 - b2
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1141#comment:8>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list