Hi, First of all boost::random is very clever and complete, thanks! Using boost::random I found uniform_int distribution not working in my box. I have version 1.33 on a Debian system. This is an example of a program that triggers a non-uniform integer distribution. I'm I doing something wrong? Regards. #include <iostream> #include <string> #include <cstdlib> #include <cassert> #include<vector> #include<stdexcept> #include <boost/random.hpp> #include <limits> using namespace std; int main(int argc, char *argv[]) { boost::mt19937 rng; boost::uniform_int<int64_t> ui(numeric_limits<int64_t>::min(),numeric_limits<int64_t>::max()); boost::variate_generator<boost::mt19937&, boost::uniform_int<int64_t> > rgen(rng, ui); while(true) { cout << rgen() << endl; } } -- Pedro Larroy Tovar, pedro at larroy dot com | http://pedro.larroy.com/ * Las patentes de programación son nocivas para la innovación * http://proinnova.hispalinux.es/
participants (1)
-
boost@larroy.com