1 #include "elementencoding.h"
3 #include "naiveencoder.h"
5 #include "satencoder.h"
7 void initElementEncoding(ElementEncoding *This, Element *element) {
8 This->element = element;
9 This->type = ELEM_UNASSIGNED;
10 This->variables = NULL;
11 This->encodingArray = NULL;
12 This->inUseArray = NULL;
14 This->encArraySize = 0;
17 void deleteElementEncoding(ElementEncoding *This) {
18 if (This->variables != NULL)
19 ourfree(This->variables);
20 if (This->encodingArray != NULL)
21 ourfree(This->encodingArray);
22 if (This->inUseArray != NULL)
23 ourfree(This->inUseArray);
26 void allocEncodingArrayElement(ElementEncoding *This, uint size) {
27 This->encodingArray = ourcalloc(1, sizeof(uint64_t) * size);
28 This->encArraySize = size;
31 void allocInUseArrayElement(ElementEncoding *This, uint size) {
32 uint bytes = ((size + ((1 << 9) - 1)) >> 6) & ~7;//Depends on size of inUseArray
33 This->inUseArray = ourcalloc(1, bytes);
36 void setElementEncodingType(ElementEncoding *This, ElementEncodingType type) {