pub trait Vecops<T> {
Show 37 methods
fn maxt(self) -> T
where
T: PartialOrd + Copy;
fn mint(self) -> T
where
T: PartialOrd + Copy;
fn minmaxt(self) -> (T, T)
where
T: PartialOrd + Copy;
fn minmax(self) -> MinMax<T>
where
T: PartialOrd + Copy;
fn minmax_slice(self, i: usize, n: usize) -> MinMax<T>
where
T: PartialOrd + Copy;
fn minmax_indexed(self, idx: &[usize], i: usize, n: usize) -> MinMax<T>
where
T: PartialOrd + Copy;
fn revs(self) -> Vec<T>
where
T: Copy;
fn sansrepeat(self) -> Vec<T>
where
T: PartialEq + Copy;
fn member(self, m: T) -> Option<usize>
where
T: PartialEq + Copy;
fn memsearch(self, val: T) -> Option<usize>
where
T: PartialOrd;
fn memsearchdesc(self, val: T) -> Option<usize>
where
T: PartialOrd;
fn memsearch_indexed(self, i: &[usize], val: T) -> Option<usize>
where
T: PartialOrd;
fn memsearchdesc_indexed(self, i: &[usize], val: T) -> Option<usize>
where
T: PartialOrd;
fn binsearch(self, val: T) -> usize
where
T: PartialOrd;
fn binsearchdesc(self, val: T) -> usize
where
T: PartialOrd;
fn binsearch_indexed(self, i: &[usize], val: T) -> usize
where
T: PartialOrd;
fn binsearchdesc_indexed(self, i: &[usize], val: T) -> usize
where
T: PartialOrd;
fn occurs(self, val: T) -> usize
where
T: PartialOrd;
fn occurs_multiple(self, sdesc: &[T], val: T) -> usize
where
T: PartialOrd + Copy;
fn unite_unsorted(self, v: &[T]) -> Vec<T>
where
T: Clone;
fn intersect(self, v2: &[T]) -> Vec<T>
where
T: PartialOrd + Copy;
fn intersect_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T>
where
T: PartialOrd + Copy;
fn diff(self, v2: &[T]) -> Vec<T>
where
T: PartialOrd + Copy;
fn diff_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T>
where
T: PartialOrd + Copy;
fn partition(self, pivot: T) -> (Vec<T>, Vec<T>, Vec<T>)
where
T: PartialOrd + Copy;
fn partition_indexed(self, pivot: T) -> (Vec<usize>, Vec<usize>, Vec<usize>)
where
T: PartialOrd + Copy;
fn merge(self, v2: &[T]) -> Vec<T>
where
T: PartialOrd + Copy;
fn merge_indexed(
self,
idx1: &[usize],
v2: &[T],
idx2: &[usize]
) -> (Vec<T>, Vec<usize>)
where
T: PartialOrd + Copy;
fn merge_indices(self, idx1: &[usize], idx2: &[usize]) -> Vec<usize>
where
T: PartialOrd + Copy;
fn mergesort(self, i: usize, n: usize) -> Vec<usize>
where
T: PartialOrd + Copy;
fn sortidx(self) -> Vec<usize>
where
T: PartialOrd + Copy;
fn sortm(self, ascending: bool) -> Vec<T>
where
T: PartialOrd + Copy;
fn rank(self, ascending: bool) -> Vec<usize>
where
T: PartialOrd + Copy;
fn isorttwo(self, idx: &mut [usize], i0: usize, i1: usize) -> bool
where
T: PartialOrd;
fn isortthree(self, idx: &mut [usize], i0: usize, i1: usize, i2: usize)
where
T: PartialOrd;
fn hashsort_indexed(self, min: f64, max: f64) -> Vec<usize>
where
T: PartialOrd + Copy,
f64: From<T>;
fn hashsortslice(
self,
idx: &mut [usize],
i: usize,
n: usize,
min: f64,
max: f64
)
where
T: PartialOrd + Copy,
f64: From<T>;
}
Expand description
Methods to manipulate generic Vecs and slices of type &[T]
Required Methods
fn maxt(self) -> T where
T: PartialOrd + Copy,
fn maxt(self) -> T where
T: PartialOrd + Copy,
Maximum value in self
fn mint(self) -> T where
T: PartialOrd + Copy,
fn mint(self) -> T where
T: PartialOrd + Copy,
Minimum value in self
fn minmaxt(self) -> (T, T) where
T: PartialOrd + Copy,
fn minmaxt(self) -> (T, T) where
T: PartialOrd + Copy,
Minimum and maximum values in self
fn minmax(self) -> MinMax<T> where
T: PartialOrd + Copy,
fn minmax(self) -> MinMax<T> where
T: PartialOrd + Copy,
Returns MinMax{min, minindex, max, maxindex}
fn minmax_slice(self, i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
fn minmax_slice(self, i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
MinMax of n items starting at subscript i
fn minmax_indexed(self, idx: &[usize], i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
fn minmax_indexed(self, idx: &[usize], i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
MinMax of a subset of self, defined by its idx subslice between i,i+n.
fn sansrepeat(self) -> Vec<T> where
T: PartialEq + Copy,
fn sansrepeat(self) -> Vec<T> where
T: PartialEq + Copy,
Repeated items removed
Some(subscript) of the first occurence of m, or None
fn memsearch(self, val: T) -> Option<usize> where
T: PartialOrd,
fn memsearch(self, val: T) -> Option<usize> where
T: PartialOrd,
Binary search for the subscript of the first occurence of val
fn memsearchdesc(self, val: T) -> Option<usize> where
T: PartialOrd,
fn memsearchdesc(self, val: T) -> Option<usize> where
T: PartialOrd,
Binary search for the subscript of the last occurence of val
fn memsearch_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
fn memsearch_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
Binary search for val via ascending sort index i, returns subscript of val
fn memsearchdesc_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
fn memsearchdesc_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
Backwards binary search for val via descending sort index i, returns subscript of val
fn binsearch(self, val: T) -> usize where
T: PartialOrd,
fn binsearch(self, val: T) -> usize where
T: PartialOrd,
Binary search of an explicitly sorted list in ascending order. Returns subscript of the first item that is greater than val. When none are greater, returns s.len()
fn binsearchdesc(self, val: T) -> usize where
T: PartialOrd,
fn binsearchdesc(self, val: T) -> usize where
T: PartialOrd,
Binary search of an explicitly sorted list in descending order. Returns subscript of the first item that is smaller than val. When none are smaller, returns s.len()
fn binsearch_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
fn binsearch_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
Binary search of an index sorted list in ascending order. Returns subscript of the first item that is greater than val.
fn binsearchdesc_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
fn binsearchdesc_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
Binary search of an index sorted list in descending order. Returns subscript of the first item that is smaller than val (in descending order).
fn occurs(self, val: T) -> usize where
T: PartialOrd,
fn occurs(self, val: T) -> usize where
T: PartialOrd,
Counts occurrences of val by simple linear search of an unordered set
fn occurs_multiple(self, sdesc: &[T], val: T) -> usize where
T: PartialOrd + Copy,
fn occurs_multiple(self, sdesc: &[T], val: T) -> usize where
T: PartialOrd + Copy,
Efficiently counts number of occurences from ascending and descending sorts
fn unite_unsorted(self, v: &[T]) -> Vec<T> where
T: Clone,
fn unite_unsorted(self, v: &[T]) -> Vec<T> where
T: Clone,
Unites (concatenates) two unsorted sets. For union of sorted sets, use merge
Intersects two ascending explicitly sorted generic vectors.
fn intersect_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
fn intersect_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
Intersects two ascending index sorted vectors.
Removes items of sorted v2 from sorted self.
fn diff_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
fn diff_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
Removes items of v2 from self using their sort indices.
Divides an unordered set into three: items smaller than pivot, equal, and greater
fn partition_indexed(self, pivot: T) -> (Vec<usize>, Vec<usize>, Vec<usize>) where
T: PartialOrd + Copy,
fn partition_indexed(self, pivot: T) -> (Vec<usize>, Vec<usize>, Vec<usize>) where
T: PartialOrd + Copy,
Divides an unordered set into three by the pivot. The results are subscripts to self
Merges (unites) two sorted sets, result is also sorted
fn merge_indexed(
self,
idx1: &[usize],
v2: &[T],
idx2: &[usize]
) -> (Vec<T>, Vec<usize>) where
T: PartialOrd + Copy,
fn merge_indexed(
self,
idx1: &[usize],
v2: &[T],
idx2: &[usize]
) -> (Vec<T>, Vec<usize>) where
T: PartialOrd + Copy,
Merges (unites) two sets, using their sort indices, giving also the resulting sort index
fn merge_indices(self, idx1: &[usize], idx2: &[usize]) -> Vec<usize> where
T: PartialOrd + Copy,
fn merge_indices(self, idx1: &[usize], idx2: &[usize]) -> Vec<usize> where
T: PartialOrd + Copy,
Used by merge_indexed
Utility used by sortidx
Stable Merge sort main method, giving sort index
Stable Merge sort, explicitly sorted result obtained via sortidx
Rank index obtained via sortidx
Utility, swaps any two items into ascending order
fn isortthree(self, idx: &mut [usize], i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
fn isortthree(self, idx: &mut [usize], i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
Utility, sorts any three items into ascending order
fn hashsort_indexed(self, min: f64, max: f64) -> Vec<usize> where
T: PartialOrd + Copy,
f64: From<T>,
fn hashsort_indexed(self, min: f64, max: f64) -> Vec<usize> where
T: PartialOrd + Copy,
f64: From<T>,
Stable Hash sort
Implementations on Foreign Types
sourceimpl<T> Vecops<T> for &[T]
impl<T> Vecops<T> for &[T]
sourcefn maxt(self) -> T where
T: PartialOrd + Copy,
fn maxt(self) -> T where
T: PartialOrd + Copy,
Maximum value T of slice &[T]
sourcefn mint(self) -> T where
T: PartialOrd + Copy,
fn mint(self) -> T where
T: PartialOrd + Copy,
Minimum value T of slice &[T]
sourcefn minmaxt(self) -> (T, T) where
T: PartialOrd + Copy,
fn minmaxt(self) -> (T, T) where
T: PartialOrd + Copy,
Minimum and maximum (T,T) of a slice &[T]
sourcefn minmax(self) -> MinMax<T> where
T: PartialOrd + Copy,
fn minmax(self) -> MinMax<T> where
T: PartialOrd + Copy,
Minimum, minimum’s first index, maximum, maximum’s first index
sourcefn minmax_slice(self, i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
fn minmax_slice(self, i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
Finds min and max of a subset of self, defined by its subslice between i,i+n. Returns min of self, its index, max of self, its index.
sourcefn minmax_indexed(self, idx: &[usize], i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
fn minmax_indexed(self, idx: &[usize], i: usize, n: usize) -> MinMax<T> where
T: PartialOrd + Copy,
Using only a subset of self, defined by its idx subslice between i,i+n. Returns min of self, its index’s index, max of self, its index’s index.
sourcefn revs(self) -> Vec<T> where
T: Copy,
fn revs(self) -> Vec<T> where
T: Copy,
Reverse a generic slice by reverse iteration. Creates a new Vec. Its naive use for descending sort etc. is to be avoided for efficiency reasons.
sourcefn sansrepeat(self) -> Vec<T> where
T: PartialEq + Copy,
fn sansrepeat(self) -> Vec<T> where
T: PartialEq + Copy,
Removes repetitions from an explicitly ordered set.
sourcefn member(self, m: T) -> Option<usize> where
T: PartialEq + Copy,
fn member(self, m: T) -> Option<usize> where
T: PartialEq + Copy,
Finds the first occurence of item m
in self by iteration.
Returns Some(index)
to the slice or None
(when it has gone to the end).
Note that it uses only partial order and thus accepts any item that is neither
greater nor smaller than m
(equality by default).
Suitable for small unordered sets.
For longer lists or repeated membership tests, it is better to
index sort them and then use faster binary memsearch
(see below).
sourcefn memsearch(self, val: T) -> Option<usize> where
T: PartialOrd,
fn memsearch(self, val: T) -> Option<usize> where
T: PartialOrd,
Binary search of an explicitly sorted list (in ascending order).
Returns Some(index)
of any item that is equal to val.
When none are found, returns None
.
Example use: membership of an ascending ordered set.
sourcefn memsearchdesc(self, val: T) -> Option<usize> where
T: PartialOrd,
fn memsearchdesc(self, val: T) -> Option<usize> where
T: PartialOrd,
Binary search of an explicitly sorted list (in descending order).
Returns Some(index)
of any item that is
neither smaller nor greater than val.
When none are found, returns None
.
Example use: membership of an descending ordered set.
sourcefn memsearch_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
fn memsearch_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
Binary search of an indexed list (in ascending order).
Returns Some(index)
of any item that is
neither smaller nor greater than val.
When none are found, returns None
.
Example use: membership of an indexed ordered set.
sourcefn memsearchdesc_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
fn memsearchdesc_indexed(self, i: &[usize], val: T) -> Option<usize> where
T: PartialOrd,
Binary search of an indexed list (in descending order).
Returns Some(index)
of any item that is
neither smaller nor greater than val.
When none are found, returns None
.
Example use: membership of an indexed descending set.
sourcefn binsearch(self, val: T) -> usize where
T: PartialOrd,
fn binsearch(self, val: T) -> usize where
T: PartialOrd,
Binary search of an explicitly sorted list in ascending order. Returns an index of the first item that is greater than val. When none are greater, returns s.len() (invalid index but logical). The complement index (the result subtracted from s.len()), gives the first item in descending order that is not greater than val. Note that both complements of binsearch and binsearchdesc, in their respective opposite orderings, refer to the same preceding item iff there exists precisely one item equal to val. However, there can be more than one such items or none. Example use: looking up cummulative probability density functions.
sourcefn binsearchdesc(self, val: T) -> usize where
T: PartialOrd,
fn binsearchdesc(self, val: T) -> usize where
T: PartialOrd,
Binary search of an explicitly sorted list in descending order. Returns an index of the first item that is smaller than val in descending order. When none are smaller, returns s.len() (invalid index but logical). The complement index (the result subtracted from s.len()), gives the first item in ascending order that is not smaller than val. Note that both complements of binsearch and binsearchdesc, in their respective opposite orderings, refer to the same preceding item iff there exists precisely one item equal to val. However, there can be more than one such items or none. Example use: looking up cummulative probability density functions.
sourcefn binsearch_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
fn binsearch_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
Binary search of an index sorted list in ascending order. Returns an index of the first item that is greater than val. When none are greater, returns s.len() (invalid index but logical). The complement index (the result subtracted from s.len()), gives the first item in descending order that is not greater than val. Note that both complements of binsearch and binsearchdesc, in their respective opposite orderings, refer to the same preceding item iff there exists precisely one item equal to val. However, there can be more than one such items or none. Example use: looking up cummulative probability density functions.
sourcefn binsearchdesc_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
fn binsearchdesc_indexed(self, i: &[usize], val: T) -> usize where
T: PartialOrd,
Binary search of an index sorted list in descending order. Returns an index of the first item that is smaller than val (in descending order). When none are smaller, returns s.len() (invalid index but logical). The complement index (the result subtracted from s.len()), gives the first item in ascending order that is not smaller than val. Note that both complements of binsearch and binsearchdesc, in their respective opposite orderings, refer to the same preceding item iff there exists precisely one item equal to val. However, there can be more than one such items or none. Example use: looking up cummulative probability density functions.
sourcefn occurs(self, val: T) -> usize where
T: PartialOrd,
fn occurs(self, val: T) -> usize where
T: PartialOrd,
Counts occurrences of val by simple linear search of any unordered set
sourcefn occurs_multiple(self, sdesc: &[T], val: T) -> usize where
T: PartialOrd + Copy,
fn occurs_multiple(self, sdesc: &[T], val: T) -> usize where
T: PartialOrd + Copy,
Counts occurrences of val, using previously obtained
ascending explicit sort sasc
and descending sort sdesc
.
The two sorts must be of the same original set!
This is to facilitate counting of many
different values without having to repeat the sorting.
This function is efficient at counting
numerous repetitions in large sets (e.g. probabilities in stats).
Binary search from both ends is deployed: O(2log(n)).
Example:
use crate::indxvec::Indices;
use indxvec::Vecops;
let s = [1.,2.,3.14159,3.14159,4.,5.,6.];
let sindx = s.sortidx(); // only one sorting
let sasc = sindx.unindex(&s,true); // explicit ascending
let sdesc = sindx.unindex(&s,false); // explicit descending
assert_eq!(sasc.occurs_multiple(&sdesc,3.14159),2);
sourcefn unite_unsorted(self, v: &[T]) -> Vec<T> where
T: Clone,
fn unite_unsorted(self, v: &[T]) -> Vec<T> where
T: Clone,
Unites (joins) two unsorted sets. For union of sorted sets, use merge
sourcefn intersect(self, v2: &[T]) -> Vec<T> where
T: PartialOrd + Copy,
fn intersect(self, v2: &[T]) -> Vec<T> where
T: PartialOrd + Copy,
Intersects two ascending explicitly sorted generic vectors.
sourcefn intersect_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
fn intersect_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
Intersects two ascending index-sorted generic vectors. Returns a single explicitly ordered set.
sourcefn diff(self, v2: &[T]) -> Vec<T> where
T: PartialOrd + Copy,
fn diff(self, v2: &[T]) -> Vec<T> where
T: PartialOrd + Copy,
Sets difference: deleting elements of the second from the first. Two ascending explicitly sorted generic vectors.
sourcefn diff_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
fn diff_indexed(self, ix1: &[usize], v2: &[T], ix2: &[usize]) -> Vec<T> where
T: PartialOrd + Copy,
Sets difference: deleting elements of the second from the first. Two ascending index sorted generic vectors.
sourcefn partition(self, pivot: T) -> (Vec<T>, Vec<T>, Vec<T>) where
T: PartialOrd + Copy,
fn partition(self, pivot: T) -> (Vec<T>, Vec<T>, Vec<T>) where
T: PartialOrd + Copy,
Partition with respect to a pivot into three sets
sourcefn partition_indexed(self, pivot: T) -> (Vec<usize>, Vec<usize>, Vec<usize>) where
T: PartialOrd + Copy,
fn partition_indexed(self, pivot: T) -> (Vec<usize>, Vec<usize>, Vec<usize>) where
T: PartialOrd + Copy,
Partition by pivot gives three sets of indices.
sourcefn merge(self, v2: &[T]) -> Vec<T> where
T: PartialOrd + Copy,
fn merge(self, v2: &[T]) -> Vec<T> where
T: PartialOrd + Copy,
Merges two explicitly ascending sorted generic vectors, by classical selection and copying of their head items into the result. Consider using merge_indexed instead, especially for non-primitive end types T.
sourcefn merge_indexed(
self,
idx1: &[usize],
v2: &[T],
idx2: &[usize]
) -> (Vec<T>, Vec<usize>) where
T: PartialOrd + Copy,
fn merge_indexed(
self,
idx1: &[usize],
v2: &[T],
idx2: &[usize]
) -> (Vec<T>, Vec<usize>) where
T: PartialOrd + Copy,
Merges two ascending sort indices. Data is not shuffled at all, v2 is just concatenated onto v1 in one go and both remain in their original order. Returns the concatenated vector and a new valid sort index into it.
sourcefn merge_indices(self, idx1: &[usize], idx2: &[usize]) -> Vec<usize> where
T: PartialOrd + Copy,
fn merge_indices(self, idx1: &[usize], idx2: &[usize]) -> Vec<usize> where
T: PartialOrd + Copy,
Merges the sort indices of two concatenated vectors.
Data in s is not changed at all, only consulted for the comparisons.
This function is used by mergesort
and merge_indexed
.
sourcefn mergesort(self, i: usize, n: usize) -> Vec<usize> where
T: PartialOrd + Copy,
fn mergesort(self, i: usize, n: usize) -> Vec<usize> where
T: PartialOrd + Copy,
Doubly recursive non-destructive merge sort. The data is not moved or mutated. Efficiency is comparable to quicksort but more stable Returns a vector of indices to s from i to i+n, such that the indexed values are in ascending sort order (a sort index). Only the index values are being moved.
sourcefn sortidx(self) -> Vec<usize> where
T: PartialOrd + Copy,
fn sortidx(self) -> Vec<usize> where
T: PartialOrd + Copy,
A wrapper for mergesort, to obtain the sort index of the (whole) input vector. Simpler than sortm.
sourcefn sortm(self, ascending: bool) -> Vec<T> where
T: PartialOrd + Copy,
fn sortm(self, ascending: bool) -> Vec<T> where
T: PartialOrd + Copy,
Immutable sort. Returns new sorted vector (ascending or descending). Is a wrapper for mergesort. Passes the boolean flag ‘ascending’ onto ‘unindex’. Mergesort by itself always produces only an ascending index.
sourcefn rank(self, ascending: bool) -> Vec<usize> where
T: PartialOrd + Copy,
fn rank(self, ascending: bool) -> Vec<usize> where
T: PartialOrd + Copy,
Fast ranking of many T items, with only n*(log(n)+1)
complexity.
Ranking is done by inverting the sort index.
Sort index is in sorted order, giving data positions.
Ranking is in data order, giving sorted order positions.
Thus sort index and ranks are in an inverse relationship.
They are easily converted by .invindex()
(for: invert index).
sourcefn isorttwo(self, idx: &mut [usize], i0: usize, i1: usize) -> bool where
T: PartialOrd,
fn isorttwo(self, idx: &mut [usize], i0: usize, i1: usize) -> bool where
T: PartialOrd,
swap any two index items, if their data items (self) are not in ascending order
sourcefn isortthree(self, idx: &mut [usize], i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
fn isortthree(self, idx: &mut [usize], i0: usize, i1: usize, i2: usize) where
T: PartialOrd,
sort three index items if their self items are out of ascending order
sourcefn hashsort_indexed(self, min: f64, max: f64) -> Vec<usize> where
T: PartialOrd + Copy,
f64: From<T>,
fn hashsort_indexed(self, min: f64, max: f64) -> Vec<usize> where
T: PartialOrd + Copy,
f64: From<T>,
N recursive non-destructive hash sort.
Input data are read only. Output is sort index.
Requires min,max, the data range, that must enclose all its values.
The range is often known. If not, it can be obtained with minmaxt()
.