aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/benchmarkX.cpp
blob: 09173e1ed85d54c676b119fc33510bef815b1fa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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 < 100000; a++)
	{
		m = I + 0.00005 * (m + m*m);
	}
	cout << m << endl;
	return 0;
}