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.

14 lines
348 B

  1. #include <Eigen/Core>
  2. #include <iostream>
  3. #include <random>
  4. using namespace Eigen;
  5. int main() {
  6. std::default_random_engine generator;
  7. std::poisson_distribution<int> distribution(4.1);
  8. auto poisson = [&] (Eigen::Index) {return distribution(generator);};
  9. RowVectorXi v = RowVectorXi::NullaryExpr(10, poisson );
  10. std::cout << v << "\n";
  11. }