diff options
| author | Eric Wieser <wieser.eric@gmail.com> | 2017-03-24 23:56:07 +0000 |
|---|---|---|
| committer | Eric Wieser <wieser.eric@gmail.com> | 2017-09-12 23:25:04 -0700 |
| commit | bab798db40b1bd8e520fc884fab15fac83174114 (patch) | |
| tree | 8403c8d29e66ce0936d56f9ec4a9b699f501121b /numpy/linalg/tests | |
| parent | 2d66d07330486ebfec287c01f6b57f0d37433c2d (diff) | |
| download | numpy-bab798db40b1bd8e520fc884fab15fac83174114.tar.gz | |
BUG: Fix pinv on matrix stacks
Fixes #8826
Diffstat (limited to 'numpy/linalg/tests')
| -rw-r--r-- | numpy/linalg/tests/test_linalg.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py index ab81fc485..fa20cc5ea 100644 --- a/numpy/linalg/tests/test_linalg.py +++ b/numpy/linalg/tests/test_linalg.py @@ -712,12 +712,16 @@ class TestCondInf(object): assert_almost_equal(linalg.cond(A, inf), 3.) -class TestPinv(LinalgSquareTestCase, LinalgNonsquareTestCase): +class TestPinv(LinalgSquareTestCase, + LinalgNonsquareTestCase, + LinalgGeneralizedSquareTestCase, + LinalgGeneralizedNonsquareTestCase): def do(self, a, b, tags): a_ginv = linalg.pinv(a) # `a @ a_ginv == I` does not hold if a is singular - assert_almost_equal(dot(a, a_ginv).dot(a), a, single_decimal=5, double_decimal=11) + dot = dot_generalized + assert_almost_equal(dot(dot(a, a_ginv), a), a, single_decimal=5, double_decimal=11) assert_(imply(isinstance(a, matrix), isinstance(a_ginv, matrix))) |
