Include encoding for values
[satune.git] / src / Encoders / elementencoding.h
index 49a890f321a8fb08377aca5de6b1c29fd2fde429..61bdb3e88af8dfb783bcdf5c94f4b0e8ee213ded 100644 (file)
@@ -14,9 +14,20 @@ struct ElementEncoding {
        ElementEncodingType type;
        Element * element;
        Edge * variables;/* List Variables Used To Encode Element */
-       uint64_t * encodingArray;       /* List the Variables in the appropriate order */
-       uint64_t * inUseArray;/* Bitmap to track variables in use */
-       uint encArraySize;
+       union {
+               struct {
+                       uint64_t * encodingArray;       /* List the Variables in the appropriate order */
+                       uint64_t * inUseArray;/* Bitmap to track variables in use */
+                       uint encArraySize;
+               };
+               struct {
+                       uint64_t offset;/* Value = offset + encoded number (interpretted according to isBinaryValSigned) */
+                       uint64_t low;/* Lowest value to encode */
+                       uint64_t high;/* High value to encode.   If low > high, we assume wrap around to include 0. */
+                       uint numBits;
+                       bool isBinaryValSigned;
+               };
+       };
        uint numVars;   /* Number of variables */
 };
 
@@ -36,6 +47,4 @@ static inline void setInUseElement(ElementEncoding *This, uint offset) {
        This->inUseArray[(offset>>6)] |= 1 << (offset & 63);
 }
 
-uint getMaximumBitsBinaryValueEncodingVars(ElementEncoding *encoding);
-
 #endif