I think that it would be good to have samplers in the random package. One reasonable one would be InverseCumulativeSampler.
Another would be something like RecursiveLookupTableDiscreteSampler The generic nextSample routine could call the most generic sampler we have. I would guess that would start with InverseCumulativeSampler and for discrete distributions it might use a slightly more clever sampler that switches from InverseCumulativeSampler to something more advanced after being called a few times (that being the clue that some setup time would be reasonable). On Mon, Nov 2, 2009 at 1:06 PM, Mikkel Meyer Andersen <m...@mikl.dk> wrote: > Another way of implementing the functionality is to call some > nextSample(Abstract{Continuous, Discrete}Distribution) in the Random > package from the Distribution-classes > -- Ted Dunning, CTO DeepDyve