Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/12/11 13:19:53 (14 years ago)
Author:
mkommend
Message:

Implemented Power symbol for GP (ticket #1374).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs

    r5223 r5288  
    6565      public const byte Constant = 20;
    6666      public const byte Arg = 21;
     67
     68      public const byte Power = 22;
    6769    }
    6870
     
    8991      { typeof(Constant), OpCodes.Constant },
    9092      { typeof(Argument), OpCodes.Arg },
     93      { typeof(Power),OpCodes.Power},
    9194    };
    9295    private const int ARGUMENT_STACK_SIZE = 1024;
     
    185188            return Math.Tan(Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer));
    186189          }
     190        case OpCodes.Power: {
     191            double x = Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer);
     192            double y = Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer);
     193            return Math.Pow(x, y);
     194          }
    187195        case OpCodes.Exp: {
    188196            return Math.Exp(Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer));
Note: See TracChangeset for help on using the changeset viewer.