Module indxvec::merge [−][src]
Functions
binsearch | Returns the index of the first item that is greater than val, using binary search of an already ascending sorted list. When all are smaller, returns self.len(). When the last item is equal, returns self.len()-1. Example use: looking up cummulative probability density functions. |
merge | Merges two 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. |
merge_indexed | 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. |
rank | Ranking by inverting the sort index. |
revs | Reverse a generic slice by reverse iteration. Is immutable, creates a new Vec. Its naive use for descending sort etc. is avoided for efficiency reasons. Included here just for convenience. |
sortidx | A simple wrapper for mergesort, when we want just the sort index of the entire input vector. Simpler than sortm. |
sortm | Immutable sort. Returns new sorted vector (ascending or descending) Simple wrapper for mergesort. Passes the boolean flag ‘ascending’ onto ‘unindex’. |