source:
pacpussensors/trunk/Vislab/lib3dv/eigen/bench/bench_sum.cpp@
140
Last change on this file since 140 was 136, checked in by , 8 years ago | |
---|---|
File size: 320 bytes |
Line | |
---|---|
1 | #include <iostream> |
2 | #include <Eigen/Core> |
3 | using namespace Eigen; |
4 | using namespace std; |
5 | |
6 | int main() |
7 | { |
8 | typedef Matrix<SCALAR,Eigen::Dynamic,1> Vec; |
9 | Vec v(SIZE); |
10 | v.setZero(); |
11 | v[0] = 1; |
12 | v[1] = 2; |
13 | for(int i = 0; i < 1000000; i++) |
14 | { |
15 | v.coeffRef(0) += v.sum() * SCALAR(1e-20); |
16 | } |
17 | cout << v.sum() << endl; |
18 | } |
Note:
See TracBrowser
for help on using the repository browser.