// g++ -O3 -DNDEBUG -DMATSIZE= benchmark.cpp -o benchmark && time ./benchmark #include #include #ifndef MATSIZE #define MATSIZE 3 #endif using namespace std; using namespace StormEigen; #ifndef REPEAT #define REPEAT 40000000 #endif #ifndef SCALAR #define SCALAR double #endif int main(int argc, char *argv[]) { Matrix I = Matrix::Ones(); Matrix m; for(int i = 0; i < MATSIZE; i++) for(int j = 0; j < MATSIZE; j++) { m(i,j) = (i+MATSIZE*j); } asm("#begin"); for(int a = 0; a < REPEAT; a++) { m = Matrix::Ones() + 0.00005 * (m + (m*m)); } asm("#end"); cout << m << endl; return 0; }