Why no `sin(x::Eigen)`?

I noticed that LinearAlgebra defines inv(A::Eigen), but only few other functions that that accept Eigen as inputs. It seems like it would be easy and sensible enough to define

for f in (:exp, :cis, :log, :sqrt,
          :cos, :sin, :tan, :csc, :sec, :cot,
          :cosh, :sinh, :tanh, :csch, :sech, :coth,
          :acos, :asin, :atan, :acsc, :asec, :acot,
          :acosh, :asinh, :atanh, :acsch, :asech, :acoth)
    @eval function $f(A::Eigen)
        A.vectors * $f(Diagonal(A.values)) / A.vectors
    end
end

to get all these functions supported for Eigen objects too. Is there a good reason this is not in Base?

There is an open PR to add that (and various other matrix functions): JuliaLang/julia#48549.

3 Likes

Fantastic, I will show my support for it then!