- Timestamp:
- 05/23/18 07:13:05 (7 years ago)
- Location:
- branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
r15583 r15944 53 53 var tan = new Tangent(); 54 54 var log = new Logarithm(); 55 var abs = new Absolute(); 55 56 var pow = new Power(); 56 57 pow.InitialFrequency = 0.0; … … 123 124 autoregressiveVariable.Enabled = false; 124 125 125 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, square, pow, sqrt, root, exp,126 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, abs, sin, cos, tan, log, square, pow, sqrt, root, exp, 126 127 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral, 127 128 @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition }; 128 var unaryFunctionSymbols = new List<Symbol>() { square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative,129 var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative, 129 130 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral 130 131 }; -
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r15583 r15944 70 70 var sqrt = new SquareRoot(); 71 71 var exp = new Exponential(); 72 var abs = new Absolute(); 72 73 73 74 var airyA = new AiryA(); … … 111 112 112 113 #region group symbol declaration 113 var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean });114 var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean, abs }); 114 115 var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan }); 115 116 var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log }); … … 231 232 public void ConfigureAsDefaultRegressionGrammar() { 232 233 Symbols.First(s => s is Average).Enabled = false; 234 Symbols.First(s => s is Absolute).Enabled = false; 233 235 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 234 236 Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; … … 242 244 Symbols.First(s => s is VariableCondition).Enabled = false; 243 245 Symbols.First(s => s is Xor).Enabled = false; 246 Symbols.First(s => s is Absolute).Enabled = false; 244 247 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 245 248 Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false; … … 251 254 public void ConfigureAsDefaultTimeSeriesPrognosisGrammar() { 252 255 Symbols.First(s => s is Average).Enabled = false; 256 Symbols.First(s => s is Absolute).Enabled = false; 253 257 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 254 258 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 r15944 210 210 <Compile Include="Symbols\FactorVariableTreeNode.cs" /> 211 211 <Compile Include="Symbols\FactorVariable.cs" /> 212 <Compile Include="Symbols\Absolute.cs" /> 212 213 <Compile Include="Symbols\VariableBase.cs" /> 213 214 <Compile Include="Symbols\VariableTreeNodeBase.cs" /> -
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs
r15583 r15944 95 95 { "*", new Multiplication()}, 96 96 { "-", new Subtraction()}, 97 { "ABS", new Absolute() }, 97 98 { "EXP", new Exponential()}, 98 99 { "LOG", new Logarithm()}, -
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
r15583 r15944 85 85 public const byte FactorVariable = 46; 86 86 public const byte BinaryFactorVariable = 47; 87 public const byte Absolute = 48; 87 88 88 89 … … 113 114 { typeof(Power),OpCodes.Power}, 114 115 { typeof(Root),OpCodes.Root}, 115 { typeof(TimeLag), OpCodes.TimeLag}, 116 { typeof(TimeLag), OpCodes.TimeLag}, 116 117 { typeof(Integral), OpCodes.Integral}, 117 118 { typeof(Derivative), OpCodes.Derivative}, … … 135 136 { typeof(Bessel), OpCodes.Bessel}, 136 137 { typeof(FactorVariable), OpCodes.FactorVariable }, 137 { typeof(BinaryFactorVariable), OpCodes.BinaryFactorVariable } 138 { typeof(BinaryFactorVariable), OpCodes.BinaryFactorVariable }, 139 {typeof(Absolute), OpCodes.Absolute } 138 140 }; 139 141 -
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r15583 r15944 203 203 return sum / currentInstr.nArguments; 204 204 } 205 case OpCodes.Absolute: { 206 return Math.Abs(Evaluate(dataset, ref row, state)); 207 } 205 208 case OpCodes.Cos: { 206 209 return Math.Cos(Evaluate(dataset, ref row, state)); -
branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r15583 r15944 221 221 } 222 222 instr.value = s / instr.nArguments; 223 } else if (instr.opCode == OpCodes.Absolute) { 224 instr.value = Math.Abs(code[instr.childIndex].value); 223 225 } else if (instr.opCode == OpCodes.Cos) { 224 226 instr.value = Math.Cos(code[instr.childIndex].value);
Note: See TracChangeset
for help on using the changeset viewer.