Skip to content

Commit

Permalink
Fix JuliaLang#11089. Robustify eigvals(Symmetric, lv, uv) test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored and mbauman committed Jun 5, 2015
1 parent 2dfc434 commit 9cfc9df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ let n=10
@test isequal(eigvals(asym[1]), eigvals(asym[1:1,1:1]))
@test_approx_eq abs(eigfact(Hermitian(asym), 1:2)[:vectors]'v[:,1:2]) eye(eltya, 2)
eig(Hermitian(asym), 1:2) # same result, but checks that method works
@test_approx_eq abs(eigfact(Hermitian(asym), d[1]-10*eps(d[1]), d[2]+10*eps(d[2]))[:vectors]'v[:,1:2]) eye(eltya, 2)
eig(Hermitian(asym), d[1]-10*eps(d[1]), d[2]+10*eps(d[2])) # same result, but checks that method works
eltya == Float64 && @show d[1:2]
@test_approx_eq abs(eigfact(Hermitian(asym), d[1] - 1, (d[2] + d[3])/2)[:vectors]'v[:,1:2]) eye(eltya, 2)
eig(Hermitian(asym), d[1] - 1, (d[2] + d[3])/2) # same result, but checks that method works
@test_approx_eq eigvals(Hermitian(asym), 1:2) d[1:2]
@test_approx_eq eigvals(Hermitian(asym), d[1]-10*eps(d[1]), d[2]+10*eps(d[2])) d[1:2]
@test_approx_eq eigvals(Hermitian(asym), d[1] - 1, (d[2] + d[3])/2) d[1:2]
@test_approx_eq full(eigfact(asym)) asym

# relation to svdvals
Expand Down

0 comments on commit 9cfc9df

Please sign in to comment.