New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
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
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 00:37 UTC by Thomas
Modified: 2011-06-17 13:00 UTC (History)
4 users (show)



Attachments

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?

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