From 93eb449e5ec920b6241231c79023b019a5caaba4 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 23 Mar 2026 11:43:27 -0400 Subject: [PATCH 1/4] correct `SubArray` dispatch signatures --- src/interface/eig.jl | 2 +- src/interface/eigh.jl | 2 +- src/interface/lq.jl | 2 +- src/interface/qr.jl | 2 +- src/interface/svd.jl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interface/eig.jl b/src/interface/eig.jl index f59b2d283..0b8f79ca6 100644 --- a/src/interface/eig.jl +++ b/src/interface/eig.jl @@ -170,7 +170,7 @@ end function default_eig_algorithm(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} return default_eig_algorithm(A) end -function default_eig_algorithm(::Type{SubArray{T, N, A}}) where {T, N, A} +function default_eig_algorithm(::Type{<:SubArray{T, N, A}}) where {T, N, A} return default_eig_algorithm(A) end diff --git a/src/interface/eigh.jl b/src/interface/eigh.jl index a7e810d9b..abbc512e6 100644 --- a/src/interface/eigh.jl +++ b/src/interface/eigh.jl @@ -176,7 +176,7 @@ end function default_eigh_algorithm(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} return default_eigh_algorithm(A) end -function default_eigh_algorithm(::Type{SubArray{T, N, A}}) where {T, N, A} +function default_eigh_algorithm(::Type{<:SubArray{T, N, A}}) where {T, N, A} return default_eigh_algorithm(A) end diff --git a/src/interface/lq.jl b/src/interface/lq.jl index 9521e5ed3..8542fb257 100644 --- a/src/interface/lq.jl +++ b/src/interface/lq.jl @@ -77,7 +77,7 @@ default_lq_algorithm(::Type{T}; kwargs...) where {T <: Diagonal} = DiagonalAlgorithm(; kwargs...) default_lq_algorithm(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} = default_lq_algorithm(A) -default_lq_algorithm(::Type{SubArray{T, N, A}}) where {T, N, A} = +default_lq_algorithm(::Type{<:SubArray{T, N, A}}) where {T, N, A} = default_lq_algorithm(A) for f in (:lq_full!, :lq_compact!, :lq_null!) diff --git a/src/interface/qr.jl b/src/interface/qr.jl index df8ae20e3..6aaa73bab 100644 --- a/src/interface/qr.jl +++ b/src/interface/qr.jl @@ -77,7 +77,7 @@ default_qr_algorithm(::Type{T}; kwargs...) where {T <: Diagonal} = DiagonalAlgorithm(; kwargs...) default_qr_algorithm(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} = default_qr_algorithm(A) -default_qr_algorithm(::Type{SubArray{T, N, A}}) where {T, N, A} = +default_qr_algorithm(::Type{<:SubArray{T, N, A}}) where {T, N, A} = default_qr_algorithm(A) for f in (:qr_full!, :qr_compact!, :qr_null!) diff --git a/src/interface/svd.jl b/src/interface/svd.jl index 3c99eea3a..7f55e443f 100644 --- a/src/interface/svd.jl +++ b/src/interface/svd.jl @@ -168,7 +168,7 @@ end function default_svd_algorithm(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} return default_svd_algorithm(A) end -function default_svd_algorithm(::Type{SubArray{T, N, A}}) where {T, N, A} +function default_svd_algorithm(::Type{<:SubArray{T, N, A}}) where {T, N, A} return default_svd_algorithm(A) end From 7691adff1c1720b654ee3f91ccfcc65c018fd56f Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 23 Mar 2026 12:02:35 -0400 Subject: [PATCH 2/4] defaultalgorithm with AbstractMatrix --- src/implementations/eig.jl | 4 ++-- src/implementations/eigh.jl | 4 ++-- src/implementations/gen_eig.jl | 4 ++-- src/implementations/lq.jl | 4 ++-- src/implementations/orthnull.jl | 4 ++-- src/implementations/polar.jl | 4 ++-- src/implementations/qr.jl | 4 ++-- src/implementations/schur.jl | 4 ++-- src/implementations/svd.jl | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/implementations/eig.jl b/src/implementations/eig.jl index 65fe5a759..91a4b5de4 100644 --- a/src/implementations/eig.jl +++ b/src/implementations/eig.jl @@ -79,10 +79,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:eig_full!, :eig_vals!, :eig_trunc!, :eig_trunc_no_error!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/eigh.jl b/src/implementations/eigh.jl index bfe8df216..9f876b409 100644 --- a/src/implementations/eigh.jl +++ b/src/implementations/eigh.jl @@ -87,10 +87,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:eigh_full!, :eigh_vals!, :eigh_trunc!, :eigh_trunc_no_error!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/gen_eig.jl b/src/implementations/gen_eig.jl index ba00c6fe0..7a33addf2 100644 --- a/src/implementations/gen_eig.jl +++ b/src/implementations/gen_eig.jl @@ -49,10 +49,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:gen_eig_full!, :gen_eig_vals!) - @eval function $f!(A, B, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, B::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, B, select_algorithm($f!, (A, B), nothing; alg.kwargs...)) end - @eval function $f!(A, B, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, B::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, B, out, select_algorithm($f!, (A, B), nothing; alg.kwargs...)) end end diff --git a/src/implementations/lq.jl b/src/implementations/lq.jl index dbfcdcb39..4b6dfd8cd 100644 --- a/src/implementations/lq.jl +++ b/src/implementations/lq.jl @@ -89,10 +89,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:lq_full!, :lq_compact!, :lq_null!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/orthnull.jl b/src/implementations/orthnull.jl index e9eb522c0..1a7f88835 100644 --- a/src/implementations/orthnull.jl +++ b/src/implementations/orthnull.jl @@ -66,10 +66,10 @@ initialize_output(::typeof(right_null!), A, alg::RightNullViaSVD) = nothing # DefaultAlgorithm intercepts # --------------------------- for f! in (:left_orth!, :right_orth!, :left_null!, :right_null!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/polar.jl b/src/implementations/polar.jl index 1cfdbda94..eb9b21d43 100644 --- a/src/implementations/polar.jl +++ b/src/implementations/polar.jl @@ -46,10 +46,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:left_polar!, :right_polar!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/qr.jl b/src/implementations/qr.jl index e490724cd..374c24bc7 100644 --- a/src/implementations/qr.jl +++ b/src/implementations/qr.jl @@ -89,10 +89,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:qr_full!, :qr_compact!, :qr_null!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/schur.jl b/src/implementations/schur.jl index 6a12e754b..63f4d5eb8 100644 --- a/src/implementations/schur.jl +++ b/src/implementations/schur.jl @@ -41,10 +41,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:schur_full!, :schur_vals!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end diff --git a/src/implementations/svd.jl b/src/implementations/svd.jl index 1a1f2e34b..b01c15748 100644 --- a/src/implementations/svd.jl +++ b/src/implementations/svd.jl @@ -108,10 +108,10 @@ end # DefaultAlgorithm intercepts # --------------------------- for f! in (:svd_full!, :svd_compact!, :svd_vals!, :svd_trunc!, :svd_trunc_no_error!) - @eval function $f!(A, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, alg::DefaultAlgorithm) return $f!(A, select_algorithm($f!, A, nothing; alg.kwargs...)) end - @eval function $f!(A, out, alg::DefaultAlgorithm) + @eval function $f!(A::AbstractMatrix, out, alg::DefaultAlgorithm) return $f!(A, out, select_algorithm($f!, A, nothing; alg.kwargs...)) end end From a0931e7ebfcfc9c4cc524afb5f46a291a6ef0c4e Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 23 Mar 2026 12:02:48 -0400 Subject: [PATCH 3/4] default LQ/QR algorithms for Vector --- src/interface/lq.jl | 2 +- src/interface/qr.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface/lq.jl b/src/interface/lq.jl index 8542fb257..1a805d6ac 100644 --- a/src/interface/lq.jl +++ b/src/interface/lq.jl @@ -71,7 +71,7 @@ See also [`qr_full(!)`](@ref lq_full) and [`qr_compact(!)`](@ref lq_compact). default_lq_algorithm(A; kwargs...) = default_lq_algorithm(typeof(A); kwargs...) default_lq_algorithm(T::Type; kwargs...) = throw(MethodError(default_lq_algorithm, (T,))) -default_lq_algorithm(::Type{T}; kwargs...) where {T <: AbstractMatrix} = +default_lq_algorithm(::Type{T}; kwargs...) where {T <: Union{AbstractVector, AbstractMatrix}} = Householder(; kwargs...) default_lq_algorithm(::Type{T}; kwargs...) where {T <: Diagonal} = DiagonalAlgorithm(; kwargs...) diff --git a/src/interface/qr.jl b/src/interface/qr.jl index 6aaa73bab..7ea5f1f41 100644 --- a/src/interface/qr.jl +++ b/src/interface/qr.jl @@ -71,7 +71,7 @@ See also [`lq_full(!)`](@ref lq_full) and [`lq_compact(!)`](@ref lq_compact). default_qr_algorithm(A; kwargs...) = default_qr_algorithm(typeof(A); kwargs...) default_qr_algorithm(T::Type; kwargs...) = throw(MethodError(default_qr_algorithm, (T,))) -default_qr_algorithm(::Type{T}; kwargs...) where {T <: AbstractMatrix} = +default_qr_algorithm(::Type{T}; kwargs...) where {T <: Union{AbstractVector, AbstractMatrix}} = Householder(; kwargs...) default_qr_algorithm(::Type{T}; kwargs...) where {T <: Diagonal} = DiagonalAlgorithm(; kwargs...) From 64d1fbec913aa617bba9c6a456487c6adfc9cc7d Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 23 Mar 2026 12:02:59 -0400 Subject: [PATCH 4/4] consistent AbstractMatrix annotations --- src/implementations/eig.jl | 8 ++++---- src/implementations/eigh.jl | 16 ++++++++-------- src/implementations/lq.jl | 12 ++++++------ src/implementations/qr.jl | 18 +++++++++--------- src/implementations/schur.jl | 4 ++-- src/implementations/svd.jl | 24 ++++++++++++------------ 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/implementations/eig.jl b/src/implementations/eig.jl index 91a4b5de4..8b09d7ad3 100644 --- a/src/implementations/eig.jl +++ b/src/implementations/eig.jl @@ -190,20 +190,20 @@ end for lapack_algtype in (:LAPACK_Simple, :LAPACK_Expert) @eval begin Base.@deprecate( - eig_full!(A, DV, alg::$lapack_algtype), + eig_full!(A::AbstractMatrix, DV, alg::$lapack_algtype), eig_full!(A, DV, QRIteration(; alg.kwargs...)) ) Base.@deprecate( - eig_vals!(A, D, alg::$lapack_algtype), + eig_vals!(A::AbstractMatrix, D, alg::$lapack_algtype), eig_vals!(A, D, QRIteration(; alg.kwargs...)) ) end end Base.@deprecate( - eig_full!(A, DV, alg::CUSOLVER_Simple), + eig_full!(A::AbstractMatrix, DV, alg::CUSOLVER_Simple), eig_full!(A, DV, QRIteration(; driver = CUSOLVER(), alg.kwargs...)) ) Base.@deprecate( - eig_vals!(A, D, alg::CUSOLVER_Simple), + eig_vals!(A::AbstractMatrix, D, alg::CUSOLVER_Simple), eig_vals!(A, D, QRIteration(; driver = CUSOLVER(), alg.kwargs...)) ) diff --git a/src/implementations/eigh.jl b/src/implementations/eigh.jl index 9f876b409..ac7af8da3 100644 --- a/src/implementations/eigh.jl +++ b/src/implementations/eigh.jl @@ -208,22 +208,22 @@ end # Deprecations # ------------ Base.@deprecate( - eigh_full!(A, DV, alg::LAPACK_MultipleRelativelyRobustRepresentations), + eigh_full!(A::AbstractMatrix, DV, alg::LAPACK_MultipleRelativelyRobustRepresentations), eigh_full!(A, DV, RobustRepresentations(; driver = LAPACK(), alg.kwargs...)) ) Base.@deprecate( - eigh_vals!(A, D, alg::LAPACK_MultipleRelativelyRobustRepresentations), + eigh_vals!(A::AbstractMatrix, D, alg::LAPACK_MultipleRelativelyRobustRepresentations), eigh_vals!(A, D, RobustRepresentations(; driver = LAPACK(), alg.kwargs...)) ) for algtype in (:DivideAndConquer, :QRIteration, :Bisection) lapack_algtype = Symbol(:LAPACK_, algtype) @eval begin Base.@deprecate( - eigh_full!(A, DV, alg::$lapack_algtype), + eigh_full!(A::AbstractMatrix, DV, alg::$lapack_algtype), eigh_full!(A, DV, $algtype(; driver = LAPACK(), alg.kwargs...)) ) Base.@deprecate( - eigh_vals!(A, D, alg::$lapack_algtype), + eigh_vals!(A::AbstractMatrix, D, alg::$lapack_algtype), eigh_vals!(A, D, $algtype(; driver = LAPACK(), alg.kwargs...)) ) end @@ -238,20 +238,20 @@ for (algtype, newtype, drivertype) in ( ) @eval begin Base.@deprecate( - eigh_full!(A, DV, alg::$algtype), + eigh_full!(A::AbstractMatrix, DV, alg::$algtype), eigh_full!(A, DV, $newtype(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - eigh_vals!(A, D, alg::$algtype), + eigh_vals!(A::AbstractMatrix, D, alg::$algtype), eigh_vals!(A, D, $newtype(; driver = $drivertype(), alg.kwargs...)) ) end end Base.@deprecate( - eigh_full!(A, DV, alg::GLA_QRIteration), + eigh_full!(A::AbstractMatrix, DV, alg::GLA_QRIteration), eigh_full!(A, DV, QRIteration(; driver = GLA(), alg.kwargs...)) ) Base.@deprecate( - eigh_vals!(A, D, alg::GLA_QRIteration), + eigh_vals!(A::AbstractMatrix, D, alg::GLA_QRIteration), eigh_vals!(A, D, QRIteration(; driver = GLA(), alg.kwargs...)) ) diff --git a/src/implementations/lq.jl b/src/implementations/lq.jl index 4b6dfd8cd..ce6819c6f 100644 --- a/src/implementations/lq.jl +++ b/src/implementations/lq.jl @@ -103,15 +103,15 @@ end # Householder # ----------- -function lq_full!(A, LQ, alg::Householder) +function lq_full!(A::AbstractMatrix, LQ, alg::Householder) check_input(lq_full!, A, LQ, alg) return lq_householder!(A, LQ...; alg.kwargs...) end -function lq_compact!(A, LQ, alg::Householder) +function lq_compact!(A::AbstractMatrix, LQ, alg::Householder) check_input(lq_compact!, A, LQ, alg) return lq_householder!(A, LQ...; alg.kwargs...) end -function lq_null!(A, Nᴴ, alg::Householder) +function lq_null!(A::AbstractMatrix, Nᴴ, alg::Householder) check_input(lq_null!, A, Nᴴ, alg) return lq_null_householder!(A, Nᴴ; alg.kwargs...) end @@ -382,15 +382,15 @@ for drivertype in (:LAPACK, :Native) algtype = Symbol(drivertype, :_HouseholderLQ) @eval begin Base.@deprecate( - lq_full!(A, LQ, alg::$algtype), + lq_full!(A::AbstractMatrix, LQ, alg::$algtype), lq_full!(A, LQ, Householder(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - lq_compact!(A, LQ, alg::$algtype), + lq_compact!(A::AbstractMatrix, LQ, alg::$algtype), lq_compact!(A, LQ, Householder(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - lq_null!(A, Nᴴ, alg::$algtype), + lq_null!(A::AbstractMatrix, Nᴴ, alg::$algtype), lq_null!(A, Nᴴ, Householder(; driver = $drivertype(), alg.kwargs...)) ) end diff --git a/src/implementations/qr.jl b/src/implementations/qr.jl index 374c24bc7..cf6eca329 100644 --- a/src/implementations/qr.jl +++ b/src/implementations/qr.jl @@ -103,15 +103,15 @@ end # Householder # ----------- -function qr_full!(A, QR, alg::Householder) +function qr_full!(A::AbstractMatrix, QR, alg::Householder) check_input(qr_full!, A, QR, alg) return qr_householder!(A, QR...; alg.kwargs...) end -function qr_compact!(A, QR, alg::Householder) +function qr_compact!(A::AbstractMatrix, QR, alg::Householder) check_input(qr_compact!, A, QR, alg) return qr_householder!(A, QR...; alg.kwargs...) end -function qr_null!(A, N, alg::Householder) +function qr_null!(A::AbstractMatrix, N, alg::Householder) check_input(qr_null!, A, N, alg) return qr_null_householder!(A, N; alg.kwargs...) end @@ -324,19 +324,19 @@ end # Diagonal # -------- -function qr_full!(A, QR, alg::DiagonalAlgorithm) +function qr_full!(A::AbstractMatrix, QR, alg::DiagonalAlgorithm) check_input(qr_full!, A, QR, alg) Q, R = QR _diagonal_qr!(A, Q, R; alg.kwargs...) return Q, R end -function qr_compact!(A, QR, alg::DiagonalAlgorithm) +function qr_compact!(A::AbstractMatrix, QR, alg::DiagonalAlgorithm) check_input(qr_compact!, A, QR, alg) Q, R = QR _diagonal_qr!(A, Q, R; alg.kwargs...) return Q, R end -function qr_null!(A, N, alg::DiagonalAlgorithm) +function qr_null!(A::AbstractMatrix, N, alg::DiagonalAlgorithm) check_input(qr_null!, A, N, alg) _diagonal_qr_null!(A, N; alg.kwargs...) return N @@ -367,15 +367,15 @@ for drivertype in (:LAPACK, :CUSOLVER, :ROCSOLVER, :Native, :GLA) algtype = Symbol(drivertype, :_HouseholderQR) @eval begin Base.@deprecate( - qr_full!(A, QR, alg::$algtype), + qr_full!(A::AbstractMatrix, QR, alg::$algtype), qr_full!(A, QR, Householder(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - qr_compact!(A, QR, alg::$algtype), + qr_compact!(A::AbstractMatrix, QR, alg::$algtype), qr_compact!(A, QR, Householder(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - qr_null!(A, N, alg::$algtype), + qr_null!(A::AbstractMatrix, N, alg::$algtype), qr_null!(A, N, Householder(; driver = $drivertype(), alg.kwargs...)) ) end diff --git a/src/implementations/schur.jl b/src/implementations/schur.jl index 63f4d5eb8..18dd2b442 100644 --- a/src/implementations/schur.jl +++ b/src/implementations/schur.jl @@ -105,11 +105,11 @@ end for (lapack_algtype, expert_val) in ((:LAPACK_Simple, false), (:LAPACK_Expert, true)) @eval begin Base.@deprecate( - schur_full!(A, TZv, alg::$lapack_algtype), + schur_full!(A::AbstractMatrix, TZv, alg::$lapack_algtype), schur_full!(A, TZv, QRIteration(; expert = $expert_val, alg.kwargs...)) ) Base.@deprecate( - schur_vals!(A, vals, alg::$lapack_algtype), + schur_vals!(A::AbstractMatrix, vals, alg::$lapack_algtype), schur_vals!(A, vals, QRIteration(; expert = $expert_val, alg.kwargs...)) ) end diff --git a/src/implementations/svd.jl b/src/implementations/svd.jl index b01c15748..cd0b43f75 100644 --- a/src/implementations/svd.jl +++ b/src/implementations/svd.jl @@ -166,15 +166,15 @@ for (f, f_lapack!, Alg) in ( # MatrixAlgebraKit wrappers @eval begin - function svd_compact!(A, USVᴴ, alg::$Alg) + function svd_compact!(A::AbstractMatrix, USVᴴ, alg::$Alg) check_input(svd_compact!, A, USVᴴ, alg) return $svd_compact_f!(A, USVᴴ...; alg.kwargs...) end - function svd_full!(A, USVᴴ, alg::$Alg) + function svd_full!(A::AbstractMatrix, USVᴴ, alg::$Alg) check_input(svd_full!, A, USVᴴ, alg) return $svd_full_f!(A, USVᴴ...; alg.kwargs...) end - function svd_vals!(A, S, alg::$Alg) + function svd_vals!(A::AbstractMatrix, S, alg::$Alg) check_input(svd_vals!, A, S, alg) return $svd_vals_f!(A, S; alg.kwargs...) end @@ -353,15 +353,15 @@ for algtype in (:SafeDivideAndConquer, :DivideAndConquer, :QRIteration, :Jacobi, lapack_algtype = Symbol(:LAPACK_, algtype) @eval begin Base.@deprecate( - svd_compact!(A, USVᴴ, alg::$lapack_algtype), + svd_compact!(A::AbstractMatrix, USVᴴ, alg::$lapack_algtype), svd_compact!(A, USVᴴ, $algtype(; driver = LAPACK(), alg.kwargs...)) ) Base.@deprecate( - svd_full!(A, USVᴴ, alg::$lapack_algtype), + svd_full!(A::AbstractMatrix, USVᴴ, alg::$lapack_algtype), svd_full!(A, USVᴴ, $algtype(; driver = LAPACK(), alg.kwargs...)) ) Base.@deprecate( - svd_vals!(A, S, alg::$lapack_algtype), + svd_vals!(A::AbstractMatrix, S, alg::$lapack_algtype), svd_vals!(A, S, $algtype(; driver = LAPACK(), alg.kwargs...)) ) end @@ -376,15 +376,15 @@ for (algtype, newtype, drivertype) in ( ) @eval begin Base.@deprecate( - svd_compact!(A, USVᴴ, alg::$algtype), + svd_compact!(A::AbstractMatrix, USVᴴ, alg::$algtype), svd_compact!(A, USVᴴ, $newtype(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - svd_full!(A, USVᴴ, alg::$algtype), + svd_full!(A::AbstractMatrix, USVᴴ, alg::$algtype), svd_full!(A, USVᴴ, $newtype(; driver = $drivertype(), alg.kwargs...)) ) Base.@deprecate( - svd_vals!(A, S, alg::$algtype), + svd_vals!(A::AbstractMatrix, S, alg::$algtype), svd_vals!(A, S, $newtype(; driver = $drivertype(), alg.kwargs...)) ) end @@ -392,14 +392,14 @@ end # GLA_QRIteration SVD deprecations (eigh methods remain in the GLA extension) Base.@deprecate( - svd_compact!(A, USVᴴ, alg::GLA_QRIteration), + svd_compact!(A::AbstractMatrix, USVᴴ, alg::GLA_QRIteration), svd_compact!(A, USVᴴ, QRIteration(; driver = GLA(), alg.kwargs...)) ) Base.@deprecate( - svd_full!(A, USVᴴ, alg::GLA_QRIteration), + svd_full!(A::AbstractMatrix, USVᴴ, alg::GLA_QRIteration), svd_full!(A, USVᴴ, QRIteration(; driver = GLA(), alg.kwargs...)) ) Base.@deprecate( - svd_vals!(A, S, alg::GLA_QRIteration), + svd_vals!(A::AbstractMatrix, S, alg::GLA_QRIteration), svd_vals!(A, S, QRIteration(; driver = GLA(), alg.kwargs...)) )