16 #ifndef INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_ 17 #define INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_ 19 #include "nn/nlib/Swap.h" 22 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 23 #undef NLIB_VIS_PUBLIC 24 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 34 NLIB_MOVE_MEMBER_HELPER_1(
Louds, sbv_);
36 template <
class TREEITER>
39 bool InitDirect(
const uint32_t* bv, uint32_t bv_size)
NLIB_NOEXCEPT;
46 bool IsLeaf(uint32_t pos)
const NLIB_NOEXCEPT {
47 return this->FirstChild(pos) < 0;
49 size_t MemSize() const NLIB_NOEXCEPT {
return sbv_.MemSize(); }
50 void Reset() NLIB_NOEXCEPT { sbv_.Reset(); }
59 template <
class TREEITER>
64 sbv_.Init(2 * num_nodes + 1);
70 idx += iter.GetNumChildren();
72 }
while (iter.BfsMoveNext());
74 NLIB_ASSERT(idx == 2 * num_nodes + 1);
85 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 86 #undef NLIB_VIS_PUBLIC 87 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 90 #endif // INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_ Defines the basic classes that form the basis to Rank and Select operations.
bool Export(BinaryWriter *w) const noexcept
Writes the object to the file.
Louds() noexcept
Instantiates the object.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
Succinct data structure to hold a set of 32-bit unsigned integers for a Rank/Select operation...
size_t MemSize() const noexcept
Returns the amount of memory explicitly allocated by the class.
bool Import(BinaryReader *r) noexcept
Reads the written object.
void swap(Louds &rhs) noexcept
Swaps the contents of an object.
~Louds() noexcept
Destructor.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
void Reset() noexcept
Returns the object to the state immediately after the constructor is called.
bool IsLeaf(uint32_t pos) const noexcept
Determines whether the specified node is a leaf (or external) node.
Provides a compact tree structure that can provide various operations in constant time...
The class for writing binary to streams (to OutputStream).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
The class for reading binary from streams (from InputStream).