I have N eigenvalues in column vector form. Thus there are N eigenvectors corresponding to these eigenvalues, forming an eigenvector matrix.
Now, the problem I am working on requires me to sort the eigenvalues column vector in descending order. How do I sort the eigenvectors matrix in the same order as their eigenvalues in order to preserve correspondence?
Eigensystem
already returns the eigenvalues/vectors sorted in descending order. – SzabolcsEigenvectors
andEigensystem
return vectors that are linearly independent, not orthogonal. This bit me more than once. But, you can useOrthogonalize
on the degenerate set to give you an orthogonal set. – rcollyerOrthogonalize
on the whole set directly as it won't affect the orthogonality of the different subspaces. – rcollyer