[Scipy-svn] r5036 - trunk/scipy/lib/lapack/tests

scipy-svn@scip... scipy-svn@scip...
Mon Nov 10 06:35:49 CST 2008


Author: cdavid
Date: 2008-11-10 06:35:41 -0600 (Mon, 10 Nov 2008)
New Revision: 5036

Modified:
   trunk/scipy/lib/lapack/tests/esv_tests.py
Log:
Make sure reference is 32 bits float when testing for 32 bits syevr.

Modified: trunk/scipy/lib/lapack/tests/esv_tests.py
===================================================================
--- trunk/scipy/lib/lapack/tests/esv_tests.py	2008-11-10 10:34:25 UTC (rev 5035)
+++ trunk/scipy/lib/lapack/tests/esv_tests.py	2008-11-10 12:35:41 UTC (rev 5036)
@@ -1,4 +1,4 @@
-
+import numpy as np
 from numpy.testing import *
 from numpy import dot
 
@@ -34,7 +34,12 @@
 
     def check_syevr(self,sym='sy'):
         a = [[1,2,3],[2,2,3],[3,3,6]]
-        exact_w = [-0.6699243371851365,0.4876938861533345,9.182230451031804]
+        if self.lapack.prefix == 's':
+            exact_dtype = np.float32
+        else:
+            exact_dtype = np.float
+        exact_w = np.array([-0.6699243371851365, 0.4876938861533345,
+                            9.182230451031804], exact_dtype)
         f = getattr(self.lapack,sym+'evr')
         w,v,info = f(a)
         assert not info,`info`
@@ -56,7 +61,12 @@
 
     def check_syevr_irange(self,sym='sy',irange=[0,2]):
         a = [[1,2,3],[2,2,3],[3,3,6]]
-        exact_w = [-0.6699243371851365,0.4876938861533345,9.182230451031804]
+        if self.lapack.prefix == 's':
+            exact_dtype = np.float32
+        else:
+            exact_dtype = np.float
+        exact_w = np.array([-0.6699243371851365, 0.4876938861533345,
+                            9.182230451031804], exact_dtype)
         f = getattr(self.lapack,sym+'evr')
         w,v,info = f(a,irange=irange)
         assert not info,`info`



More information about the Scipy-svn mailing list