Changeset 9632


Ignore:
Timestamp:
Feb 13, 2017 10:02:07 AM (3 years ago)
Author:
Zimon Kuhs
Message:

#5284

Bugfix for r9628 (nested branches were not eliminated properly).

Location:
trunk/Compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/ModelicaFrontEnd/src/java/org/jmodelica/util/munkres/IntegerCost.java

    r9628 r9632  
    6565        for (int j = 0; j < values.length; j++) {
    6666            costs[j] = new IntegerCost[values[j].length];
    67             for (int i = 0; i < values[j].length; i++)
     67            for (int i = 0; i < values.length; i++)
    6868                costs[j][i] = new IntegerCost(values[j][i]);
    6969        }
  • trunk/Compiler/ModelicaMiddleEnd/src/jastadd/transformations/IfEquationElimination.jrag

    r9628 r9632  
    4747        }
    4848
     49    }
     50
     51    syn List<FAbstractEquation> FIfWhenElseEquation.myIfEliminatedEquations() {
     52        List<FAbstractEquation> equations = new List<FAbstractEquation>();
     53        for (FAbstractEquation equation : getFAbstractEquations()) {
     54            equation.eliminateIfEquations(equations);
     55        }
     56        return equations;
    4957    }
    5058
     
    105113        try {
    106114            if (getTest().ceval().booleanValue() && !falseBranchesOnly) {
    107                 equations.addAll(getFAbstractEquations());
     115                equations.addAll(myIfEliminatedEquations());
    108116                return null;
    109117            } else if (hasElse()) {
     
    139147        }
    140148
    141         equations.addAll(getFAbstractEquations());
     149        equations.addAll(myIfEliminatedEquations());
    142150        return null;
    143151    }
Note: See TracChangeset for help on using the changeset viewer.