mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-21 17:19:36 +08:00

- make vectors use a separate loop unroller, so that copying a row-vector into a col-vector is now possible - add much more documentation - misc improvements
24 lines
412 B
C++
24 lines
412 B
C++
// g++ -O3 -DNDEBUG benchmark.cpp -o benchmark && time ./benchmark
|
|
|
|
#include <Eigen/Core.h>
|
|
|
|
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 < 100000000; a++)
|
|
{
|
|
m = I + 0.00005 * (m + m*m);
|
|
}
|
|
cout << m << endl;
|
|
return 0;
|
|
}
|