Skip to content

Commit

Permalink
chore(deps): update rand to 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrjabs committed Jan 28, 2025
1 parent 6724dec commit 0de32b8
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 20 deletions.
75 changes: 63 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ itertools = "0.14.0"
nom = "7.1.3"
termcolor = "1.4.1"
thiserror = "2.0.11"
rand = "0.8.5"
rand_chacha = "0.3.1"
rand = "0.9.0"
rand_chacha = "0.9.0"
rustc-hash = "2.1.0"
rustsat = { version = "0.6.3", path = "./", default-features = false }
rustsat-cadical = { version = "0.4.3", path = "./cadical" }
Expand Down
2 changes: 1 addition & 1 deletion src/instances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl RandReindVarManager {
pub fn init(n_vars: u32) -> Self {
use rand::seq::SliceRandom;
let mut in_map: Vec<Var> = (0..n_vars).map(Var::new).collect();
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
// Build randomly shuffled input map
in_map[..].shuffle(&mut rng);
// Build reverse map
Expand Down
2 changes: 1 addition & 1 deletion src/instances/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ impl Objective {
soft_clauses,
..
} => {
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
(soft_lits[..]).shuffle(&mut rng);
(soft_clauses[..]).shuffle(&mut rng);
}
Expand Down
4 changes: 2 additions & 2 deletions src/instances/sat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Cnf {
#[must_use]
pub fn shuffle(mut self) -> Self {
use rand::seq::SliceRandom;
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
self.clauses[..].shuffle(&mut rng);
self
}
Expand Down Expand Up @@ -800,7 +800,7 @@ impl<VM: ManageVars> Instance<VM> {
pub fn shuffle(mut self) -> Self {
use rand::seq::SliceRandom;
self.cnf = self.cnf.shuffle();
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
self.cards[..].shuffle(&mut rng);
self.pbs[..].shuffle(&mut rng);
self
Expand Down
4 changes: 2 additions & 2 deletions tools/src/encodings/knapsack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ impl Knapsack {
let mut rng = ChaCha8Rng::seed_from_u64(seed);
let items: Vec<_> = (0..n_items)
.map(|_| {
let weight = rng.gen_range(weight_range.clone());
let weight = rng.random_range(weight_range.clone());
let values = (0..n_objectives)
.map(|_| rng.gen_range(value_range.clone()))
.map(|_| rng.random_range(value_range.clone()))
.collect();
ItemData { weight, values }
})
Expand Down

0 comments on commit 0de32b8

Please sign in to comment.