pub fn new(min_x: f64, max_x: f64, frac_digits: i32, func: F) -> Self {
        let shift = 10.0_f64.powi(frac_digits);
        let offset = (min_x * shift) as usize;
        let mut table = InterpolationTable {
            inner: Vec::new(),
            func,
            min_x,
            max_x,
            shift,
            offset,
        };

        let mut i = table.index(min_x);
        while i < table.index(max_x) {
            let x = i as f64 / shift;
            table.inner.push((table.func)(x));
            i += 1;
        }

        table
    }
/// Create a new `InterpolationTable`.
///
/// # Arguments
///
/// * `min_x` - minimum sample value
/// * `max_x` - maximum sample value
/// * `frac_digits` - number of fraction digits to store in sample
/// * `func` - Function to emulate.
///
/// If given value is outside of min_x and max_x, the lookup falls back to applying the
/// function itself.
/// The table size grows with the number of fraction digits.
/// Space Complexity: O(m * 10^n), where `m = max_x - min_x` and `n = frac_digits`
Create a new `InterpolationTable`.
Create a new ` InterpolationTable ` .
pub fn new(min_x: f64, max_x: f64, frac_digits: i32, func: F) -> Self {
        let shift = 10.0_f64.powi(frac_digits);
        let offset = (min_x * shift) as usize;
        let mut table = InterpolationTable {
            inner: Vec::new(),
            func,
            min_x,
            max_x,
            shift,
            offset,
        };
        let mut i = table.index(min_x);
        while i < table.index(max_x) {
            let x = i as f64 / shift;
            table.inner.push((table.func)(x));
            i += 1;
        }
        table
    }
pub fn new ( min_x : f64 , max_x : f64 , frac_digits : i32 , func : F ) -> Self { let shift = 10.0_f64 . powi ( frac_digits ) ; let offset = ( min_x * shift ) as usize ; let mut table = InterpolationTable { inner : Vec :: new ( ) , func , min_x , max_x , shift , offset , } ; let mut i = table . index ( min_x ) ; while i < table . index ( max_x ) { let x = i as f64 / shift ; table . inner . push ( ( table . func ) ( x ) ) ; i += 1 ; } table }
Create a new `InterpolationTable`.
Create a new ` InterpolationTable ` .
min_x
f64
max_x
f64
frac_digits
i32
func
F
min_x
f64
max_x
f64
frac_digits
i32
func
F