Registered Member
|
Is there an answer to sort a matrix itself by specific row as follows?
MATLAB example:
Eigen example:
Can you help me?
Last edited by clockdate on Sat Jan 19, 2013 10:29 am, edited 2 times in total.
|
Registered Member
|
You can achieve that using a custom comparator for std::sort:
(Note that, to keep things simple, I used int instead of typename Derived::Index for the index data type.) columnArgSort returns "order", the vector of indexes that would sort the columns; the loop uses those to copy the columns in the correct order. Output:
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]