-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
#14 argues the importance of a variable-length input Dirichlet distribution. rust-random/rand#1478 proposes a Multinomial distribution.
It is also questionable whether the existing Distribution trait is appropriate for these; it may be preferable to use a distinct trait like:
pub trait MultiDistribution<F> {
fn sample<R: Rng + ?Sized>(&mut self, rng: &mut R, output: &mut [F]);
}Although:
- The above does not support error checking of the length of
output, aside from panic. This may be the most appropriate option anyway, though I would expect at minimum that implementations do assert the length ofoutputis exactly as expected. - There is probably no reason to add this trait over simply adding
pub fn samplemethods to the distribution types.
Questions:
- Should we start a new
rand_multicrate? Or mayberand_distr::multimodule? - Should we add a new
MultiDistributiontrait? Or simply use methods on the distributions without a trait?
Metadata
Metadata
Assignees
Labels
No labels