benchmarkXcwise.cpp
Go to the documentation of this file.
1 // g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX
2 
3 #include <iostream>
4 #include <Eigen/Core>
5 
6 using namespace std;
7 using namespace Eigen;
8 
9 #ifndef VECTYPE
10 #define VECTYPE VectorXLd
11 #endif
12 
13 #ifndef VECSIZE
14 #define VECSIZE 1000000
15 #endif
16 
17 #ifndef REPEAT
18 #define REPEAT 1000
19 #endif
20 
21 int main(int argc, char *argv[])
22 {
23  VECTYPE I = VECTYPE::Ones(VECSIZE);
24  VECTYPE m(VECSIZE,1);
25  for(int i = 0; i < VECSIZE; i++)
26  {
27  m[i] = 0.1 * i/VECSIZE;
28  }
29  for(int a = 0; a < REPEAT; a++)
30  {
31  m = VECTYPE::Ones(VECSIZE) + 0.00005 * (m.cwise().square() + m/4);
32  }
33  cout << m[0] << endl;
34  return 0;
35 }
Matrix3f m
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Definition: Half.h:150
Array33i a
#define REPEAT
#define VECSIZE
static const Matrix I
Definition: lago.cpp:35
#define VECTYPE
int main(int argc, char *argv[])


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:42