Skip to content

Commit 84b1fe0

Browse files
author
Katharine Hyatt
committed
More tests
1 parent dc74d7a commit 84b1fe0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/MatrixAlgebraKit.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export eigh_full, eigh_vals, eigh_trunc
1919
export eigh_full!, eigh_vals!, eigh_trunc!
2020
export eig_full, eig_vals, eig_trunc
2121
export eig_full!, eig_vals!, eig_trunc!
22+
export gen_eig, gen_eig!
2223
export gen_eig_full, gen_eig_vals
2324
export gen_eig_full!, gen_eig_vals!
2425
export schur_full, schur_vals

test/gen_eig.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using LinearAlgebra: Diagonal
1414
B_init = copy(B)
1515
Tc = complex(T)
1616

17-
W, V = @constinferred gen_eig_full(A, B; alg=($alg))
17+
W, V = @constinferred gen_eig(A, B; alg=($alg))
1818
@test eltype(W) == eltype(V) == Tc
1919
@test A_init == A
2020
@test B_init == B
@@ -24,7 +24,7 @@ using LinearAlgebra: Diagonal
2424

2525
Ac = similar(A)
2626
Bc = similar(B)
27-
W2, V2 = @constinferred gen_eig_full!(copy!(Ac, A), copy!(Bc, B), (W, V), alg′)
27+
W2, V2 = @constinferred gen_eig!(copy!(Ac, A), copy!(Bc, B), (W, V), alg′)
2828
@test W2 === W
2929
@test V2 === V
3030
@test A * V B * V * Diagonal(W)
@@ -51,4 +51,12 @@ using LinearAlgebra: Diagonal
5151
# a tuple of the input types is passed to `default_algorithm`
5252
@test_throws MethodError MatrixAlgebraKit.default_algorithm(gen_eig_full, A, B)
5353
@test_throws MethodError MatrixAlgebraKit.default_algorithm(gen_eig_vals, A, B)
54+
if T <: Real
55+
# Float16 isn't supported
56+
Afp16 = Float16.(A)
57+
Bfp16 = Float16.(B)
58+
@test_throws MethodError MatrixAlgebraKit.default_algorithm(gen_eig_full, (Afp16, Bfp16))
59+
@test_throws MethodError MatrixAlgebraKit.default_gen_eig_algorithm(Afp16, Bfp16)
60+
end
5461
end
62+

0 commit comments

Comments
 (0)