|
SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
|
Nearest neighbour dictionary for sparse uniform sets (described in Geary et al., A Simple Optimal Representation for Balanced Parentheses, CPM 2004). More...
#include <nearest_neighbour_dictionary.hpp>
Public Types | |
| typedef bit_vector::size_type | size_type |
Public Member Functions | |
| nearest_neighbour_dictionary () | |
| Default constructor. | |
| nearest_neighbour_dictionary (const bit_vector &v) | |
| Constructor. | |
| nearest_neighbour_dictionary (const nearest_neighbour_dictionary &nnd) | |
| Copy constructor. | |
| ~nearest_neighbour_dictionary () | |
| Destructor. | |
| nearest_neighbour_dictionary & | operator= (const nearest_neighbour_dictionary &nnd) |
| void | swap (nearest_neighbour_dictionary &nnd) |
| size_type | rank (size_type idx) const |
| Answers rank queries for the supported bit_vector. | |
| size_type | select (size_type i) const |
| Answers select queries for the supported bit_vector. | |
| size_type | prev (size_type i) const |
| Answers "previous occurence of one" queries for the supported bit_vector. | |
| size_type | next (size_type i) const |
| size_type | size () const |
| size_type | ones () const |
| size_type | serialize (std::ostream &out, structure_tree_node *v=NULL, std::string name="") const |
| Serializes the nearest_neighbour_dictionary. | |
| void | load (std::istream &in) |
| Loads the nearest_neighbour_dictionary. | |
Nearest neighbour dictionary for sparse uniform sets (described in Geary et al., A Simple Optimal Representation for Balanced Parentheses, CPM 2004).
Template parameter sample_dens corresponds to parameter t in the paper. The data structure the following methods:
| sdsl::nearest_neighbour_dictionary< sample_dens >::nearest_neighbour_dictionary | ( | const bit_vector & | v | ) | [inline] |
Constructor.
| v | The supported bit_vector. |
| void sdsl::nearest_neighbour_dictionary< sample_dens >::load | ( | std::istream & | in | ) | [inline] |
Loads the nearest_neighbour_dictionary.
| in | In-Stream to load the rank_support data from. |
| size_type sdsl::nearest_neighbour_dictionary< sample_dens >::next | ( | size_type | i | ) | const [inline] |
Answers "next occurence of one" queries for the supported bit_vector.
| i | Position . |
where the supported bit_vector v equals 1.
#51| size_type sdsl::nearest_neighbour_dictionary< sample_dens >::prev | ( | size_type | i | ) | const [inline] |
Answers "previous occurence of one" queries for the supported bit_vector.
| i | Position . |
where the supported bit_vector v equals 1.
#51| size_type sdsl::nearest_neighbour_dictionary< sample_dens >::rank | ( | size_type | idx | ) | const [inline] |
Answers rank queries for the supported bit_vector.
| idx | Argument for the length of the prefix v[0..idx-1]. |
| size_type sdsl::nearest_neighbour_dictionary< sample_dens >::select | ( | size_type | i | ) | const [inline] |
Answers select queries for the supported bit_vector.
| i | Select the th 1 in the supported bit_vector. |
th 1 in the supported bit_vector.
#51| size_type sdsl::nearest_neighbour_dictionary< sample_dens >::serialize | ( | std::ostream & | out, |
| structure_tree_node * | v = NULL, |
||
| std::string | name = "" |
||
| ) | const [inline] |
Serializes the nearest_neighbour_dictionary.
| out | Out-Stream to serialize the data to. |
1.8.0