Range min–max tree over a bitvector (LSB-first) tailored for balanced-parentheses (BP).
More...
|
|
| RmMTree ()=default |
| | Construct empty structure.
|
| |
| | RmMTree (const std::string &bit_string, const size_t &leaf_block_bits=0, const float &max_overhead=-1.0) |
| | Build from a '0'/'1' string.
|
| |
| | RmMTree (const std::vector< std::uint64_t > &words, size_t bit_count, const size_t &leaf_block_bits=0, const float &max_overhead=-1.0) |
| | Build from 64-bit words (LSB-first).
|
| |
| size_t | rank1 (const size_t &end_position) const |
| | Number of ones in prefix [0, end_position).
|
| |
| size_t | rank0 (const size_t &end_position) const |
| | Number of zeros in prefix [0, end_position).
|
| |
| size_t | select1 (size_t target_one_rank) const |
| | 1-based select of the target_one_rank-th one.
|
| |
| size_t | select0 (size_t target_zero_rank) const |
| | 1-based select of the target_zero_rank-th zero.
|
| |
| size_t | rank10 (const size_t &end_position) const |
| | Rank of the pattern "10" (starts) within [0, end_position).
|
| |
| size_t | select10 (size_t target_pattern_rank) const |
| | 1-based select of the target_pattern_rank-th "10" start.
|
| |
|
int | excess (const size_t &end_position) const |
| | Prefix excess on [0, end_position): +1 for '1', −1 for '0'.
|
| |
| size_t | fwdsearch (const size_t &start_position, const int &delta) const |
| | Forward search: first position p ≥ start_position where excess(p) = excess(start_position) + delta.
|
| |
| size_t | bwdsearch (const size_t &start_position, const int &delta) const |
| | Backward search: last position p ≤ start_position where excess(p) = excess(start_position) + delta.
|
| |
| size_t | range_min_query_pos (const size_t &range_begin, const size_t &range_end) const |
| | Position of the first minimum of excess on [range_begin, range_end] (inclusive).
|
| |
| int | range_min_query_val (const size_t &range_begin, const size_t &range_end) const |
| | Value of the minimum prefix excess on [range_begin, range_end] relative to range_begin.
|
| |
| size_t | range_max_query_pos (const size_t &range_begin, const size_t &range_end) const |
| | Position of the first maximum of excess on [range_begin, range_end] (inclusive).
|
| |
|
int | range_max_query_val (const size_t &range_begin, const size_t &range_end) const |
| | Value of the maximum prefix excess on [range_begin, range_end] relative to range_begin.
|
| |
|
size_t | mincount (const size_t &range_begin, const size_t &range_end) const |
| | How many times the minimum prefix excess occurs on [range_begin, range_end].
|
| |
| size_t | minselect (const size_t &range_begin, const size_t &range_end, size_t target_min_rank) const |
| | Position of the target_min_rank-th (1-based) occurrence of the minimum on [range_begin, range_end].
|
| |
| size_t | close (const size_t &open_position) const |
| | close(open_position): matching ')' for '(' at open_position.
|
| |
| size_t | open (const size_t &close_position) const |
| | open(close_position): matching '(' for ')' at close_position.
|
| |
| size_t | enclose (const size_t &position) const |
| | enclose(position): opening '(' that strictly encloses position.
|
| |
Range min–max tree over a bitvector (LSB-first) tailored for balanced-parentheses (BP).
Implements the classic rmq/rMq family and BP navigation in O(log n) using a perfectly balanced binary tree of blocks. Supported queries:
- rank1 / rank0
- select1 / select0
- rank10 / select10 (starts of "10")
- excess (prefix +1 for '1', −1 for '0')
- fwdsearch / bwdsearch (prefix–sum search)
- range_min_query_pos / range_min_query_val (first minimum within a range)
- range_max_query_pos / range_max_query_val (first maximum within a range)
- mincount / minselect (count/selection of minima)
- close / open / enclose (BP navigation)
The bitvector is LSB-first inside each 64-bit word.