This forum has been archived. All content is frozen. Please use KDE Discuss instead.

sort?

Tags: None
(comma "," separated)
bao
Registered Member
Posts
2
Karma
0

sort?

Tue Jul 20, 2010 2:14 pm
a short question again, is there any function that performs sorting on elements of the matrix?
Zmatt
Registered Member
Posts
27
Karma
0
OS

Re: sort?

Tue Jul 20, 2010 2:25 pm
you can add this function

Code: Select all
EIGEN_STRONG_INLINE void sort(){
   std::sort(derived().data(), derived().data()+size());
}


with the EIGEN_MATRIXBASE_PLUGIN (http://eigen.tuxfamily.org/dox/CustomizingEigen.html) You have to create an file addon.h and add the line #define EIGEN_MATRIXBASE_PLUGIN "addon.h" in a header file.

Then you can use it :
Code: Select all
A.sort();


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]