3 #ifndef INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_ 4 #define INCLUDE_NN_NLIB_SUCCINCT_LOUDS_H_ 6 #include "nn/nlib/Swap.h" 9 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 10 #undef NLIB_VIS_PUBLIC 11 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 21 NLIB_MOVE_MEMBER_HELPER_1(
Louds, sbv_);
23 template <
class TREEITER>
26 bool InitDirect(
const uint32_t* bv, uint32_t bv_size)
NLIB_NOEXCEPT;
33 bool IsLeaf(uint32_t pos)
const NLIB_NOEXCEPT {
34 return this->FirstChild(pos) < 0;
36 size_t MemSize() const NLIB_NOEXCEPT {
return sbv_.MemSize(); }
37 void Reset() NLIB_NOEXCEPT { sbv_.Reset(); }
46 template <
class TREEITER>
51 sbv_.Init(2 * num_nodes + 1);
57 idx += iter.GetNumChildren();
59 }
while (iter.BfsMoveNext());
61 NLIB_ASSERT(idx == 2 * num_nodes + 1);
72 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 73 #undef NLIB_VIS_PUBLIC 74 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 77 #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).