All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added a parameter fuzzing script to search for panics and invalid output (#53)
- Bump to MSRV 1.85.0 and Edition 2024 in line with
rand(#28) - Update
randto version 0.10.0 (#31, #48)
MultiDistributiontrait to sample more efficiently from multi-dimensional distributions (#18)- Add
WeightedAliasIndex::weights()to reconstruct the original weights in O(n) (#25) ConstMultiDistributiontrait as support for fixed-dimension distributions (#29)
- Moved
Dirichletinto the newmultimodule and implementMultiDistributionfor it (#18) Dirichletno longer usesconstgenerics, which means that its size is not required at compile time. Essentially a revert of rand#1292. (#30)
- Fix
Geometric::newfor smallp > 0where1 - prounds to 1 (#36) - Use
direct-minimal-versions(#38) - Fix panic in
FisherF::newon almost zero parameters (#39) - Fix panic in
NormalInverseGaussian::newwith very largealpha; this is a Value-breaking change (#40) - Fix hang and debug assertion in
Zipf::newon invalid parameters (#41) - Fix panic in
Binomial::samplewithn ≥ 2^63; this is a Value-breaking change (#43) - Error instead of producing
-infoutput forExpwhenlambdais-0.0(#44) - Avoid returning NaN from
Gamma::sample; this is a Value-breaking change and also affectsChiSquaredandDirichlet(#46)
- Added building the crate to CI
- Fix missing import for
no_stdbuilds
- Bump the MSRV to 1.61.0 (rand#1207, rand#1246, rand#1269, rand#1341, rand#1416); note that 1.60.0 may work for dependents when using
--ignore-rust-version - Update to
randv0.9.0 (rand#1558) - Rename feature
serde1toserde(rand#1477)
- Make distributions comparable with
PartialEq(rand#1218) Dirichletnow usesconstgenerics, which means that its size is required at compile time (rand#1292)- The
Dirichlet::new_with_sizeconstructor was removed (rand#1292) - Add
WeightedIndexTree(rand#1372, rand#1444) - Add
PertBuilderto allow specification ofmeanormode(rand#1452) - Rename
Zeta's parameteratos(rand#1466) - Mark
WeightError,PoissonError,BinomialErroras#[non_exhaustive](rand#1480) - Remove support for usage of
isizeas aWeightedAliasIndexweight (rand#1487) - Change parameter type of
Zipf::new:nis now floating-point (rand#1518)
- Move
Slice->slice::Choose,EmptySlice->slice::Empty(rand#1548) - Rename trait
DistString->SampleString(rand#1548) - Rename
DistIter->Iter,DistMap->Map(rand#1548) - Move
{Weight, WeightError, WeightedIndex}->weighted::{Weight, Error, WeightedIndex}(rand#1548) - Move
weighted_alias::{AliasableWeight, WeightedAliasIndex}->weighted::{..}(rand#1548) - Move
weighted_tree::WeightedTreeIndex->weighted::WeightedTreeIndex(rand#1548)
- Fix Knuth's method so
Poissondoesn't return -1.0 for small lambda (rand#1284) - Fix
Poissondistribution instantiation so it return an error if lambda is infinite (rand#1291) - Fix Dirichlet sample for small alpha values to avoid NaN samples (rand#1209)
- Fix infinite loop in
Binomialdistribution (rand#1325) - Fix
Pertdistribution wheremodeis close to(min + max) / 2(rand#1452) - Fix panic in Binomial (rand#1484)
- Limit the maximal acceptable lambda for
Poissonto solve (rand#1312) (rand#1498) - Fix bug in
Hypergeometric, this is a Value-breaking change (rand#1510)
- Remove unused fields from
Gamma,NormalInverseGaussianandZipfdistributions (rand#1184) This breaks serialization compatibility with older versions. - Add plots for
rand_distrdistributions to documentation (rand#1434) - Move some of the computations in Binomial from
sampletonew(rand#1484) - Reimplement
Poisson's rejection method to improve performance and correct sampling inaccuracies for large lambda values, this is a Value-breaking change (rand#1560)
- Fix
no_stdbuild (rand#1208)
- New
ZetaandZipfdistributions (rand#1136) - New
SkewNormaldistribution (rand#1149) - New
GumbelandFrechetdistributions (rand#1168, rand#1171)
- Empirically test PDF of normal distribution (rand#1121)
- Correctly document
no_stdsupport (rand#1100) - Add
std_mathfeature to preferstdoverlibmfor floating point math (rand#1100) - Add mean and std_dev accessors to Normal (rand#1114)
- Make sure all distributions and their error types implement
Error,Display,Clone,Copy,PartialEqandEqas appropriate (rand#1126) - Port benchmarks to use Criterion crate (rand#1116)
- Support serde for distributions (rand#1141)
- Bump
randto v0.8.0 - New
Geometric,StandardGeometricandHypergeometricdistributions (rand#1062) - New
Betasampling algorithm for improved performance and accuracy (rand#1000) NormalandLogNormalnow supportfrom_mean_cvandfrom_zscore(rand#1044)- Variants of
NormalErrorchanged (rand#1044)
- Move alias method for
WeightedIndexfromrand(rand#945) - Rename
WeightedIndextoWeightedAliasIndex(rand#1008) - Replace custom
Floattrait withnum-traits::Float(rand#987) - Enable
no_stdsupport vianum-traitsmath functions (rand#987) - Remove
Distribution<u64>impl forPoisson(rand#987) - Tweak
Dirichletandalias_methodto use boxed slice instead ofVec(rand#987) - Use whitelist for package contents, reducing size by 5kb (rand#983)
- Add case
lambda = 0in the parametrization ofExp(rand#972) - Implement inverse Gaussian distribution (rand#954)
- Reformatting and use of
rustfmt::skip(rand#926) - All error types now implement
std::error::Error(rand#919) - Re-exported
rand::distributions::BernoulliError(rand#919) - Add value stability tests for distributions (rand#891)
- Update dependency to support Rand 0.7
- Doc link fixes
- Remove
newconstructors for zero-sized types - Add Pert distribution
- Fix undefined behavior in
Poisson - Make all distributions return
Results instead of panicking - Implement
f32support for most distributions - Rename
UnitSphereSurfacetoUnitSphere - Implement
UnitBallandUnitDisc
Initial release. This is equivalent to the code in rand 0.6.5.