[Scipy-svn] r6806 - trunk/scipy/interpolate

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Sep 14 19:07:54 EDT 2010


Author: ptvirtan
Date: 2010-09-14 18:07:54 -0500 (Tue, 14 Sep 2010)
New Revision: 6806

Modified:
   trunk/scipy/interpolate/interpnd.pyx
Log:
BUG: interpolate: do not use fmax, since it's a C99-only function

Modified: trunk/scipy/interpolate/interpnd.pyx
===================================================================
--- trunk/scipy/interpolate/interpnd.pyx	2010-09-13 21:20:07 UTC (rev 6805)
+++ trunk/scipy/interpolate/interpnd.pyx	2010-09-14 23:07:54 UTC (rev 6806)
@@ -37,14 +37,12 @@
 
 cdef extern from "math.h":
     double sqrt(double x) nogil
-    double fmax(double a, double b) nogil
     double fabs(double a) nogil
 
 cdef extern from "numpy/ndarrayobject.h":
     cdef enum:
         NPY_MAXDIMS
 
-
 #------------------------------------------------------------------------------
 # Interpolator base class
 #------------------------------------------------------------------------------
@@ -427,15 +425,15 @@
             r[0] = ( Q[3]*s[0] - Q[1]*s[1])/det
             r[1] = (-Q[2]*s[0] + Q[0]*s[1])/det
 
-            change = fmax(fabs(y[it.vertex*2 + 0] + r[0]),
-                          fabs(y[it.vertex*2 + 1] + r[1]))
+            change = max(fabs(y[it.vertex*2 + 0] + r[0]),
+                         fabs(y[it.vertex*2 + 1] + r[1]))
             
             y[it.vertex*2 + 0] = -r[0]
             y[it.vertex*2 + 1] = -r[1]
 
             # relative/absolute error
-            change /= fmax(1.0, fmax(fabs(r[0]), fabs(r[1])))
-            err = fmax(err, change)
+            change /= max(1.0, max(fabs(r[0]), fabs(r[1])))
+            err = max(err, change)
 
         if err < tol:
             return iiter + 1




More information about the Scipy-svn mailing list