From 95e223b3fa09b5e31da37a8870ac42ef21a2453e Mon Sep 17 00:00:00 2001 From: olof3 Date: Wed, 8 Sep 2021 18:24:34 +0200 Subject: [PATCH] bugfix: properly import Base.cis into LinearAlgebra Certain methods, e.g., `cis(::Union{RealHermSymComplexHerm,SymTridiagonal{<:Real}})`, were not imported properly. --- stdlib/LinearAlgebra/src/LinearAlgebra.jl | 2 +- stdlib/LinearAlgebra/src/dense.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 4ac4a142caf07..8c48a9a757959 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -9,7 +9,7 @@ module LinearAlgebra import Base: \, /, *, ^, +, -, == import Base: USE_BLAS64, abs, acos, acosh, acot, acoth, acsc, acsch, adjoint, asec, asech, - asin, asinh, atan, atanh, axes, big, broadcast, ceil, conj, convert, copy, copyto!, cos, + asin, asinh, atan, atanh, axes, big, broadcast, ceil, cis, conj, convert, copy, copyto!, cos, cosh, cot, coth, csc, csch, eltype, exp, fill!, floor, getindex, hcat, getproperty, imag, inv, isapprox, isequal, isone, iszero, IndexStyle, kron, kron!, length, log, map, ndims, oneunit, parent, power_by_squaring, print_matrix, promote_rule, real, round, sec, sech, diff --git a/stdlib/LinearAlgebra/src/dense.jl b/stdlib/LinearAlgebra/src/dense.jl index 14b74097d4438..400562af0118b 100644 --- a/stdlib/LinearAlgebra/src/dense.jl +++ b/stdlib/LinearAlgebra/src/dense.jl @@ -576,8 +576,8 @@ julia> cis([π 0; 0 π]) ≈ -I true ``` """ -Base.cis(A::AbstractMatrix) = exp(im * A) # fallback -Base.cis(A::AbstractMatrix{<:Base.HWNumber}) = exp_maybe_inplace(float.(im .* A)) +cis(A::AbstractMatrix) = exp(im * A) # fallback +cis(A::AbstractMatrix{<:Base.HWNumber}) = exp_maybe_inplace(float.(im .* A)) exp_maybe_inplace(A::StridedMatrix{<:Union{ComplexF32, ComplexF64}}) = exp!(A) exp_maybe_inplace(A) = exp(A)