benchmarkX.cpp
Go to the documentation of this file.
00001 // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
00002 
00003 #include <iostream>
00004 
00005 #include <Eigen/Core>
00006 
00007 using namespace std;
00008 using namespace Eigen;
00009 
00010 #ifndef MATTYPE
00011 #define MATTYPE MatrixXLd
00012 #endif
00013 
00014 #ifndef MATSIZE
00015 #define MATSIZE 400
00016 #endif
00017 
00018 #ifndef REPEAT
00019 #define REPEAT 100
00020 #endif
00021 
00022 int main(int argc, char *argv[])
00023 {
00024         MATTYPE I = MATTYPE::Ones(MATSIZE,MATSIZE);
00025         MATTYPE m(MATSIZE,MATSIZE);
00026         for(int i = 0; i < MATSIZE; i++) for(int j = 0; j < MATSIZE; j++)
00027         {
00028                 m(i,j) = (i+j+1)/(MATSIZE*MATSIZE);
00029         }
00030         for(int a = 0; a < REPEAT; a++)
00031         {
00032                 m = I + 0.0001 * (m + m*m);
00033         }
00034         cout << m(0,0) << endl;
00035         return 0;
00036 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:47