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)
- SortVal is the sorted version of matrix A
- SortInx are the corresponding indices.
Is it possible to build the Permutation matrix P (SortVal = P * A)
from SortInx? If yes, how?