summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-09-21 05:23:46 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-09-21 05:23:46 +0000
commit393718f36954c375fba8d9b52b35ee0b0b85173c (patch)
treec5f68300b08341c661a89ebe2ab4b0c8c9693888 /numpy/linalg/tests
parenta4652fbe11726a92b83964e03aab65430305d9b7 (diff)
downloadnumpy-393718f36954c375fba8d9b52b35ee0b0b85173c.tar.gz
Apply patch to fix ticket #557 (pinv causing error with empty arrays)
Diffstat (limited to 'numpy/linalg/tests')
-rw-r--r--numpy/linalg/tests/test_linalg.py11
1 files changed, 10 insertions, 1 deletions
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)