Trait indxvec::Mutops

source ·
pub trait Mutops<T> {
    // Required methods
    fn mutquicksort(self)
       where T: PartialOrd;
    fn mutrevs(self);
    fn mutsorttwo(self, i0: usize, i1: usize) -> bool
       where T: PartialOrd;
    fn mutsortthree(self, i0: usize, i1: usize, i2: usize)
       where T: PartialOrd;
    fn muthashsort(self, quantify: &mut impl FnMut(&T) -> f64)
       where T: PartialOrd + Clone;
    fn muthashsortslice(
        self,
        i: usize,
        n: usize,
        min: f64,
        max: f64,
        quantify: &mut impl FnMut(&T) -> f64
    )
       where T: PartialOrd + Clone;
}
Expand description

Mutable Operators on &mut[T]

Required Methods§

source

fn mutquicksort(self)where T: PartialOrd,

Sorts a mutable slice in place.

source

fn mutrevs(self)

mutable reversal, general utility

source

fn mutsorttwo(self, i0: usize, i1: usize) -> boolwhere T: PartialOrd,

utility that mutably swaps two indexed items into ascending order

source

fn mutsortthree(self, i0: usize, i1: usize, i2: usize)where T: PartialOrd,

utility that mutably bubble sorts three indexed items into ascending order

source

fn muthashsort(self, quantify: &mut impl FnMut(&T) -> f64)where T: PartialOrd + Clone,

Possibly the fastest sort for long lists. Wrapper for muthashsortslice.

source

fn muthashsortslice( self, i: usize, n: usize, min: f64, max: f64, quantify: &mut impl FnMut(&T) -> f64 )where T: PartialOrd + Clone,

Sorts n items from i in self. Used by muthashsort.

Implementations on Foreign Types§

source§

impl<T> Mutops<T> for &mut [T]

source§

fn mutquicksort(self)where T: PartialOrd,

Sorts a mutable slice in place. The fastest default Rust sort
It is the responsibility of the user to ensure that there are no NaNs etc.

source§

fn mutrevs(self)

Destructive reversal by swapping

source§

fn mutsorttwo(self, i0: usize, i1: usize) -> boolwhere T: PartialOrd,

sort two slice items if they are out of ascending order

source§

fn mutsortthree(self, i0: usize, i1: usize, i2: usize)where T: PartialOrd,

sort three slice items if they are out of ascending order

source§

fn muthashsortslice( self, i: usize, n: usize, fmin: f64, fmax: f64, quantify: &mut impl FnMut(&T) -> f64 )where T: PartialOrd + Clone,

Does the work for muthashsort Requires [min,max], the data range, that must enclose all its values. If the range is known in advance, use this in preference to muthashsort to save finding it

source§

fn muthashsort(self, quantify: &mut impl FnMut(&T) -> f64)where T: PartialOrd + Clone,

N recursive hash sort. Sorts mutable first argument in place Takes closure quantify for converting user type T to f64

Implementors§