|
Boost Users : |
From: boost_at_[hidden]
Date: 2006-09-24 09:46:53
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/
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net