Trait VectorExtensions

Source
pub trait VectorExtensions<T> {
    // Required methods
    fn monotonic_prop(&self) -> Monotonic;
    fn get_lower_index(&self, x: T) -> usize;
}
Expand description

Helper methods for one dimensional numeric arrays

Required Methods§

Source

fn monotonic_prop(&self) -> Monotonic

get the monotonic property of the vector

Source

fn get_lower_index(&self, x: T) -> usize

Get the index of the next lower value inside the vector. This is not guaranteed to return the index of an exact match.

This will never return the last index of the vector. when x is out of bounds it will either return 0 or self.len() - 2 depending on which side it is out of bounds

§Warning

this method requires the monotonic_prop to be Monotonic::Rising { strict: true } otherwise the behaviour is undefined

Implementations on Foreign Types§

Source§

impl<S> VectorExtensions<<S as RawData>::Elem> for ArrayBase<S, Ix1>
where S: Data, S::Elem: Debug + PartialOrd + Num + NumCast + Copy,

Implementors§