Skip to content

Commit eed0786

Browse files
authored
Merge pull request #134 from JeroenGar/elim_rand_xoshiro
replace `rand_xoshiro` with `rand`
2 parents c95454e + bb25543 commit eed0786

10 files changed

Lines changed: 11 additions & 13 deletions

File tree

.cargo/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# .cargo/config.toml
22
[target.wasm32-unknown-unknown]
33
rustflags = [
4-
"--cfg", "getrandom_backend=\"wasm_js\"",
5-
"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals,+simd128"]
4+
"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals,+simd128"
5+
]

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jagua-rs = { features = ["spp"], git = "https://github.com/JeroenGar/jagua-rs.gi
1818
#jagua-rs = { features = ["spp"], path = "../jagua-rs/jagua-rs" }
1919
rand = "0.10"
2020
rand_distr = "0.6"
21-
rand_xoshiro = "0.8"
2221
svg = "0.18"
2322
itertools = "0.14"
2423
log = { version = "0.4", features = ["release_max_level_info"] }

src/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::time::Duration;
1616
use anyhow::Result;
1717
use jagua_rs::io::import::Importer;
1818
use jagua_rs::io::svg::s_layout_to_svg;
19-
use rand_xoshiro::Xoshiro256PlusPlus;
19+
use rand::rngs::Xoshiro256PlusPlus;
2020
use sparrow::consts::{DEFAULT_COMPRESS_TIME_RATIO, DEFAULT_EXPLORE_TIME_RATIO, DRAW_OPTIONS, LBF_SAMPLE_CONFIG};
2121
use sparrow::optimizer::compress::compression_phase;
2222
use sparrow::optimizer::explore::exploration_phase;

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::path::Path;
1414
use std::time::Duration;
1515

1616
use anyhow::{bail, Result};
17-
use rand_xoshiro::Xoshiro256PlusPlus;
17+
use rand::rngs::Xoshiro256PlusPlus;
1818
use sparrow::consts::{DEFAULT_COMPRESS_TIME_RATIO, DEFAULT_EXPLORE_TIME_RATIO, DEFAULT_FAIL_DECAY_RATIO_CMPR, DEFAULT_MAX_CONSEQ_FAILS_EXPL, LOG_LEVEL_FILTER_DEBUG, LOG_LEVEL_FILTER_RELEASE};
1919
use sparrow::util::ctrlc_terminator::CtrlCTerminator;
2020
use sparrow::util::svg_exporter::SvgExporter;

src/optimizer/lbf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use jagua_rs::probs::spp::entities::{SPInstance, SPPlacement, SPProblem};
88
use jagua_rs::Instant;
99
use log::debug;
1010
use ordered_float::OrderedFloat;
11-
use rand_xoshiro::Xoshiro256PlusPlus;
1211
use std::cmp::Reverse;
1312
use std::iter;
13+
use rand::rngs::Xoshiro256PlusPlus;
1414

1515
pub struct LBFBuilder {
1616
pub instance: SPInstance,

src/optimizer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use crate::util::terminator::Terminator;
99
use jagua_rs::probs::spp::entities::{SPInstance, SPSolution};
1010
use log::info;
1111
use rand::{Rng, SeedableRng};
12-
use rand_xoshiro::Xoshiro256PlusPlus;
1312
use std::time::Duration;
13+
use rand::rngs::Xoshiro256PlusPlus;
1414

1515
pub mod lbf;
1616
pub mod separator;

src/optimizer/separator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use jagua_rs::Instant;
1313
use log::{debug, log, Level};
1414
use ordered_float::OrderedFloat;
1515
use rand::{Rng, RngExt, SeedableRng};
16-
use rand_xoshiro::Xoshiro256PlusPlus;
16+
use rand::rngs::Xoshiro256PlusPlus;
1717
use rayon::iter::IntoParallelRefMutIterator;
1818
use rayon::iter::ParallelIterator;
1919
use rayon::ThreadPool;

src/optimizer/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use jagua_rs::geometry::DTransformation;
1010
use jagua_rs::probs::spp::entities::{SPInstance, SPPlacement, SPProblem, SPSolution};
1111
use log::debug;
1212
use rand::prelude::SliceRandom;
13-
use rand_xoshiro::Xoshiro256PlusPlus;
1413
use std::iter::Sum;
1514
use std::ops::AddAssign;
15+
use rand::rngs::Xoshiro256PlusPlus;
1616
use tap::Tap;
1717

1818
pub struct SeparatorWorker {

src/sample/uniform_sampler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use jagua_rs::geometry::{normalize_rotation, DTransformation, Transformation};
77
use ndarray::Array;
88
use ordered_float::OrderedFloat;
99
use rand::prelude::IndexedRandom;
10-
use rand::RngExt;
11-
use rand_xoshiro::rand_core::Rng;
10+
use rand::{Rng, RngExt};
1211
use std::f32::consts::PI;
1312
use std::ops::Range;
1413

tests/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
mod integration_tests {
33
use anyhow::Result;
44
use jagua_rs::io::import::Importer;
5-
use rand::SeedableRng;
6-
use rand_xoshiro::Xoshiro256PlusPlus;
75
use sparrow::config::DEFAULT_SPARROW_CONFIG;
86
use sparrow::consts::LBF_SAMPLE_CONFIG;
97
use sparrow::optimizer::compress::compression_phase;
@@ -15,6 +13,8 @@ mod integration_tests {
1513
use sparrow::util::terminator::Terminator;
1614
use std::path::Path;
1715
use std::time::Duration;
16+
use rand::rngs::Xoshiro256PlusPlus;
17+
use rand::SeedableRng;
1818
use test_case::test_case;
1919
use sparrow::util::listener::DummySolListener;
2020

0 commit comments

Comments
 (0)