Skip to content

Commit c919e6f

Browse files
committed
More spectral radius tests
1 parent bd690a8 commit c919e6f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/sa_tests.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,19 @@ function test_approximate_spectral_radius()
215215

216216
end
217217

218+
# Symmetric matrices
219+
for A in cases
220+
A = A + A'
221+
E,V = eig(A)
222+
E = abs.(E)
223+
largest_eig = find(E .== maximum(E))[1]
224+
expected_eig = E[largest_eig]
225+
226+
@test isapprox(approximate_spectral_radius(A), expected_eig)
227+
228+
end
229+
230+
# Test poisson matrix
231+
A = poisson(50, 50)
232+
218233
end

0 commit comments

Comments
 (0)