
17 Jan
2009
17 Jan
'09
5:32 p.m.
Hi!! I was working with boost::bernoulli_distribution, and needed a generalization which instead of receiving a single probability (and return true/false) would receive N probabilities (adding less than 1) and would return a whole number in the interval [0 N]. It seems that's usually called "categorial distribution" and that could be easily implemented, generalizing boost::bernoulli_distribution. For now, it seems that the workaround, so to say, is to use a uniform [0 1] (boost::uniform_01) and then externally to the distro compare its results with the N probabilities. Thanks a lot to you all. -- Rodolfo Federico Gamarra