argmin-rs / argmin

Numerical optimization in pure Rust
http://argmin-rs.org
Apache License 2.0
972 stars 76 forks source link

allow user to set ParticleSwarm's random number generator #383

Closed jonboh closed 8 months ago

jonboh commented 8 months ago

Initially I had restricted the trait requirements for G (Generator) to be Rng+SeedableRng, however with just Rng a user is perfectly able to use a SeedableRng, so I don't think it is necessary to set the extra requirement (the default provided by the constructor is itself seeded so a user can just pass a differently seeded generator, as in the provided doctests).

With this change we can pin the behaviour of ParticleSwarm in tests and bechmarks.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (64352e4) 93.29% compared to head (6eef51f) 93.30%. Report is 9 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #383 +/- ## ========================================== + Coverage 93.29% 93.30% +0.01% ========================================== Files 117 117 Lines 18810 18875 +65 ========================================== + Hits 17548 17611 +63 - Misses 1262 1264 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.