Le 08/10/2014 19:32, Gilles a écrit : >> > [...] > > What do you think of the solution proposed in > https://issues.apache.org/jira/browse/MATH-1158 > ? > > [No hidden RNG, no default RNG, no hidden performance > cost or delayed initialization, similar API, ...]
I may have missed something but it does not really separate the sampling from the distribution: the Sampler instance is an inner class that calls the distribution sample(Rng) method. So this method still exists in the distribution and can be called directly from there (apart from being protected). The good thing is the generator is visible. I think we all agree the generator must be visible, and it already is in the existing constructors. The difference I see between this solution and clearly specifying in documentation what happens when the distribution is built without a generator is that with your solution users can first build the distribution and later on deciding they need to sample from it and then create the sampler as an afterthought. I'm not sure this is worth the change, but I may be mistaken here, I don't use sampling on distributions so may well miss a classical use case. best regards, Luc > > > Regards, > Gilles > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org