X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=BitRank.h;h=49d3647dc55ac45ab0a78fd257347db41ce72575;hb=a56dda3a95d2df268969bd3c2c994b5d2f020410;hp=c7783d28b289d7736bb23890a2e2bb924b83e809;hpb=7d27a4450ed429e3b63e9d3ba7217a28cbbf9a31;p=SXSI%2FTextCollection.git diff --git a/BitRank.h b/BitRank.h index c7783d2..49d3647 100644 --- a/BitRank.h +++ b/BitRank.h @@ -21,6 +21,7 @@ #ifndef _BITSTREAM_H_ #define _BITSTREAM_H_ +#include "BlockArray.h" #include "Tools.h" class BitRank { @@ -33,18 +34,20 @@ private: 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.