-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use const generics, try_from_fn for the Dirichlet distribution #8
Comments
This is blocked by the stabilization of minimal const generics. |
Note that we return an array with size dependent on a generic parameter, so I am not sure if minimal const generics will be enough for this. It may be blocked on rust-lang/rust#68436. |
To copy what I wrote in rust-random/rand#485: We now use const generics: Caveat: we currently use Caveat: sometimes arrays of other lengths are required ( Caveat: the above approach does not support run-time variable length Conclusion: we can improve our code once I tried simply copying the code behind |
Right now the Dirichlet distribution allocates inner state and sampled values, even though it can be naturally expressed in terms of arrays and AFAIK is usually used with fixed number of dimensions.
WeightedIndex
also can be expressed in terms of arrays, but in practice number of weights can be not known at compile time. We could introduce a "fixed" variant in addition to the existing "dynamic" one.The text was updated successfully, but these errors were encountered: