1 #include "elementencoding.h"
3 #include "naiveencoder.h"
5 #include "satencoder.h"
8 ElementEncoding::ElementEncoding(Element *_element) :
18 ElementEncoding::~ElementEncoding() {
19 if (variables != NULL)
21 if (encodingArray != NULL)
22 ourfree(encodingArray);
23 if (inUseArray != NULL)
27 void ElementEncoding::allocEncodingArrayElement(uint size) {
28 encodingArray = (uint64_t *) ourcalloc(1, sizeof(uint64_t) * size);
32 void ElementEncoding::allocInUseArrayElement(uint size) {
33 uint bytes = ((size + ((1 << 9) - 1)) >> 6) & ~7;//Depends on size of inUseArray
34 inUseArray = (uint64_t *) ourcalloc(1, bytes);
37 void ElementEncoding::setElementEncodingType(ElementEncodingType _type) {
41 void ElementEncoding::encodingArrayInitialization() {
42 Set *set = getElementSet(element);
43 ASSERT(!set->isRange);
44 uint size = set->members->getSize();
45 uint encSize = getSizeEncodingArray(size);
46 allocEncodingArrayElement(encSize);
47 allocInUseArrayElement(encSize);
48 for (uint i = 0; i < size; i++) {
49 encodingArray[i] = set->members->get(i);