[Scipy-svn] r4871 - in trunk/scipy/interpolate: . tests

scipy-svn@scip... scipy-svn@scip...
Sat Nov 1 07:30:31 CDT 2008


Author: ptvirtan
Date: 2008-11-01 07:30:19 -0500 (Sat, 01 Nov 2008)
New Revision: 4871

Modified:
   trunk/scipy/interpolate/rbf.py
   trunk/scipy/interpolate/tests/test_rbf.py
Log:
interpolate.Rbf: add linear basis function

Modified: trunk/scipy/interpolate/rbf.py
===================================================================
--- trunk/scipy/interpolate/rbf.py	2008-11-01 12:29:56 UTC (rev 4870)
+++ trunk/scipy/interpolate/rbf.py	2008-11-01 12:30:19 UTC (rev 4871)
@@ -65,6 +65,7 @@
             'multiquadric': sqrt((r/self.epsilon)**2 + 1)
             'inverse multiquadric': 1.0/sqrt((r/self.epsilon)**2 + 1)
             'gaussian': exp(-(self.epsilon*r)**2)
+            'linear': r
             'cubic': r**3
             'quintic': r**5
             'thin-plate': r**2 * log(r)
@@ -105,6 +106,8 @@
             return 1.0/sqrt((1.0/self.epsilon*r)**2 + 1)
         elif self.function.lower() == 'gaussian':
             return exp(-(self.epsilon*r)**2)
+        elif self.function.lower() == 'linear':
+            return r
         elif self.function.lower() == 'cubic':
             return r**3
         elif self.function.lower() == 'quintic':

Modified: trunk/scipy/interpolate/tests/test_rbf.py
===================================================================
--- trunk/scipy/interpolate/tests/test_rbf.py	2008-11-01 12:29:56 UTC (rev 4870)
+++ trunk/scipy/interpolate/tests/test_rbf.py	2008-11-01 12:30:19 UTC (rev 4871)
@@ -7,7 +7,7 @@
 from scipy.interpolate.rbf import Rbf
 
 FUNCTIONS = ('multiquadric', 'inverse multiquadric', 'gaussian',
-             'cubic', 'quintic', 'thin-plate')
+             'cubic', 'quintic', 'thin-plate', 'linear')
 
 def check_rbf1d(function):
     x = linspace(0,10,9)



More information about the Scipy-svn mailing list