|0.2.6||Jul 21, 2021|
|0.2.5||Jul 8, 2021|
|0.1.9||Jul 4, 2021|
|0.1.8||Jun 28, 2021|
#91 in Math
107 downloads per month
Used in 2 crates
Insert into your Cargo.toml file [dependencies] section:
indxvec = "^0.2"
Import into your source file(s) macro
here, functions and trait, as needed. There is just one trait
Indices implemented on type
&[usize]. There is a bunch of functions in module
merge which usually take generic slices
&[T] as arguments and produce new index vectors and/or other results. The following
use statement imports everything from
See tests/tests.rs for examples of usage. To run the tests, use a single thread. It may be slower but will produce the results in the right order:
cargo test --release -- --test-threads=1 --nocapture --color always
Indxvec is a spin-off from
rstats. It is a self-contained unit, both in terms of the subject matter and also in not having any dependencies.
The tools included are: efficient ranking, sorting, merging, searching, set operations and indices manipulations. They are applicable to generic slices
&[T]. Thus they will work on primitive types but also on any arbitrarily complex end type
T, as long as you implement their required traits, mostly just
are in the module
src/merge.rs. They mostly take some generic slice(s)
&[T] and produce the indices into them of type
Vec<usize>, onto which the methods of the
Indices trait can be conveniently chained. See the documentation.
The methods of this trait are implemented for slices of subscripts, i.e. they take the type
&[usize] as input (self) and produce new index
Vec<usize>, new data vector
Vec<T>, or other results.
Version 0.2.6 - added
unindexf64 for convenience. Same as
unindex but the output is always converted to
Version 0.2.5 - added
memsearchdesc_indexed = binary search of a descending indexed set.
Version 0.2.4 - added helper function
wt = write tuple. Added
memsearchdesc = binary search of a descending set.
Version 0.2.3 - general tidying up and readme update.
Version 0.2.2 - prettification of tests: replaced GV and GI with functions
wi respectively. Added
Indices trait, so that it can be functionally chained with its other methods.
Version 0.2.1 - moved GI from
rstats to here. Fixed
Version 0.2.0 - added set operations:
sansrepeat, member, memsearch, memsearch_indexed, unite, unite_indexed, intersect, intersect_indexed, diff, diff_indexed. They are also used, with type/struct wrappers, by crate
Version 0.1.9 - added method
complindex to trait
Version 0.1.8 - added function
minmax to module
Version 0.1.7 - added convenience conversion method
Version 0.1.6 - improved comments. Used Vec::with_capacity for new vectors of known lengths. Maybe a bit faster but no change in functionality.
Version 0.1.5 - fixed an inconsistency in
Version 0.1.4 - swapped arguments of
unindex for compatibility. Added more comments.