Insert into your Cargo.toml file [dependencies] section:
rust
indxvec = "^0.1"
and import into your source file(s) any structs, functions and/or traits that you want:
rust
use indxvec::{Indices,GV};
use indxvec::merge::{revs,sortm,mergesort,merge_indexed,rank,binsearch,ucorrelation};
Indxvec is a spin-off from rstats
, as a self-contained unit, both in subject matter and in not having any dependencies. Only tests.rs
needs anyhow
.
The tools included are: efficient ranking, sorting, merging, searching and indices manipulations. They are applicable to generic vectors: Vec\ Consult The main content is in the module The functions of this trait are implemented for vectors of subscripts, i.e. Version 0.1.1 Tidied up README.md and added some more tests Version 0.1.0 Initial releaseTesting and Examples
tests/tests.rs
. To run the tests, use single thread. It will be slower but will produce the results in the right order:rust
cargo test --release -- --test-threads=1 --nocapture --color always
Macro, struct and functions
src/merge.rs
. See the documentation.Trait Index
&[usize]
.
invindex
- method for inverting an index, e.g. given a sort index, returns ranks and vice versa.unindex
- collects values from a vector in the order given by an index. This will, for example, sort a vector into sort order when supplied with a sort index.ucorrelation
- Pearson's correlation coefficient of two indices, typically ranks. This is the same as Spearman's correlation of the original data.Recent Releases