Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
gtsam
3rdparty
Eigen
bench
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
}
m
Matrix3f m
Definition:
AngleAxis_mimic_euler.cpp:1
Eigen
Namespace containing all symbols from the Eigen library.
Definition:
jet.h:637
std
Definition:
Half.h:150
a
Array33i a
Definition:
Cwise_product.cpp:1
REPEAT
#define REPEAT
Definition:
benchmarkXcwise.cpp:18
VECSIZE
#define VECSIZE
Definition:
benchmarkXcwise.cpp:14
gtsam::lago::I
static const Matrix I
Definition:
lago.cpp:35
VECTYPE
#define VECTYPE
Definition:
benchmarkXcwise.cpp:10
main
int main(int argc, char *argv[])
Definition:
benchmarkXcwise.cpp:21
i
int i
Definition:
BiCGSTAB_step_by_step.cpp:9
gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:42