pub trait Mutsort<T> {
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, min: f64, max: f64)
where
T: PartialOrd + Copy,
f64: From<T>;
fn muthashsortslice(self, i: usize, n: usize, min: f64, max: f64)
where
T: PartialOrd + Copy,
f64: From<T>;
}
Required Methods
fn mutsorttwo(self, i0: usize, i1: usize) -> bool where
T: PartialOrd,
fn mutsorttwo(self, i0: usize, i1: usize) -> bool where
T: PartialOrd,
utility that mutably swaps two indexed items into ascending order
fn mutsortthree(self, i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
fn mutsortthree(self, i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
utility that mutably bubble sorts three indexed items into ascending order
fn muthashsort(self, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
fn muthashsort(self, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
Possibly the fastest sort for long lists. Wrapper for muthashsortslice
.
fn muthashsortslice(self, i: usize, n: usize, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
fn muthashsortslice(self, i: usize, n: usize, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
Sorts n items from i in self. Used by muthashsort.
Implementations on Foreign Types
sourceimpl<T> Mutsort<T> for &mut [T]
impl<T> Mutsort<T> for &mut [T]
sourcefn mutsorttwo(self, i0: usize, i1: usize) -> bool where
T: PartialOrd,
fn mutsorttwo(self, i0: usize, i1: usize) -> bool where
T: PartialOrd,
sort two slice items if they are out of ascending order
sourcefn mutsortthree(self, i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
fn mutsortthree(self, i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
sort three slice items if they are out of ascending order
sourcefn muthashsort(self, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
fn muthashsort(self, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
N recursive hash sort.
Sorts mutable first argument (slice) in place
Requires [min,max], the data range, that must enclose all its values.
The range is often known in advance. If not, it can be obtained with minmaxt()
.
sourcefn muthashsortslice(self, i: usize, n: usize, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
fn muthashsortslice(self, i: usize, n: usize, min: f64, max: f64) where
T: PartialOrd + Copy,
f64: From<T>,
Does the work for muthashsort