remove dead code
This commit is contained in:
parent
c668a44e44
commit
a94c0ed3b6
@ -192,23 +192,6 @@ impl FunctionEntry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
/// Get function that can be used to calculate integral based on Riemann Sum type
|
|
||||||
fn get_sum_func(&self, sum: Riemann) -> FunctionHelper {
|
|
||||||
match sum {
|
|
||||||
Riemann::Left => {
|
|
||||||
FunctionHelper::new(|left_x: f64, _: f64| -> f64 { self.function.get(left_x) })
|
|
||||||
}
|
|
||||||
Riemann::Right => {
|
|
||||||
FunctionHelper::new(|_: f64, right_x: f64| -> f64 { self.function.get(right_x) })
|
|
||||||
}
|
|
||||||
Riemann::Middle => FunctionHelper::new(|left_x: f64, right_x: f64| -> f64 {
|
|
||||||
(self.function.get(left_x) + self.function.get(right_x)) / 2.0
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// Creates and does the math for creating all the rectangles under the graph
|
/// Creates and does the math for creating all the rectangles under the graph
|
||||||
fn integral_rectangles(
|
fn integral_rectangles(
|
||||||
&self, integral_min_x: f64, integral_max_x: f64, sum: Riemann, integral_num: usize,
|
&self, integral_min_x: f64, integral_max_x: f64, sum: Riemann, integral_num: usize,
|
||||||
|
|||||||
30
src/misc.rs
30
src/misc.rs
@ -3,36 +3,6 @@ use std::{intrinsics::assume, ops::RangeInclusive};
|
|||||||
use egui::plot::{Line, Points, Value, Values};
|
use egui::plot::{Line, Points, Value, Values};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
/*
|
|
||||||
pub struct FunctionHelper<'a> {
|
|
||||||
#[cfg(threading)]
|
|
||||||
f: async_lock::Mutex<Box<dyn Fn(f64, f64) -> f64 + 'a + Sync + Send>>,
|
|
||||||
|
|
||||||
#[cfg(not(threading))]
|
|
||||||
f: Box<dyn Fn(f64, f64) -> f64 + 'a>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> FunctionHelper<'a> {
|
|
||||||
#[cfg(threading)]
|
|
||||||
pub fn new(f: impl Fn(f64, f64) -> f64 + 'a) -> FunctionHelper<'a> {
|
|
||||||
FunctionHelper {
|
|
||||||
f: async_lock::Mutex::new(Box::new(f)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(threading))]
|
|
||||||
pub fn new(f: impl Fn(f64, f64) -> f64 + 'a) -> FunctionHelper<'a> {
|
|
||||||
FunctionHelper { f: Box::new(f) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(threading)]
|
|
||||||
pub async fn get(&self, x: f64, x1: f64) -> f64 { (self.f.lock().await)(x, x1) }
|
|
||||||
|
|
||||||
#[cfg(not(threading))]
|
|
||||||
pub fn get(&self, x: f64, x1: f64) -> f64 { (self.f)(x, x1) }
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// [`SteppedVector`] is used in order to efficiently sort through an ordered
|
/// [`SteppedVector`] is used in order to efficiently sort through an ordered
|
||||||
/// `Vec<f64>` Used in order to speedup the processing of cached data when
|
/// `Vec<f64>` Used in order to speedup the processing of cached data when
|
||||||
/// moving horizontally without zoom in `FunctionEntry`. Before this struct, the
|
/// moving horizontally without zoom in `FunctionEntry`. Before this struct, the
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user