Bug fix for removing must edges...They also need to update constraints
[satune.git] / src / Encoders / elementencoding.cc
index 66a97d08602672d2eed1390f4788b7b50249bfa0..da6efd19154b0f1f3075114151e426923bc46fe9 100644 (file)
@@ -5,6 +5,8 @@
 #include "satencoder.h"
 #include "set.h"
 
+const char *elemEncTypeNames[] = {"UNASSIGNED", "ONEHOT", "UNARY", "BINARYINDEX", "BINARYVAL"};
+
 ElementEncoding::ElementEncoding(Element *_element) :
        type(ELEM_UNASSIGNED),
        element(_element),
@@ -49,3 +51,17 @@ void ElementEncoding::encodingArrayInitialization() {
                setInUseElement(i);
        }
 }
+
+void ElementEncoding::print() {
+       model_print("%s ", elemEncTypeNames[type]);
+       if (type == BINARYINDEX) {
+               for (uint i = 0; i < encArraySize; i++) {
+                       if (i != 0)
+                               model_print(" ,");
+                       if (isinUseElement(i))
+                               model_print("%" PRIu64 "", encodingArray[i]);
+                       else
+                               model_print("_");
+               }
+       }
+}