Optimize sdarray.cpp to use g++ builtin instead of doing naive counting.
[SXSI/libcds.git] / src / static_bitsequence / static_bitsequence.h
index d8e3f18..1bcb0b4 100644 (file)
 /** Base class for static bitsequences, contains many abstract functions, so this can't
  *  be instantiated. It includes base implementations for rank0, select0 and select1 based
  *  on rank0.
- * 
+ *
  *  @author Francisco Claude
  */
 class static_bitsequence {
-  
+
 public:
   virtual ~static_bitsequence() {};
 
        /** Returns the number of zeros until position i */
   virtual uint rank0(uint i);
 
-       /** Returns the position of the i-th zero 
+       /** Returns the position of the i-th zero
         * @return (uint)-1 if i=0, len if i>num_zeros or the position */
   virtual uint select0(uint i);
 
        /** Returns the number of ones until position i */
   virtual uint rank1(uint i);
 
-       /** Returns the position of the i-th one 
+       /** Returns the position of the i-th one
         * @return (uint)-1 if i=0, len if i>num_ones or the position */
   virtual uint select1(uint i);
 
-       virtual uint select_next1(uint i);
-       virtual uint select_next0(uint i);
+  virtual uint select_next1(uint i);
+  virtual uint select_next0(uint i);
 
        /** Returns the i-th bit */
   virtual bool access(uint i);
@@ -77,17 +77,17 @@ public:
   virtual uint size()=0;
 
   /** Stores the bitmap given a file pointer, return 0 in case of success */
-       virtual int save(FILE * fp)=0;
-  
+  virtual int save(FILE * fp)=0;
+
   /** Reads a bitmap determining the type */
   static static_bitsequence * load(FILE * fp);
-  
+
 protected:
        /** Length of the bitstring */
   uint len;
        /** Number of ones in the bitstring */
-       uint ones;
-  
+  uint ones;
+
 };
 
 #include <static_bitsequence_rrr02.h>