From cce16154a35d3c900ce9176021c62c74cce4ad73 Mon Sep 17 00:00:00 2001 From: Sacha Verweij Date: Wed, 13 Dec 2017 16:25:06 -0800 Subject: [PATCH] Strip defs involving RowVector from base/linalg/symmetric.jl and touch up tests. --- base/deprecated.jl | 10 ++++++++++ base/linalg/symmetric.jl | 10 ---------- test/linalg/symmetric.jl | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index d9ef2d22ab20b..3aba36aa8569d 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -3079,6 +3079,16 @@ end BroadcastStyle(::Type{<:Base.RowVector{T,<:Vector}}) where T = Broadcast.MatrixStyle() end +# methods involving RowVector from base/linalg/symmetric.jl, to deprecate +@eval Base.LinAlg begin + *(A::RowVector, transB::Transpose{<:Any,<:RealHermSymComplexSym}) = A * transB.parent + *(A::RowVector, adjB::Adjoint{<:Any,<:RealHermSymComplexHerm}) = A * adjB.parent + \(A::HermOrSym{<:Any,<:StridedMatrix}, B::RowVector) = invoke(\, Tuple{AbstractMatrix, RowVector}, A, B) + *(A::Adjoint{<:Any,<:RealHermSymComplexHerm}, B::Adjoint{<:Any,<:RowVector}) = A.parent * B + *(A::Adjoint{<:Any,<:RealHermSymComplexHerm}, B::Transpose{<:Any,<:RowVector}) = A.parent * B + *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Adjoint{<:Any,<:RowVector}) = A.parent * B + *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Transpose{<:Any,<:RowVector}) = A.parent * B +end # issue #24822 @deprecate_binding Display AbstractDisplay diff --git a/base/linalg/symmetric.jl b/base/linalg/symmetric.jl index f3f11abfd3e09..d69135729c525 100644 --- a/base/linalg/symmetric.jl +++ b/base/linalg/symmetric.jl @@ -339,9 +339,6 @@ mul!(C::StridedMatrix{T}, A::StridedMatrix{T}, B::Hermitian{T,<:StridedMatrix}) *(adjA::Adjoint{<:Any,<:RealHermSymComplexSym}, adjB::Adjoint{<:Any,<:RealHermSymComplexHerm}) = adjA * adjB.parent *(adjA::Adjoint{<:Any,<:RealHermSymComplexHerm}, adjB::Adjoint{<:Any,<:RealHermSymComplexSym}) = adjA.parent * adjB -# ambiguities with RowVector -*(A::RowVector, transB::Transpose{<:Any,<:RealHermSymComplexSym}) = A * transB.parent -*(A::RowVector, adjB::Adjoint{<:Any,<:RealHermSymComplexHerm}) = A * adjB.parent # ambiguities with AbstractTriangular *(transA::Transpose{<:Any,<:RealHermSymComplexSym}, B::AbstractTriangular) = transA.parent * B *(A::AbstractTriangular, transB::Transpose{<:Any,<:RealHermSymComplexSym}) = A * transB.parent @@ -372,8 +369,6 @@ det(A::Symmetric) = det(factorize(A)) # Bunch-Kaufman solves can not utilize BLAS-3 for multiple right hand sides # so using LU is faster for AbstractMatrix right hand side \(A::HermOrSym{<:Any,<:StridedMatrix}, B::AbstractMatrix) = \(lufact(A), B) -# ambiguity with RowVector -\(A::HermOrSym{<:Any,<:StridedMatrix}, B::RowVector) = invoke(\, Tuple{AbstractMatrix, RowVector}, A, B) function _inv(A::HermOrSym) n = checksquare(A) @@ -759,11 +754,6 @@ end *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Adjoint{<:Any,<:AbstractMatrix}) = A.parent * B *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Transpose{<:Any,<:AbstractVector}) = A.parent * B *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Transpose{<:Any,<:AbstractMatrix}) = A.parent * B -# dismabiguation methods: *(Adj/Trans of RealHermSymComplex{Herm|Sym}, Adj/Trans of RowVector) -*(A::Adjoint{<:Any,<:RealHermSymComplexHerm}, B::Adjoint{<:Any,<:RowVector}) = A.parent * B -*(A::Adjoint{<:Any,<:RealHermSymComplexHerm}, B::Transpose{<:Any,<:RowVector}) = A.parent * B -*(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Adjoint{<:Any,<:RowVector}) = A.parent * B -*(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Transpose{<:Any,<:RowVector}) = A.parent * B # dismabiguation methods: *(Adj/Trans of AbsTri or RealHermSymComplex{Herm|Sym}, Adj/Trans of other) *(A::Adjoint{<:Any,<:AbstractTriangular}, B::Adjoint{<:Any,<:RealHermSymComplexHerm}) = A * B.parent diff --git a/test/linalg/symmetric.jl b/test/linalg/symmetric.jl index 4737084f621e7..67b067260c585 100644 --- a/test/linalg/symmetric.jl +++ b/test/linalg/symmetric.jl @@ -289,13 +289,13 @@ end @testset "linalg binary ops" begin @testset "mat * vec" begin @test Symmetric(asym)*x+y ≈ asym*x+y - # testing fallbacks for RowVector * SymHerm.' + # testing fallbacks for Transpose-vector * SymHerm.' xadj = x.' @test xadj * Symmetric(asym).' ≈ xadj * asym @test x' * Symmetric(asym) ≈ x' * asym @test Hermitian(aherm)*x+y ≈ aherm*x+y - # testing fallbacks for RowVector * SymHerm' + # testing fallbacks for Adjoint-vector * SymHerm' xadj = x' @test x' * Hermitian(aherm) ≈ x' * aherm @test xadj * Hermitian(aherm)' ≈ xadj * aherm