This bugzilla service is closed. All entries have been migrated to
Bug 299 - Sort function for matrices and vectors returning indices as well
Summary: Sort function for matrices and vectors returning indices as well
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: unspecified
Hardware: All All
: --- Unknown
Assignee: Nobody
Depends on:
Reported: 2011-06-16 00:37 UTC by Thomas
Modified: 2019-12-04 10:53 UTC (History)
4 users (show)


Description Thomas 2011-06-16 00:37:56 UTC
It would be extremely useful if Eigen supports sorting a matrix.
Ideally (at least for me), it would have similar functionality as Matlab's sort function:

[SortVal,SortInx] = sort(A, 2, 'descend')
-Input matrix "A"
-Matrix sort direction (rowwise/columnwise)
-Sort ordering (descend/ascend)

And returning:
- SortVal is the sorted version of matrix A
- SortInx are the corresponding indices.
Comment 1 Frank Meier-Dörnberg 2011-06-17 13:00:07 UTC
Side question: 
Is it possible to build the Permutation matrix P (SortVal = P * A) 
from SortInx? If yes, how?
Comment 2 Nobody 2019-12-04 10:53:40 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.