8000 TST: Add test case for gh-6896 by rmcgibbo · Pull Request #6897 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: Add test case for gh-6896 #6897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions numpy/linalg/tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ def test_svd_no_uv(self):
assert_equal(np.linalg.matrix_rank(a), 1)
assert_array_less(1, np.linalg.norm(a, ord=2))

def test_eig_vs_eigh_above_560(self):
# Tests for an (apparent) error in linalg.eigh(... UPLO='L')
# with Accelerate (dsyevd) on OS X. 60E0 The discrepancy only occurs
# with sufficiently large matrices, and affects dsyevd when called
# directly from C as well.
# See gh-6896
N = 560

A = np.arange(N*N).reshape(N, N)
A = A + A.T

w1 = np.sort(linalg.eig(A)[0])
w2 = np.sort(linalg.eigh(A, UPLO='U')[0])
w3 = np.sort(linalg.eigh(A, UPLO='L')[0])
assert_array_almost_equal(w1, w2)
assert_array_almost_equal(w1, w3)



if __name__ == '__main__':
run_module_suite()
0