#ifndef _BITSTREAM_H_
#define _BITSTREAM_H_
+#include "BlockArray.h"
#include "Tools.h"
class BitRank {
static const unsigned wordShift = 6;
static const unsigned superFactor = 4; // 256 bit blocks
#endif
+ static const unsigned s = W*superFactor;
ulong *data; //here is the bit-array
bool owner;
ulong n,integers;
- unsigned b,s;
- ulong *Rs; //superblock array
+ BlockArray *Rs; //superblock array
uchar *Rb; //block array
ulong BuildRankSub(ulong, ulong); //internal use of BuildRank
void BuildRank(); //crea indice para rank
public:
BitRank(ulong *, ulong, bool);
+ BitRank(FILE *);
~BitRank(); //destructor
+ void Save(FILE *);
ulong rank(ulong i); //Rank from 0 to n-1
ulong select(ulong x); // gives the position of the x:th 1.
ulong select0(ulong x); // gives the position of the x:th 0.