Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/15 16:03:49 (9 years ago)
Author:
gkronber
Message:

#2283: changed handling of inverse expressions in transformation of expressions to canonical form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization.SymbReg/ExpressionCompiler.cs

    r12014 r12024  
    9595      if (f != null) factors.Add(f);
    9696      var curSy = CurSy();
    97       while (curSy == '*' || curSy == '%' || curSy == '/') { // division and protected division symbols are handled in the same way
     97      while (curSy == '*' || curSy == '%') { // division and protected division symbols are handled in the same way
    9898        if (curSy == '*') {
    9999          NewSy();
     
    135135        r = variables[varIdx];
    136136        NewSy();
    137       } else if (curSy == '|') {
    138         // pipe symbol is used in the expressionextender to represent constant one (|/x).
     137      } else if (curSy == '/') {
     138        // /-symbol used in the expressionextender to represent inverse (1/x).
    139139        // this is necessary because we also use symbols 0..9 as indices for ERCs
    140         r = 1.0;
    141140        NewSy();
     141        r = 1.0 / Fact(variables, constants);
    142142      } else if (curSy >= '0' && curSy <= '9') {
    143143        int o = (byte)curSy - (byte)'0';
Note: See TracChangeset for help on using the changeset viewer.