pub trait Mutops<T> {
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)
where
T: PartialOrd + Clone,
f64: From<T>;
fn muthashsortslice(self, i: usize, n: usize, min: T, max: T)
where
T: PartialOrd + Clone,
f64: From<T>;
}
Expand description
Mutable Operators on &mut[T]
Required Methods
fn mutquicksort(self) where
T: PartialOrd,
fn mutquicksort(self) where
T: PartialOrd,
Sorts a mutable slice in place.
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) where
T: PartialOrd + Clone,
f64: From<T>,
fn muthashsort(self) where
T: PartialOrd + Clone,
f64: From<T>,
Possibly the fastest sort for long lists. Wrapper for muthashsortslice
.
fn muthashsortslice(self, i: usize, n: usize, min: T, max: T) where
T: PartialOrd + Clone,
f64: From<T>,
fn muthashsortslice(self, i: usize, n: usize, min: T, max: T) where
T: PartialOrd + Clone,
f64: From<T>,
Sorts n items from i in self. Used by muthashsort.
Implementations on Foreign Types
sourceimpl<T> Mutops<T> for &mut [T]
impl<T> Mutops<T> for &mut [T]
sourcefn mutquicksort(self) where
T: PartialOrd,
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.
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) where
T: PartialOrd + Clone,
f64: From<T>,
fn muthashsort(self) where
T: PartialOrd + Clone,
f64: From<T>,
N recursive hash sort. Sorts mutable first argument in place
sourcefn muthashsortslice(self, i: usize, n: usize, min: T, max: T) where
T: PartialOrd + Clone,
f64: From<T>,
fn muthashsortslice(self, i: usize, n: usize, min: T, max: T) where
T: PartialOrd + Clone,
f64: From<T>,
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