Edit
[satune.git] / src / ASTTransform / varorderingopt.cc
index 41f3edb..890afd9 100644 (file)
@@ -4,10 +4,10 @@
  * and open the template in the editor.
  */
 
-/* 
+/*
  * File:   VarOrderingOpt.cpp
  * Author: hamed
- * 
+ *
  * Created on October 11, 2018, 5:31 PM
  */
 
 #include "elementencoding.h"
 #include "element.h"
 
-VarOrderingOpt::VarOrderingOpt(CSolver *_solver, SATEncoder *_satencoder): Transform(_solver){
+VarOrderingOpt::VarOrderingOpt(CSolver *_solver, SATEncoder *_satencoder) : Transform(_solver) {
        satencoder = _satencoder;
 }
 
 VarOrderingOpt::~VarOrderingOpt() {
 }
 
-void VarOrderingOpt::doTransform(){
+void VarOrderingOpt::doTransform() {
        BooleanVarOrdering direction = (BooleanVarOrdering)solver->getTuner()->getTunable(VARIABLEORDER, &boolVarOrderingDesc);
-       if ( direction == CONSTRAINTORDERING ){
+       if ( direction == CONSTRAINTORDERING ) {
                return;
        }
-       
+
        uint size = solver->allElements.getSize();
-       if(direction == CHORONOLOGICALORDERING){
+       if (direction == ELEMENTORDERING) {
                for (uint i = 0; i < size; i++) {
                        Element *el = solver->allElements.get(i);
                        ElementEncoding *encoding = el->getElementEncoding();
@@ -40,8 +40,8 @@ void VarOrderingOpt::doTransform(){
                                continue;
                        satencoder->encodeElementSATEncoder(el);
                }
-       }else{
-               for (int i = size-1; i>0; i--) {
+       } else {
+               for (int i = size - 1; i > 0; i--) {
                        Element *el = solver->allElements.get(i);
                        ElementEncoding *encoding = el->getElementEncoding();
                        if (encoding->getElementEncodingType() == ELEM_UNASSIGNED)