diff --git a/src/function_entry.rs b/src/function_entry.rs index ebb66f1..1d2e80d 100644 --- a/src/function_entry.rs +++ b/src/function_entry.rs @@ -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 fn integral_rectangles( &self, integral_min_x: f64, integral_max_x: f64, sum: Riemann, integral_num: usize, diff --git a/src/misc.rs b/src/misc.rs index 5b87903..115c761 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -3,36 +3,6 @@ use std::{intrinsics::assume, ops::RangeInclusive}; use egui::plot::{Line, Points, Value, Values}; use itertools::Itertools; -/* -pub struct FunctionHelper<'a> { - #[cfg(threading)] - f: async_lock::Mutex f64 + 'a + Sync + Send>>, - - #[cfg(not(threading))] - f: Box 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 /// `Vec` Used in order to speedup the processing of cached data when /// moving horizontally without zoom in `FunctionEntry`. Before this struct, the