diff --git a/base/deprecated.jl b/base/deprecated.jl index 6b3360200814d..0bac394c53cef 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -790,4 +790,9 @@ function delete!(::EnvHash, k::AbstractString, def) haskey(ENV,k) ? delete!(ENV,k) : def end +@deprecate (+)(J::UniformScaling, x::Number) J.λ + x +@deprecate (+)(x::Number, J::UniformScaling) x + J.λ +@deprecate (-)(J::UniformScaling, x::Number) J.λ - x +@deprecate (-)(x::Number, J::UniformScaling) x - J.λ + # End deprecations scheduled for 0.6 diff --git a/base/linalg/uniformscaling.jl b/base/linalg/uniformscaling.jl index 91098a08da173..f2fce351438a8 100644 --- a/base/linalg/uniformscaling.jl +++ b/base/linalg/uniformscaling.jl @@ -38,15 +38,11 @@ ishermitian(J::UniformScaling) = isreal(J.λ) (+){T}(B::BitArray{2},J::UniformScaling{T}) = Array(B) + J (+)(J::UniformScaling, B::BitArray{2}) = J + Array(B) (+)(J::UniformScaling, A::AbstractMatrix) = A + J -(+)(J::UniformScaling, x::Number) = J.λ + x -(+)(x::Number, J::UniformScaling) = x + J.λ (-)(J::UniformScaling) = UniformScaling(-J.λ) (-)(J1::UniformScaling, J2::UniformScaling) = UniformScaling(J1.λ-J2.λ) (-)(B::BitArray{2}, J::UniformScaling) = Array(B) - J (-)(J::UniformScaling, B::BitArray{2}) = J - Array(B) -(-)(J::UniformScaling, x::Number) = J.λ - x -(-)(x::Number, J::UniformScaling) = x - J.λ for (t1, t2) in ((:UnitUpperTriangular, :UpperTriangular), (:UnitLowerTriangular, :LowerTriangular)) diff --git a/test/linalg/uniformscaling.jl b/test/linalg/uniformscaling.jl index 477306c6fc6ba..e82245c941b2b 100644 --- a/test/linalg/uniformscaling.jl +++ b/test/linalg/uniformscaling.jl @@ -26,8 +26,6 @@ srand(123) α = randn() @test α .* UniformScaling(1.0) == UniformScaling(1.0) .* α @test UniformScaling(α)./α == UniformScaling(1.0) -@test α + UniformScaling(1.0) == UniformScaling(1.0) + α -@test α - UniformScaling(1.0) == -(UniformScaling(1.0) - α) @test copy(UniformScaling(one(Float64))) == UniformScaling(one(Float64)) @test sprint(show,UniformScaling(one(Float32))) == "UniformScaling{Float32}\n1.0*I"