Skip to content

Commit ebaa8b2

Browse files
committed
Test debugging info for CI
1 parent 78d1fc8 commit ebaa8b2

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/eigen.jl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Random.seed!(12343219)
1616
areal = randn(n,n)/2
1717
aimg = randn(n,n)/2
1818

19+
# DEBUGGING INFO
1920
@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int)
2021
aa = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal)
2122
asym = aa' + aa # symmetric indefinite
@@ -24,6 +25,46 @@ aimg = randn(n,n)/2
2425
(view(aa, 1:n, 1:n),
2526
view(asym, 1:n, 1:n),
2627
view(apd, 1:n, 1:n)))
28+
@testset "non-symmetric eigen decomposition" begin
29+
for T in (Hermitian(Tridiagonal(a), :U), Hermitian(Tridiagonal(a), :L))
30+
@info typeof(T)
31+
f = eigen(T)
32+
end
33+
end
34+
@testset "symmetric generalized eigenproblem" begin
35+
if isa(a, Array)
36+
asym_sg = asym[1:n1, 1:n1]
37+
a_sg = a[:,n1+1:n2]
38+
else
39+
asym_sg = view(asym, 1:n1, 1:n1)
40+
a_sg = view(a, 1:n, n1+1:n2)
41+
end
42+
ASG2 = a_sg'a_sg
43+
44+
# matrices of different types (#14896)
45+
D = Diagonal(ASG2)
46+
for uplo in (:L, :U)
47+
gd = eigen(Hermitian(Tridiagonal(ASG2), uplo), D)
48+
@test Hermitian(Tridiagonal(ASG2), uplo) * gd.vectors D * gd.vectors * Diagonal(gd.values)
49+
end
50+
end
51+
end
52+
end
53+
54+
55+
56+
@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int)
57+
@info "eigen.jl"
58+
@info eltya
59+
aa = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal)
60+
@info repr(aa)
61+
asym = aa' + aa # symmetric indefinite
62+
apd = aa' * aa # symmetric positive-definite
63+
for (a, asym, apd) in ((aa, asym, apd),
64+
(view(aa, 1:n, 1:n),
65+
view(asym, 1:n, 1:n),
66+
view(apd, 1:n, 1:n)))
67+
@info typeof(a)
2768
ε = εa = eps(abs(float(one(eltya))))
2869

2970
α = rand(eltya)
@@ -33,6 +74,7 @@ aimg = randn(n,n)/2
3374
@test eab.vectors == eigvecs(fill(α,1,1),fill(β,1,1))
3475

3576
@testset "non-symmetric eigen decomposition" begin
77+
@info "non-symmetric eigen decomposition"
3678
d, v = eigen(a)
3779
for i in 1:size(a,2)
3880
@test a*v[:,i] d[i]*v[:,i]
@@ -46,6 +88,7 @@ aimg = randn(n,n)/2
4688
@test Array(f) a
4789

4890
for T in (Tridiagonal(a), Hermitian(Tridiagonal(a), :U), Hermitian(Tridiagonal(a), :L))
91+
@info T
4992
f = eigen(T)
5093
d, v = f
5194
for i in 1:size(a,2)
@@ -65,6 +108,7 @@ aimg = randn(n,n)/2
65108
@test_throws DomainError eigmax(a - a')
66109
end
67110
@testset "symmetric generalized eigenproblem" begin
111+
@info "symmetric generalized eigenproblem"
68112
if isa(a, Array)
69113
asym_sg = asym[1:n1, 1:n1]
70114
a_sg = a[:,n1+1:n2]
@@ -100,6 +144,7 @@ aimg = randn(n,n)/2
100144
# matrices of different types (#14896)
101145
D = Diagonal(ASG2)
102146
for uplo in (:L, :U)
147+
@info uplo
103148
if eltya <: Real
104149
fs = eigen(Symmetric(asym_sg, uplo), ASG2)
105150
@test fs.values f.values

0 commit comments

Comments
 (0)