[Numpy-svn] r2937 - in trunk/numpy: core/tests linalg

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Jul 31 18:23:15 EDT 2006


Author: oliphant
Date: 2006-07-31 17:23:12 -0500 (Mon, 31 Jul 2006)
New Revision: 2937

Modified:
   trunk/numpy/core/tests/test_umath.py
   trunk/numpy/linalg/linalg.py
Log:
Revert change and add better test for umath

Modified: trunk/numpy/core/tests/test_umath.py
===================================================================
--- trunk/numpy/core/tests/test_umath.py	2006-07-31 22:05:49 UTC (rev 2936)
+++ trunk/numpy/core/tests/test_umath.py	2006-07-31 22:23:12 UTC (rev 2937)
@@ -172,7 +172,9 @@
                       'log10']
     def test_it(self):
         for fun in self.funcs:
-            assert_almost_equal(fun(self.x),fun(self.z).real)
+            cr = fun(self.z)
+            assert_almost_equal(fun(self.x),cr.real)
+            assert_almost_equal(0, cr.imag)
 
 class test_choose(NumpyTestCase):
     def test_attributes(self):

Modified: trunk/numpy/linalg/linalg.py
===================================================================
--- trunk/numpy/linalg/linalg.py	2006-07-31 22:05:49 UTC (rev 2936)
+++ trunk/numpy/linalg/linalg.py	2006-07-31 22:23:12 UTC (rev 2937)
@@ -430,7 +430,7 @@
         work = zeros((lwork,), t)
         results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,
                                  work, -1, iwork, 0)
-        lwork = int(work[0])
+        lwork = int(abs(work[0]))
         if option == 'N' and lwork==1:
             # there seems to be a bug in dgesdd of lapack
             #   (NNemec, 060310)




More information about the Numpy-svn mailing list