-
Notifications
You must be signed in to change notification settings - Fork 432
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 in Dirichlet #1292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good change.
Add a note to the CHANGELOG please.
448057c
to
34bd7ef
Compare
34bd7ef
to
a16b932
Compare
|
The crate doesn't appear that well maintained. I'm guessing testing Perhaps an alternative is to serialise the array as a slice? |
No, in the current state of the PR, this testing configuration succeeds.
Sure, I can try that. |
a215a76
to
80b198d
Compare
I found another crate which looks much more active: I think that serializing as a slice would require to write our own serializing/deserializing code, right? |
This looks okay, but I suggest |
80b198d
to
238d580
Compare
Is this what you meant? I wasn't sure how the name the feature. I first tried to go with |
You can. The old way to do this is just to have the optional feature in the Cargo.toml (you can still use |
238d580
to
e8bd2e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
This is a draft PR for issue #1006.
It is a working
Dirichlet
distribution that takes and returns const arrays, working with rand's current MSRV (1.56) [edit: but apparently not with Serde: serde-rs/serde/issues/1937].It might still be useful to keep the original dynamic
Dirichlet
, so should I leave alone the originalDirichlet
distribution and create a new one such asDirichletConst
?