eigen/doc/special_examples/random_cpp11.cpp
Gael Guennebaud 05a0ee25df Fix warning.
2015-10-29 21:06:07 +01:00

15 lines
348 B
C++

#include <Eigen/Core>
#include <iostream>
#include <random>
using namespace Eigen;
int main() {
std::default_random_engine generator;
std::poisson_distribution<int> distribution(4.1);
auto poisson = [&] (Eigen::Index) {return distribution(generator);};
RowVectorXi v = RowVectorXi::NullaryExpr(10, poisson );
std::cout << v << "\n";
}