Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/implementations/eig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...))
)
20 changes: 10 additions & 10 deletions src/implementations/eigh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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...))
)
4 changes: 2 additions & 2 deletions src/implementations/gen_eig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/implementations/lq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/implementations/orthnull.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/implementations/polar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions src/implementations/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/implementations/schur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions src/implementations/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -376,30 +376,30 @@ 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
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...))
)
2 changes: 1 addition & 1 deletion src/interface/eig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/interface/eigh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading
Loading