1 #ifndef ELEMENTENCODING_H
2 #define ELEMENTENCODING_H
4 #include "naiveencoder.h"
5 #include "constraint.h"
7 class ElementEncoding {
9 ElementEncoding(Element *element);
10 ElementEncodingType getElementEncodingType() {return type;}
12 void setElementEncodingType(ElementEncodingType type);
13 void deleteElementEncoding();
14 void allocEncodingArrayElement(uint size);
15 void allocInUseArrayElement(uint size);
16 uint numEncodingVars() {return numVars;}
17 bool isinUseElement(uint offset) { return (inUseArray[(offset >> 6)] >> (offset & 63)) & 0x1;}
18 void setInUseElement(uint offset) {inUseArray[(offset >> 6)] |= 1 << (offset & 63);}
19 void encodingArrayInitialization();
20 uint getSizeEncodingArray(uint setSize) {
23 return NEXTPOW2(setSize);
34 ElementEncodingType type;
36 Edge *variables;/* List Variables Used To Encode Element */
39 uint64_t *encodingArray; /* List the Variables in the appropriate order */
40 uint64_t *inUseArray; /* Bitmap to track variables in use */
44 uint64_t offset;/* Value = offset + encoded number (interpretted according to isBinaryValSigned) */
45 uint64_t low;/* Lowest value to encode */
46 uint64_t high;/* High value to encode. If low > high, we assume wrap around to include 0. */
48 bool isBinaryValSigned;
51 uint numVars; /* Number of variables */