diff --git a/base/deprecated.jl b/base/deprecated.jl index b9faeb025e9bd1..48d17812143ff4 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -2812,6 +2812,17 @@ end A_mul_Bt(mat::AbstractMatrix, rowvec::RowVector) = *(mat, Transpose(rowvec)) end +# A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/givens.jl, to deprecate +@eval Base.LinAlg begin + A_mul_Bc!(A::AbstractMatrix, R::Rotation) = mul!(A, Adjoint(R)) + A_mul_B!(R::Rotation, A::AbstractMatrix) = mul!(R, A) + A_mul_B!(G::Givens, R::Rotation) = mul!(G, R) + A_mul_Bc!(A::AbstractMatrix, G::Givens) = mul!(A, Adjoint(G)) + A_mul_B!(G::Givens, A::AbstractVecOrMat) = mul!(G, A) + A_mul_B!(G1::Givens, G2::Givens) = mul!(G1, G2) + A_mul_Bc(A::AbstractVecOrMat{T}, R::AbstractRotation{S}) where {T,S} = *(A, Adjoint(R)) +end + # issue #24822 @deprecate_binding Display AbstractDisplay diff --git a/base/linalg/givens.jl b/base/linalg/givens.jl index de621983494d42..ddd637df842b06 100644 --- a/base/linalg/givens.jl +++ b/base/linalg/givens.jl @@ -9,7 +9,8 @@ function *(R::AbstractRotation{T}, A::AbstractVecOrMat{S}) where {T,S} TS = typeof(zero(T)*zero(S) + zero(T)*zero(S)) A_mul_B!(convert(AbstractRotation{TS}, R), TS == S ? copy(A) : convert(AbstractArray{TS}, A)) end -function A_mul_Bc(A::AbstractVecOrMat{T}, R::AbstractRotation{S}) where {T,S} +function *(A::AbstractVecOrMat{T}, adjR::Adjoint{<:Any,<:AbstractRotation{S}}) where {T,S} + R = adjR.parent TS = typeof(zero(T)*zero(S) + zero(T)*zero(S)) A_mul_Bc!(TS == T ? copy(A) : convert(AbstractArray{TS}, A), convert(AbstractRotation{TS}, R)) end @@ -318,9 +319,9 @@ function getindex(G::Givens, i::Integer, j::Integer) end -A_mul_B!(G1::Givens, G2::Givens) = error("Operation not supported. Consider *") +mul!(G1::Givens, G2::Givens) = error("Operation not supported. Consider *") -function A_mul_B!(G::Givens, A::AbstractVecOrMat) +function mul!(G::Givens, A::AbstractVecOrMat) m, n = size(A, 1), size(A, 2) if G.i2 > m throw(DimensionMismatch("column indices for rotation are outside the matrix")) @@ -332,7 +333,8 @@ function A_mul_B!(G::Givens, A::AbstractVecOrMat) end return A end -function A_mul_Bc!(A::AbstractMatrix, G::Givens) +function mul!(A::AbstractMatrix, adjG::Adjoint{<:Any,<:Givens}) + G = adjG.parent m, n = size(A, 1), size(A, 2) if G.i2 > n throw(DimensionMismatch("column indices for rotation are outside the matrix")) @@ -344,17 +346,18 @@ function A_mul_Bc!(A::AbstractMatrix, G::Givens) end return A end -function A_mul_B!(G::Givens, R::Rotation) +function mul!(G::Givens, R::Rotation) push!(R.rotations, G) return R end -function A_mul_B!(R::Rotation, A::AbstractMatrix) +function mul!(R::Rotation, A::AbstractMatrix) @inbounds for i = 1:length(R.rotations) A_mul_B!(R.rotations[i], A) end return A end -function A_mul_Bc!(A::AbstractMatrix, R::Rotation) +function mul!(A::AbstractMatrix, adjR::Adjoint{<:Any,<:Rotation}) + R = adjR.parent @inbounds for i = 1:length(R.rotations) A_mul_Bc!(A, R.rotations[i]) end diff --git a/base/linalg/linalg.jl b/base/linalg/linalg.jl index fb01e70f3c3fc4..3482798b52295b 100644 --- a/base/linalg/linalg.jl +++ b/base/linalg/linalg.jl @@ -238,6 +238,7 @@ function char_uplo(uplo::Symbol) end # shims to maintain existence of names in A_mul_B deprecation process +function A_mul_B! end function Ac_mul_B! end function Ac_mul_B! end function At_mul_B! end