@@ -9,8 +9,7 @@ copy_input(::Union{typeof(eig_trunc), typeof(eig_trunc_no_error)}, A) = copy_inp
99copy_input (:: typeof (eig_full), A:: Diagonal ) = copy (A)
1010
1111function check_input (:: typeof (eig_full!), A:: AbstractMatrix , DV, :: AbstractAlgorithm )
12- m, n = size (A)
13- m == n || throw (DimensionMismatch (" square input matrix expected" ))
12+ m = LinearAlgebra. checksquare (A)
1413 D, V = DV
1514 @assert D isa Diagonal && V isa AbstractMatrix
1615 @check_size (D, (m, m))
@@ -20,17 +19,16 @@ function check_input(::typeof(eig_full!), A::AbstractMatrix, DV, ::AbstractAlgor
2019 return nothing
2120end
2221function check_input (:: typeof (eig_vals!), A:: AbstractMatrix , D, :: AbstractAlgorithm )
23- m, n = size (A)
24- m == n || throw (DimensionMismatch (" square input matrix expected" ))
22+ m = LinearAlgebra. checksquare (A)
2523 @assert D isa AbstractVector
26- @check_size (D, (n ,))
24+ @check_size (D, (m ,))
2725 @check_scalar (D, A, complex)
2826 return nothing
2927end
3028
3129function check_input (:: typeof (eig_full!), A:: AbstractMatrix , DV, :: DiagonalAlgorithm )
32- m, n = size (A)
33- ((m == n) && isdiag (A) ) || throw (DimensionMismatch (" diagonal input matrix expected" ))
30+ m = LinearAlgebra . checksquare (A)
31+ isdiag (A) || throw (DimensionMismatch (" diagonal input matrix expected" ))
3432 D, V = DV
3533 @assert D isa Diagonal && V isa AbstractMatrix
3634 @check_size (D, (m, m))
@@ -40,10 +38,10 @@ function check_input(::typeof(eig_full!), A::AbstractMatrix, DV, ::DiagonalAlgor
4038 return nothing
4139end
4240function check_input (:: typeof (eig_vals!), A:: AbstractMatrix , D, :: DiagonalAlgorithm )
43- m, n = size (A)
44- ((m == n) && isdiag (A) ) || throw (DimensionMismatch (" diagonal input matrix expected" ))
41+ m = LinearAlgebra . checksquare (A)
42+ isdiag (A) || throw (DimensionMismatch (" diagonal input matrix expected" ))
4543 @assert D isa AbstractVector
46- @check_size (D, (n ,))
44+ @check_size (D, (m ,))
4745 @check_scalar (D, A, complex)
4846 return nothing
4947end
0 commit comments