From 393718f36954c375fba8d9b52b35ee0b0b85173c Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Fri, 21 Sep 2007 05:23:46 +0000 Subject: Apply patch to fix ticket #557 (pinv causing error with empty arrays) --- numpy/linalg/tests/test_linalg.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'numpy/linalg/tests') diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py index af7914200..1b380fa12 100644 --- a/numpy/linalg/tests/test_linalg.py +++ b/numpy/linalg/tests/test_linalg.py @@ -4,7 +4,7 @@ from numpy.testing import * set_package_path() from numpy import array, single, double, csingle, cdouble, dot, identity, \ - multiply + multiply, atleast_2d from numpy import linalg restore_path() @@ -37,6 +37,15 @@ class LinalgTestCase(NumpyTestCase): b = array([2.+1j, 1.+2j], dtype=cdouble) self.do(a, b) + def check_empty(self): + a = atleast_2d(array([], dtype = double)) + b = atleast_2d(array([], dtype = double)) + try: + self.do(a, b) + raise AssertionError("%s should fail with empty matrices", self.__name__[5:]) + except linalg.LinAlgError, e: + pass + class test_solve(LinalgTestCase): def do(self, a, b): x = linalg.solve(a, b) -- cgit v1.2.1