@@ -8,21 +8,35 @@ using MatrixAlgebraKit: diagview
88@testset " eig_full! for T = $T " for T in (Float32, Float64, ComplexF32, ComplexF64)
99 rng = StableRNG(123 )
1010 m = 54
11- for alg in (LAPACK_Simple(), LAPACK_Expert())
11+ for alg in
12+ (LAPACK_Simple(), LAPACK_Expert(), LAPACK_Simple, LAPACK_Expert, :LAPACK_Simple,
13+ :LAPACK_Expert)
1214 A = randn(rng, T, m, m)
1315 Tc = complex(T)
1416
15- D, V = @constinferred eig_full(A; alg)
17+ alg′ = if (alg isa Type) || (alg isa Symbol)
18+ # These cases aren't inferable right now.
19+ MatrixAlgebraKit. select_algorithm(eig_full!, A; alg)
20+ else
21+ @constinferred MatrixAlgebraKit. select_algorithm(eig_full!, A; alg)
22+ end
23+
24+ D, V = if (alg isa Type) || (alg isa Symbol)
25+ # These cases aren't inferable right now.
26+ eig_full(A; alg)
27+ else
28+ @constinferred eig_full(A; alg)
29+ end
1630 @test eltype(D) == eltype(V) == Tc
1731 @test A * V ≈ V * D
1832
1933 Ac = similar(A)
20- D2, V2 = @constinferred eig_full!(copy!(Ac, A), (D, V), alg)
34+ D2, V2 = @constinferred eig_full!(copy!(Ac, A), (D, V), alg′ )
2135 @test D2 === D
2236 @test V2 === V
2337 @test A * V ≈ V * D
2438
25- Dc = @constinferred eig_vals(A, alg)
39+ Dc = @constinferred eig_vals(A, alg′ )
2640 @test eltype(Dc) == Tc
2741 @test D ≈ Diagonal(Dc)
2842 end
0 commit comments