Sorting eigenvectors by their eigenvalues (associated sorting)
Posted
by fbrereto
on Stack Overflow
See other posts from Stack Overflow
or by fbrereto
Published on 2010-04-21T21:03:28Z
Indexed on
2010/04/21
21:53 UTC
Read the original article
Hit count: 746
I have an unsorted vector of eigenvalues and a related matrix of eigenvectors. I'd like to sort the columns of the matrix with respect to the sorted set of eigenvalues. (e.g., if eigenvalue[3] moves to eigenvalue[2], I want column 3 of the eigenvector matrix to move over to column 2.)
I know I can sort the eigenvalues in O(N log N)
via std::sort
. Without rolling my own sorting algorithm, how do I make sure the matrix's columns (the associated eigenvectors) follow along with their eigenvalues as the latter are sorted?
© Stack Overflow or respective owner