nlib
nn::nlib::SmartBitmap< N, BIT > Class Template Referencefinal

The data structure holding bit data operated on by Rank and Select. More...

#include "nn/nlib/SmartBitmap.h"

+ Inheritance diagram for nn::nlib::SmartBitmap< N, BIT >:

Detailed Description

template<size_t N, class BIT = uint32_t>
class nn::nlib::SmartBitmap< N, BIT >

The data structure holding bit data operated on by Rank and Select.

Template Parameters
NThe size of the bit data (N bits).
Description
Holds the instance of the bit data in a data member. This class is suited for the dynamic creation of bit data.
SmartBitmap<10> bmp;
bmp.Set(0);
bmp.Set(4);
bmp.Set(7);
bmp.Rank1(4); // Returns the number of 1 bits in the range [0..4]. 2 is returned.
bmp.Rank1(10000); // OK to be out of the range of the bitmap. 3 is returned.
bmp.Select1(2); // 7 is returned.
bmp.Select1(3); // -1 is returned.
Examples:
succinct/bitvector/bitvector.cpp.

Definition at line 145 of file SmartBitmap.h.


The documentation for this class was generated from the following file: