Debug swcsa
[SXSI/TextCollection.git] / BitRank.h
index c7783d2..49d3647 100644 (file)
--- 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.