You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
320 B

  1. #include <iostream>
  2. #include <Eigen/Core>
  3. using namespace Eigen;
  4. using namespace std;
  5. int main()
  6. {
  7. typedef Matrix<SCALAR,Eigen::Dynamic,1> Vec;
  8. Vec v(SIZE);
  9. v.setZero();
  10. v[0] = 1;
  11. v[1] = 2;
  12. for(int i = 0; i < 1000000; i++)
  13. {
  14. v.coeffRef(0) += v.sum() * SCALAR(1e-20);
  15. }
  16. cout << v.sum() << endl;
  17. }