12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include <Eigen/Dense>
- #include <iostream>
- #include <algorithm>
- #include <igl/sort.h>
- #include <igl/unique.h>
- #include <igl/get_seconds.h>
- #include <igl/colon.h>
- #include <igl/slice.h>
- #include <igl/sortrows.h>
- #include <igl/readDMAT.h>
- #include <igl/writeDMAT.h>
- int main(int argc, char * argv[])
- {
- using namespace Eigen;
- using namespace std;
- using namespace igl;
-
-
-
-
-
-
-
-
-
- MatrixXd X(4,2);
-
- X << 1,3,2,4,6,1,7,2;
- cout<<X<<endl<<endl;
- typedef MatrixXi::Scalar Scalar;
- bool ascending = false;
- const int dim = 2;
- double t;
- #define NUM_RUNS 1
- MatrixXd Y;
- VectorXi IA,IC;
- t = get_seconds();
- for(int r = 0;r<NUM_RUNS;r++)
- unique_rows(X,Y,IA,IC);
- cout<<(get_seconds()-t)/(double)NUM_RUNS<<endl;
- t = get_seconds();
- for(int r = 0;r<NUM_RUNS;r++)
- sortrows(X,true,Y,IC);
- cout<<(get_seconds()-t)/(double)NUM_RUNS<<endl;
- writeDMAT("X.dmat",X,true);
- writeDMAT("Y.dmat",Y,true);
- writeDMAT("IC.dmat",IC,true);
-
-
-
- cout<<Y.rows()<<endl;
- }
|