Closed jecs closed 5 months ago
This would be incompatible with the sortby
kwarg since the return type would have to depend on the value of sortby
then.
Maybe for Diagonal
, using sortby
could return view(one(A),:,p)
where p
is the permutation? Or would this introduce type instability?
Isn't eigenvector calculation type unstable anyway? eigvecs
checks whether the matrix is symmetric (by checking the values in the matrix), and if so, returns a real-valued result. Thus a dependence on a keyword argument shouldn't matter.
julia> A = randn(4,4);
julia> typeof(eigvecs(A))
Matrix{ComplexF64} (alias for Array{Complex{Float64}, 2})
julia> typeof(eigvecs(A+A'))
Matrix{Float64} (alias for Array{Float64, 2})
Hey! Is this issue still active? If the issue persists, I would be happy to work on it and help find a solution as my first open source contribution.
Hi again, I submitted a pull request for this issue. Would love to hear your feedback/suggestions. Link: https://github.com/JuliaLang/julia/pull/54882
Hello. I noticed today that if you have a matrix of
Diagonal
type, then the eigenvector matrix (fromeigvecs
oreigen
) is not of typeDiagonal
. Wouldn't it make more sense for the eigenvectors to match the type of the input matrix, when possible?For example, if I have
A = Diagonal(rand(10))
, theneigvecs(A;kwarg...)
should return aDiagonal
(e.g.one(A)
), buteigvecs(Matrix(A);kwarg...)
should return aMatrix
(e.g.one(Matrix(A))
), and so on. The same changes would be needed foreigen(...)
.