Wavelet Matrix for Rust language

Build Status

It provides the various analytics on very large sequence of unsigned integers in constant time.

Usage

After adding to Cargo.toml, add this line to lib.rs or main.rs.

rust extern crate wavelet_matrix;

See crate document top for further examples.

Benchmarks

Features

Given an unsigned integer sequence T, it provides the following queries.

Basic operations

Counting

Counting is performed in O(1).

Searching

Searching is performed in O(1) per a next index.

Ranking

Ranking is performed in roughly O(1) with regard to the number of elements n.

.top_k() is also performed in O(1) in best case, but may take O(n) in the worst case where every value occurs only once!

To achieve O(1) performance regardless of the number of unique values, use .top_k_ranges() instead:

Statistics

O(1) Median / O(1) Quantile

O(1) Sum / O(1) Average / O(1) Variance

Experiment 1

These methods use .top_k_ranges() to enumerate the most relevant value ranges.

They are not as accurate as the method used in Experiment 2.

Experiment 2

Improvement over Experiment 1. They use custom node enumerator to minimize the error.

Experiment 3

Improvement over Experiment 2. They use Range<u64> to tell how accurate the computed value is.

Classical WaveletMatrix operations

Releases

v0.4.6

v0.4.5

v0.4.4

v0.4.3

v0.4.2

v0.4.1

v0.4.0

v0.3.0

TODO

Credits