Free cookie consent management tool by TermsFeed Policy Generator

# Changeset 15944

Ignore:
Timestamp:
05/23/18 07:13:05 (6 years ago)
Message:

#2915 added support for Abs() symbol to tree interpreter and linear interpreter as well as to the infix parser

Location:
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
7 edited

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

 r15583 var tan = new Tangent(); var log = new Logarithm(); var abs = new Absolute(); var pow = new Power(); pow.InitialFrequency = 0.0; autoregressiveVariable.Enabled = false; var allSymbols = new List() { add, sub, mul, div, mean, sin, cos, tan, log, square, pow, sqrt, root, exp, var allSymbols = new List() { add, sub, mul, div, mean, abs, sin, cos, tan, log, square, pow, sqrt, root, exp, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral, @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition }; var unaryFunctionSymbols = new List() { square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative, var unaryFunctionSymbols = new List() { abs, square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral };
• ## branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

 r15583 var sqrt = new SquareRoot(); var exp = new Exponential(); var abs = new Absolute(); var airyA = new AiryA(); #region group symbol declaration var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List() { add, sub, mul, div, mean }); var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List() { add, sub, mul, div, mean, abs }); var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List() { sin, cos, tan }); var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List { exp, log }); public void ConfigureAsDefaultRegressionGrammar() { Symbols.First(s => s is Average).Enabled = false; Symbols.First(s => s is Absolute).Enabled = false; Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; Symbols.First(s => s is VariableCondition).Enabled = false; Symbols.First(s => s is Xor).Enabled = false; Symbols.First(s => s is Absolute).Enabled = false; Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false; public void ConfigureAsDefaultTimeSeriesPrognosisGrammar() { Symbols.First(s => s is Average).Enabled = false; Symbols.First(s => s is Absolute).Enabled = false; Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
• ## branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

 r15902
• ## branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs

 r15583 { "*", new Multiplication()}, { "-", new Subtraction()}, { "ABS", new Absolute() }, { "EXP", new Exponential()}, { "LOG", new Logarithm()},
• ## branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

 r15583 public const byte FactorVariable = 46; public const byte BinaryFactorVariable = 47; public const byte Absolute = 48; { typeof(Power),OpCodes.Power}, { typeof(Root),OpCodes.Root}, { typeof(TimeLag), OpCodes.TimeLag}, { typeof(TimeLag), OpCodes.TimeLag}, { typeof(Integral), OpCodes.Integral}, { typeof(Derivative), OpCodes.Derivative}, { typeof(Bessel), OpCodes.Bessel}, { typeof(FactorVariable), OpCodes.FactorVariable }, { typeof(BinaryFactorVariable), OpCodes.BinaryFactorVariable } { typeof(BinaryFactorVariable), OpCodes.BinaryFactorVariable }, {typeof(Absolute), OpCodes.Absolute } };
• ## branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

 r15583 return sum / currentInstr.nArguments; } case OpCodes.Absolute: { return Math.Abs(Evaluate(dataset, ref row, state)); } case OpCodes.Cos: { return Math.Cos(Evaluate(dataset, ref row, state));
• ## branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

 r15583 } instr.value = s / instr.nArguments; } else if (instr.opCode == OpCodes.Absolute) { instr.value = Math.Abs(code[instr.childIndex].value); } else if (instr.opCode == OpCodes.Cos) { instr.value = Math.Cos(code[instr.childIndex].value);
Note: See TracChangeset for help on using the changeset viewer.