# Changeset 16083 for branches/2937_SymReg_AnalyticalQuotient

Ignore:
Timestamp:
08/16/18 09:45:36 (3 years ago)
Message:

#2937: added symbol for AQ and support for AQ in interpreter and AutoDiff converter

Location:
branches/2937_SymReg_AnalyticalQuotient/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
5 edited

Unmodified
Removed
• ## branches/2937_SymReg_AnalyticalQuotient/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs

 r15583 if (terms.Count == 1) return 1.0 / terms[0]; else return terms.Aggregate((a, b) => new AutoDiff.Product(a, 1.0 / b)); } if(node.Symbol is AnalyticalQuotient) { var x1 = ConvertToAutoDiff(node.GetSubtree(0)); var x2 = ConvertToAutoDiff(node.GetSubtree(1)); return x1 / (TermBuilder.Power(1 + x2 * x2, 0.5)); } if (node.Symbol is Logarithm) {
• ## branches/2937_SymReg_AnalyticalQuotient/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs

 r15583 var mul = new Multiplication(); var div = new Division(); var aq = new AnalyticalQuotient(); var mean = new Average(); var sin = new Sine(); 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, aq, mean, 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 binaryFunctionSymbols = new List() { pow, root, gt, lt, variableCondition }; var binaryFunctionSymbols = new List() { pow, root, gt, lt, aq, variableCondition }; var ternarySymbols = new List() { add, sub, mul, div, mean, and, or, xor }; var terminalSymbols = new List() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable };
• ## branches/2937_SymReg_AnalyticalQuotient/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

 r15902
• ## branches/2937_SymReg_AnalyticalQuotient/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

 r15583 public const byte FactorVariable = 46; public const byte BinaryFactorVariable = 47; public const byte AnalyticalQuotient = 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(AnalyticalQuotient), OpCodes.AnalyticalQuotient } };
• ## branches/2937_SymReg_AnalyticalQuotient/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

 r15583 if (instr.nArguments == 1) p = 1.0 / p; instr.value = p; } else if (instr.opCode == OpCodes.AnalyticalQuotient) { var x1 = code[instr.childIndex].value; var x2 = code[instr.childIndex + 1].value; instr.value = x1 / Math.Sqrt(1 + x2 * x2); } else if (instr.opCode == OpCodes.Average) { double s = code[instr.childIndex].value;
Note: See TracChangeset for help on using the changeset viewer.