Trait indxvec::Indices[][src]

pub trait Indices {
    fn invindex(self) -> Vec<usize>;
fn unindex<T: Copy>(self, ascending: bool, v: &[T]) -> Vec<T>;
fn ucorrelation(self, v: &[usize]) -> f64; }
Expand description

Methods to manipulate indices of Vec type

Required methods

Reverse index

Collects f64 values from v as per indices in self.

Pearson’s correlation coefficient of two slices, typically the ranks.

Implementations on Foreign Types

Constructs inverted index, eg. from sort index to data ranks This is a symmetric operation, i.e. any even number of applications leads back to the original index form.

Collects values from v in the order given by self index. When ascending is false, creates descending order. Used by msort for ascending or descending sort. Good for efficient sorting of any vectors.

Pearson’s correlation coefficient of two $usize slices. When the inputs are ranks, then this gives Spearman’s correlation of the original data. However, in general, any other ordinal measures can be deployed (not just the ranks).

Implementors