std_dev::regression::binary_search

Trait NVariableStorage

source
pub trait NVariableStorage:
    IndexMut<usize, Output = f64>
    + AsRef<[f64]>
    + AsMut<[f64]>
    + Clone {
    type Data;
    type Given<'a>: AsRef<[f64]>
       where Self: 'a;

    // Required methods
    fn new_filled(data: &Self::Data, num: f64) -> Self;
    fn borrow(&self) -> Self::Given<'_>;
}
Available on crate feature regression only.
Expand description

A trait which allows storage of n-variable optimization, either on the stack through arrays ([f64; VARIABLE_COUNT]) or allocated on the heap through Vec.

Required Associated Types§

source

type Data

Associated data for use in construction of this type. The number of arguments in case of using a Vec, nothing when using arrays, as we know their length in compile time.

source

type Given<'a>: AsRef<[f64]> where Self: 'a

The structure that’s given to the fitness function. Needs to have the same length as the .as_ref() implementation of this struct.

Required Methods§