Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16374


Ignore:
Timestamp:
12/12/18 16:05:46 (6 years ago)
Author:
chaider
Message:

#2966 renamed variable from intermeidate to result

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs

    r16367 r16374  
    149149      Interval> intervals = null) {
    150150      Instruction currentInstr = instructions[InstructionCount++];
    151       Interval intermediate = null;
     151      Interval result = null;
    152152
    153153      switch (currentInstr.opCode) {
    154154        //Elementary arithmetic rules
    155155        case OpCodes.Add: {
    156             intermediate = Evaluate(instructions, intervals);
    157             for (int i = 1; i < currentInstr.nArguments; i++) {
    158               intermediate = Interval.Add(intermediate, Evaluate(instructions, intervals));
     156            result = Evaluate(instructions, intervals);
     157            for (int i = 1; i < currentInstr.nArguments; i++) {
     158              result = Interval.Add(result, Evaluate(instructions, intervals));
    159159            }
    160160            break;
    161161          }
    162162        case OpCodes.Sub: {
    163             intermediate = Evaluate(instructions, intervals);
    164             for (int i = 1; i < currentInstr.nArguments; i++) {
    165               intermediate = Interval.Subtract(intermediate, Evaluate(instructions, intervals));
     163            result = Evaluate(instructions, intervals);
     164            for (int i = 1; i < currentInstr.nArguments; i++) {
     165              result = Interval.Subtract(result, Evaluate(instructions, intervals));
    166166            }
    167167            break;
    168168          }
    169169        case OpCodes.Mul: {
    170             intermediate = Evaluate(instructions, intervals);
    171             for (int i = 1; i < currentInstr.nArguments; i++) {
    172               intermediate = Interval.Multiply(intermediate, Evaluate(instructions, intervals));
     170            result = Evaluate(instructions, intervals);
     171            for (int i = 1; i < currentInstr.nArguments; i++) {
     172              result = Interval.Multiply(result, Evaluate(instructions, intervals));
    173173            }
    174174            break;
    175175          }
    176176        case OpCodes.Div: {
    177             intermediate = Evaluate(instructions, intervals);
    178             for (int i = 1; i < currentInstr.nArguments; i++) {
    179               intermediate = Interval.Divide(intermediate, Evaluate(instructions, intervals));
     177            result = Evaluate(instructions, intervals);
     178            for (int i = 1; i < currentInstr.nArguments; i++) {
     179              result = Interval.Divide(result, Evaluate(instructions, intervals));
    180180            }
    181181            break;
     
    183183        //Trigonometric functions
    184184        case OpCodes.Sin: {
    185             intermediate = Interval.Sine(Evaluate(instructions, intervals));
     185            result = Interval.Sine(Evaluate(instructions, intervals));
    186186            break;
    187187          }
    188188        case OpCodes.Cos: {
    189             intermediate = Interval.Cosine(Evaluate(instructions, intervals));
     189            result = Interval.Cosine(Evaluate(instructions, intervals));
    190190            break;
    191191          }
    192192        case OpCodes.Tan: {
    193             intermediate = Interval.Tangens(Evaluate(instructions, intervals));
     193            result = Interval.Tangens(Evaluate(instructions, intervals));
    194194            break;
    195195          }
    196196        //Exponential functions
    197197        case OpCodes.Log: {
    198             intermediate = Interval.Logarithm(Evaluate(instructions, intervals));
     198            result = Interval.Logarithm(Evaluate(instructions, intervals));
    199199            break;
    200200          }
    201201        case OpCodes.Exp: {
    202             intermediate = Interval.Exponential(Evaluate(instructions, intervals));
     202            result = Interval.Exponential(Evaluate(instructions, intervals));
    203203            break;
    204204          }
    205205        case OpCodes.Power: {
    206             intermediate = Evaluate(instructions, intervals);
    207             for (int i = 1; i < currentInstr.nArguments; i++) {
    208               intermediate = Interval.Power(intermediate, Evaluate(instructions, intervals));
     206            result = Evaluate(instructions, intervals);
     207            for (int i = 1; i < currentInstr.nArguments; i++) {
     208              result = Interval.Power(result, Evaluate(instructions, intervals));
    209209            }
    210210            break;
    211211          }
    212212        case OpCodes.Square: {
    213             intermediate = Interval.Square(Evaluate(instructions, intervals));
     213            result = Interval.Square(Evaluate(instructions, intervals));
    214214            break;
    215215          }
    216216        case OpCodes.Root: {
    217             intermediate = Evaluate(instructions, intervals);
    218             for (int i = 1; i < currentInstr.nArguments; i++) {
    219               intermediate = Interval.Root(intermediate, Evaluate(instructions, intervals));
     217            result = Evaluate(instructions, intervals);
     218            for (int i = 1; i < currentInstr.nArguments; i++) {
     219              result = Interval.Root(result, Evaluate(instructions, intervals));
    220220            }
    221221            break;
    222222          }
    223223        case OpCodes.SquareRoot: {
    224             intermediate = Interval.SquareRoot(Evaluate(instructions, intervals));
     224            result = Interval.SquareRoot(Evaluate(instructions, intervals));
    225225            break;
    226226          }
     
    241241
    242242      if (intervals != null)
    243         intervals.Add(currentInstr.dynamicNode, intermediate);
    244       return intermediate;
     243        intervals.Add(currentInstr.dynamicNode, result);
     244      return result;
    245245    }
    246246
Note: See TracChangeset for help on using the changeset viewer.