eigen/doc/benchmark.cpp
Benoit Jacob e092cbc75c -add set...() methods and their documentation; remove Generic
-use row-major traversal when the number of columns is fixed
 and the number of rows is dynamic
-other minor changes
2008-01-11 15:08:04 +00:00

24 lines
429 B
C++

// g++ -O3 -DNDEBUG benchmark.cpp -o benchmark && time ./benchmark
#include <Eigen/Core>
using namespace std;
USING_PART_OF_NAMESPACE_EIGEN
int main(int argc, char *argv[])
{
Matrix3d I;
Matrix3d m;
for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++)
{
I(i,j) = (i==j);
m(i,j) = (i+3*j);
}
for(int a = 0; a < 400000000; a++)
{
m = Matrix3d::identity() + 0.00005 * (m + m*m);
}
cout << m << endl;
return 0;
}