Files
eigen/doc/benchmarkX.cpp
Gael Guennebaud 138aad0ed0 * coefficient wise operators are more generic, with controllable result type.
- compatible with current STL's functors as well as with the extention proposal (TR1)
 * thanks to the above, Cast and ScalarMultiple have been removed
 * benchmark_suite is more flexible (compiler and matrix size)
2008-03-06 11:36:27 +00:00

23 lines
436 B
C++

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