Changeset 16375

Ignore:
Timestamp:
12/12/18 16:11:30 (2 years ago)
Message:

#2866: Add support for hyperbolic tangent symbol.

Location:
branches/2866_SymRegHyperbolicFunctions
Files:
8 edited
1 copied

Unmodified
Removed
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs

 r16360 var log = new Logarithm(); var abs = new Absolute(); var tanh = new HyperbolicTangent(); var pow = new Power(); pow.InitialFrequency = 0.0; autoregressiveVariable.Enabled = false; var allSymbols = new List() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, var allSymbols = new List() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, tanh, 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() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, not, timeLag, integral, derivative, var unaryFunctionSymbols = new List() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, tanh, not, timeLag, integral, derivative, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral };
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

 r16360 var gamma = new Gamma(); var hypCosineIntegral = new HyperbolicCosineIntegral(); var tanh = new HyperbolicTangent(); var hypSineIntegral = new HyperbolicSineIntegral(); var norm = new Norm(); #region group symbol declaration var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List() { add, sub, mul, div, mean }); var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List() { sin, cos, tan }); var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List { exp, log }); var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List() { sin, cos, tan, tanh}); var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List { exp, log}); var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient}); Symbols.First(s => s is Average).Enabled = false; Symbols.First(s => s is Absolute).Enabled = false; Symbols.First(s => s is HyperbolicTangent).Enabled = false; Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; Symbols.First(s => s is Xor).Enabled = false; Symbols.First(s => s is Absolute).Enabled = false; Symbols.First(s => s is HyperbolicTangent).Enabled = false; Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false; Symbols.First(s => s is Average).Enabled = false; Symbols.First(s => s is Absolute).Enabled = false; Symbols.First(s => s is HyperbolicTangent).Enabled = false; Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

 r16361 ﻿ Debug full false $(SolutionDir)\bin\ ..\..\..\..\trunk\bin\ DEBUG;TRACE prompt pdbonly true$(SolutionDir)\bin\ ..\..\..\..\trunk\bin\ TRACE prompt true $(SolutionDir)\bin\ ..\..\..\..\trunk\bin\ DEBUG;TRACE full$(SolutionDir)\bin\ ..\..\..\..\trunk\bin\ TRACE true true $(SolutionDir)\bin\ ..\..\..\..\trunk\bin\ DEBUG;TRACE full$(SolutionDir)\bin\ ..\..\..\..\trunk\bin\ TRACE true ..\..\bin\ALGLIB-3.7.0.dll ..\..\..\..\trunk\bin\ALGLIB-3.7.0.dll False ..\..\bin\AutoDiff-1.0.dll ..\..\..\..\trunk\bin\AutoDiff-1.0.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Optimization.Operators-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll False False ..\..\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll ..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll False False ..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll False {887425B4-4348-49ED-A457-B7D2C26DDBF9} HeuristicLab.Analysis-3.3 False {958B43BC-CC5C-4FA2-8628-2B3B01D890B6} HeuristicLab.Collections-3.3 False {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1} HeuristicLab.Common.Resources-3.3 False {A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C} HeuristicLab.Common-3.3 False {C36BD924-A541-4A00-AFA8-41701378DDC5} HeuristicLab.Core-3.3 False {BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937} HeuristicLab.Data-3.3 False {06D4A186-9319-48A0-BADE-A2058D462EEA} HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4 False {23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE} HeuristicLab.Operators-3.3 False {25087811-F74C-4128-BC86-8324271DA13E} HeuristicLab.Optimization.Operators-3.3 False {14AB8D24-25BC-400C-A846-4627AA945192} HeuristicLab.Optimization-3.3 {56F9106A-079F-4C61-92F6-86A84C2D84B7} HeuristicLab.Parameters-3.3 False {102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B} HeuristicLab.Persistence-3.3 False {94186A6A-5176-4402-AE83-886557B53CCA} HeuristicLab.PluginInfrastructure-3.3 False {DF87C13E-A889-46FF-8153-66DCAA8C5674} HeuristicLab.Problems.DataAnalysis-3.4 False {3540E29E-4793-49E7-8EE2-FEA7F61C3994} HeuristicLab.Problems.Instances-3.3 False {F4539FB6-4708-40C9-BE64-0A1390AEA197} HeuristicLab.Random-3.3 False
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs

 r16360 { "COS", new Cosine()}, { "TAN", new Tangent()}, { "TANH", new HyperbolicTangent()}, { "AIRYA", new AiryA()}, { "AIRYB", new AiryB()},
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs

 r16360 {"COS", new Cosine()}, {"TAN", new Tangent()}, {"TANH", new HyperbolicTangent ()}, {"AIRYA", new AiryA()}, {"AIRYB", new AiryB()},
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

 r16360 public const byte CubeRoot = 51; public const byte Tanh = 52; private static Dictionary symbolToOpcode = new Dictionary() { { typeof(Cosine), OpCodes.Cos }, { typeof(Tangent), OpCodes.Tan }, { typeof (HyperbolicTangent), OpCodes.Tanh}, { typeof(Logarithm), OpCodes.Log }, { typeof(Exponential), OpCodes.Exp },
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

 r16360 return Math.Abs(Evaluate(dataset, ref row, state)); } case OpCodes.Tanh: { return Math.Tanh(Evaluate(dataset, ref row, state)); } case OpCodes.Cos: { return Math.Cos(Evaluate(dataset, ref row, state));
• branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

 r16360 } else if (instr.opCode == OpCodes.Absolute) { instr.value = Math.Abs(code[instr.childIndex].value); } else if (instr.opCode == OpCodes.Tanh) { instr.value = Math.Tanh(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.