Added RLCSA index option
[SXSI/TextCollection.git] / incbwt / misc / definitions.h
index 768c099..f628400 100644 (file)
@@ -5,6 +5,10 @@
 #include <climits>
 
 
+// #define MULTITHREAD_SUPPORT   // Try to parallelize things using OpenMP.
+// #define MASSIVE_DATA_RLCSA    // usint and sint become 64-bit in a 64-bit environment.
+
+
 namespace CSA
 {
 
@@ -17,10 +21,14 @@ typedef unsigned int  usint;
 typedef signed int    sint;
 #endif
 
+#ifndef uint
+typedef unsigned int uint;
+#endif
 
 #ifndef uchar
-typedef unsigned char           uchar;
+typedef unsigned char uchar;
 #endif
+
 typedef std::pair<usint, usint> pair_type;
 
 
@@ -41,6 +49,11 @@ inline usint length(const pair_type& data)
   return data.second + 1 - data.first;
 }
 
+inline usint nextMultipleOf(usint multiplier, usint value)
+{
+  return multiplier * ((value / multiplier) + 1);
+}
+
 
 const usint CHARS = ((usint)1 << CHAR_BIT);
 const usint MEGABYTE = 1048576;