Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/18/18 15:29:59 (6 years ago)
Author:
gkronber
Message:

#2915: implemented all symbols in all interpreters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r15944 r16238  
    6969      var root = new Root();
    7070      var sqrt = new SquareRoot();
     71      var cube = new Cube();
     72      var cubeRoot = new CubeRoot();
    7173      var exp = new Exponential();
    7274      var abs = new Absolute();
     
    8789      var psi = new Psi();
    8890      var sineIntegral = new SineIntegral();
     91      var analyticalQuotient = new AnalyticalQuotient();
    8992
    9093      var @if = new IfThenElse();
     
    112115
    113116      #region group symbol declaration
    114       var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean, abs });
     117      var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean });
    115118      var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan });
    116119      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log });
    117       var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
    118         fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral});
     120      var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
     121        fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient});
    119122      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable });
    120123      var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols });
    121124
    122       var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, pow, sqrt, root });
     125      var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, pow, sqrt, root, cube, cubeRoot });
    123126
    124127      var conditionSymbols = new GroupSymbol(ConditionsName, new List<ISymbol> { @if, variableCondition });
     
    141144      SetSubtreeCount(root, 2, 2);
    142145      SetSubtreeCount(square, 1, 1);
     146      SetSubtreeCount(cube, 1, 1);
    143147      SetSubtreeCount(sqrt, 1, 1);
     148      SetSubtreeCount(cubeRoot, 1, 1);
    144149      SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1);
    145       SetSubtreeCount(specialFunctions, 1, 1);
     150      foreach(var sy in specialFunctions.Symbols.Except(new[] { analyticalQuotient})) {
     151        SetSubtreeCount(sy, 1, 1);
     152      }
     153      SetSubtreeCount(analyticalQuotient, 2, 2);
     154
    146155      SetSubtreeCount(terminalSymbols, 0, 0);
    147156
Note: See TracChangeset for help on using the changeset viewer.