Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main.rs
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -14,17 +14,17 @@ mod bounds;
|
||||
mod function;
|
||||
mod plot;
|
||||
|
||||
const THREAD_CNT: usize = 8;
|
||||
const THREAD_CNT: usize = 20;
|
||||
const SAMPLE_LIMIT: usize = 100_000_000;
|
||||
const SUB_SAMPLES: [usize; 3] = [1, 2, 5];
|
||||
const SAMPLES_PER_ITERATION: usize = 250;
|
||||
|
||||
fn f(x: &f64) -> f64 {
|
||||
E.powf(*x) * (1.0 / (*x).sin()).cos() + (*x).powf(2.0)
|
||||
fn f(x: f64) -> f64 {
|
||||
E.powf(x) * (1.0 / x.sin()).cos() + x.powf(2.0)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let bounds: Bounds = Bounds::new(LinearBounds::new(3.1_f64, 3.2_f64), LinearBounds::new(-15_f64, 35_f64));
|
||||
let bounds: Bounds = Bounds::new(LinearBounds::new(3.1_f64, 3.2_f64), LinearBounds::new(-10_f64, 35_f64));
|
||||
let func: Function = Function::new(f);
|
||||
|
||||
//let start: Instant = Instant::now();
|
||||
@@ -48,6 +48,8 @@ fn simulate(bounds: &Bounds, func: &Function) {
|
||||
println!();
|
||||
}
|
||||
sample_cnt *= 10;
|
||||
}
|
||||
result.print();
|
||||
|
||||
let file: io::Result<File> = File::create(format!("output{}.json", sample_cnt.ilog10()));
|
||||
if file.is_err() {
|
||||
|
||||
Reference in New Issue
Block a user