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