Changeset 18220 for trunk/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 02/24/22 20:33:45 (3 years ago)
- Location:
- trunk
- Files:
-
- 26 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/DerivativeCalculator.cs
r18174 r18220 199 199 var tanh = (ISymbolicExpressionTreeNode)branch.Clone(); 200 200 return Product(fxp, Subtract(CreateNumber(1.0), Square(tanh))); 201 } 202 if (branch.Symbol is SubFunctionSymbol) { 203 return Derive(branch.GetSubtree(0), variableName); 201 204 } 202 205 throw new NotSupportedException(string.Format("Symbol {0} is not supported.", branch.Symbol)); … … 285 288 !(n.Symbol is Cosine) && 286 289 !(n.Symbol is Tangent) && 287 !(n.Symbol is StartSymbol) 290 !(n.Symbol is StartSymbol) && 291 !(n.Symbol is SubFunctionSymbol) 288 292 select n).Any(); 289 293 return !containsUnknownSymbol; -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r18132 r18220 106 106 out ParametricFunctionGradient func_grad) { 107 107 108 return TryConvertToAutoDiff(tree, makeVariableWeightsVariable, addLinearScalingTerms, Enumerable.Empty<ISymbolicExpressionTreeNode>(), 109 out parameters, out initialParamValues, out func, out func_grad); 110 } 111 112 public static bool TryConvertToAutoDiff(ISymbolicExpressionTree tree, bool makeVariableWeightsVariable, bool addLinearScalingTerms, IEnumerable<ISymbolicExpressionTreeNode> excludedNodes, 113 out List<DataForVariable> parameters, out double[] initialParamValues, 114 out ParametricFunction func, 115 out ParametricFunctionGradient func_grad) { 116 108 117 // use a transformator object which holds the state (variable list, parameter list, ...) for recursive transformation of the tree 109 var transformator = new TreeToAutoDiffTermConverter(makeVariableWeightsVariable, addLinearScalingTerms );118 var transformator = new TreeToAutoDiffTermConverter(makeVariableWeightsVariable, addLinearScalingTerms, excludedNodes); 110 119 AutoDiff.Term term; 111 120 try { … … 134 143 private readonly bool makeVariableWeightsVariable; 135 144 private readonly bool addLinearScalingTerms; 136 137 private TreeToAutoDiffTermConverter(bool makeVariableWeightsVariable, bool addLinearScalingTerms) { 145 private readonly HashSet<ISymbolicExpressionTreeNode> excludedNodes; 146 147 private TreeToAutoDiffTermConverter(bool makeVariableWeightsVariable, bool addLinearScalingTerms, IEnumerable<ISymbolicExpressionTreeNode> excludedNodes) { 138 148 this.makeVariableWeightsVariable = makeVariableWeightsVariable; 139 149 this.addLinearScalingTerms = addLinearScalingTerms; 150 this.excludedNodes = new HashSet<ISymbolicExpressionTreeNode>(excludedNodes); 151 140 152 this.initialParamValues = new List<double>(); 141 153 this.parameters = new Dictionary<DataForVariable, AutoDiff.Variable>(); … … 161 173 var par = FindOrCreateParameter(parameters, varNode.VariableName, varValue); 162 174 163 if (makeVariableWeightsVariable ) {175 if (makeVariableWeightsVariable && !excludedNodes.Contains(node)) { 164 176 initialParamValues.Add(varNode.Weight); 165 177 var w = new AutoDiff.Variable(); … … 176 188 var par = FindOrCreateParameter(parameters, factorVarNode.VariableName, variableValue); 177 189 178 initialParamValues.Add(factorVarNode.GetValue(variableValue)); 179 var wVar = new AutoDiff.Variable(); 180 variables.Add(wVar); 181 182 products.Add(AutoDiff.TermBuilder.Product(wVar, par)); 190 if (makeVariableWeightsVariable && !excludedNodes.Contains(node)) { 191 initialParamValues.Add(factorVarNode.GetValue(variableValue)); 192 var wVar = new AutoDiff.Variable(); 193 variables.Add(wVar); 194 195 products.Add(AutoDiff.TermBuilder.Product(wVar, par)); 196 } else { 197 var weight = factorVarNode.GetValue(variableValue); 198 products.Add(weight * par); 199 } 200 183 201 } 184 202 return AutoDiff.TermBuilder.Sum(products); … … 188 206 var par = FindOrCreateParameter(parameters, varNode.VariableName, string.Empty, varNode.Lag); 189 207 190 if (makeVariableWeightsVariable ) {208 if (makeVariableWeightsVariable && !excludedNodes.Contains(node)) { 191 209 initialParamValues.Add(varNode.Weight); 192 210 var w = new AutoDiff.Variable(); … … 305 323 return t * alpha + beta; 306 324 } else return ConvertToAutoDiff(node.GetSubtree(0)); 325 } 326 if (node.Symbol is SubFunctionSymbol) { 327 return ConvertToAutoDiff(node.GetSubtree(0)); 307 328 } 308 329 throw new ConversionException(); … … 353 374 !(n.Symbol is Cube) && 354 375 !(n.Symbol is CubeRoot) && 355 !(n.Symbol is Power) 376 !(n.Symbol is Power) && 377 !(n.Symbol is SubFunctionSymbol) 356 378 select n).Any(); 357 379 return !containsUnknownSymbol; -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
r18211 r18220 35 35 /// Performs some basic re-writing steps to simplify the code for formatting. Tree is changed. 36 36 /// Removes single-argument +, * which have no effect 37 /// Removes SubFunctions (no effect) 37 38 /// Replaces variables with coefficients by an explicitly multiplication 38 39 /// Replaces single-argument / with 1 / (..) … … 57 58 mul.AddSubtree(num); 58 59 mul.AddSubtree(varTreeNode); 60 } else if (n.Symbol is SubFunctionSymbol) { 61 parent.ReplaceSubtree(n, n.GetSubtree(0)); 59 62 } else if (n.SubtreeCount == 1 && (n.Symbol is Addition || n.Symbol is Multiplication || n.Symbol is And || n.Symbol is Or || n.Symbol is Xor)) { 60 63 // single-argument addition or multiplication has no effect -> remove … … 81 84 } 82 85 parent.InsertSubtree(childIdx, newChild); 83 } else if (n.SubtreeCount == 2 && n.GetSubtree(1).SubtreeCount == 2 && 84 IsAssocOp(n.Symbol) && IsOperator(n.GetSubtree(1).Symbol) && 86 } else if (n.SubtreeCount == 2 && n.GetSubtree(1).SubtreeCount == 2 && 87 IsAssocOp(n.Symbol) && IsOperator(n.GetSubtree(1).Symbol) && 85 88 Priority(n.Symbol) == Priority(n.GetSubtree(1).Symbol)) { 86 89 // f(x) <op> (g(x) <op> h(x))) is the same as (f(x) <op> g(x)) <op> h(x) for associative <op> … … 104 107 NumberFormatInfo numberFormat, string formatString, List<KeyValuePair<string, double>> parameters = null) { 105 108 // This method assumes that the tree has been converted to binary and left-assoc form (see ConvertToBinaryLeftAssocRec). 106 // An exception is thrown if the tree has a different shape.107 108 109 if (node.SubtreeCount == 0) { 109 110 // no subtrees -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
r18132 r18220 155 155 FormatRecursively(node.GetSubtree(1), strBuilder); 156 156 strBuilder.Append(" , 2) ) )"); 157 } else if (node.Symbol is SubFunctionSymbol) { 158 FormatRecursively(node.GetSubtree(0), strBuilder); 157 159 } else { 158 160 throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for C# symbolic expression tree formatter."); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs
r18132 r18220 310 310 stringBuilder.Append(FormatRecursively(node.GetSubtree(1))); 311 311 stringBuilder.Append("), 1.0, -1.0)"); 312 } else if (symbol is SubFunctionSymbol) { 313 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 312 314 } else { 313 315 throw new NotImplementedException("Excel export of " + node.Symbol + " is not implemented."); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r18132 r18220 279 279 paramIdx++; 280 280 strBuilder.Append(@" \left( " + p + @"\cdot "); 281 } else if (node.Symbol is SubFunctionSymbol) { 282 // to nothing, skip symbol 281 283 } else { 282 284 throw new NotImplementedException("Export of " + node.Symbol + " is not implemented."); … … 387 389 paramIdx++; 388 390 strBuilder.Append(@" + \left( 1 - " + p + @" \right) \cdot "); 391 } else if (node.Symbol is SubFunctionSymbol) { 392 throw new InvalidOperationException(); 389 393 } else { 390 394 throw new NotImplementedException("Export of " + node.Symbol + " is not implemented."); … … 511 515 } else if (node.Symbol is VariableCondition) { 512 516 strBuilder.Append(@"\right) "); 517 } else if (node.Symbol is SubFunctionSymbol) { 513 518 } else { 514 519 throw new NotImplementedException("Export of " + node.Symbol + " is not implemented."); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
r18132 r18220 388 388 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 389 389 currentLag -= laggedNode.Lag; 390 } else if (symbol is SubFunctionSymbol) { 391 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 390 392 } else { 391 393 stringBuilder.Append("ERROR"); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMathematicaFormatter.cs
r18132 r18220 122 122 } else if (node.Symbol is Root) { 123 123 FormatRoot(node, strBuilder); 124 } else if (node.Symbol is SubFunctionSymbol) { 125 FormatRecursively(node.GetSubtree(0), strBuilder); 124 126 } else { 125 127 throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " is not supported."); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionPythonFormatter.cs
r18132 r18220 204 204 else if (node is INumericTreeNode) 205 205 FormatNumericTreeNode(node, strBuilder); 206 else if (symbol is SubFunctionSymbol) 207 FormatRecursively(node.GetSubtree(0), strBuilder); 206 208 else 207 209 throw new NotSupportedException("Formatting of symbol: " + symbol + " not supported for Python symbolic expression tree formatter."); … … 228 230 229 231 private static void FormatNumericTreeNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 230 var symbol = node.Symbol; 231 if (node is INumericTreeNode numNode) { 232 strBuilder.Append(numNode.Value.ToString("g17", CultureInfo.InvariantCulture)); 233 } else { 234 throw new NotSupportedException("Formatting of symbol: " + symbol + " not supported for Python symbolic expression tree formatter."); 235 } 232 var numNode = node as INumericTreeNode; 233 strBuilder.Append(numNode.Value.ToString("g17", CultureInfo.InvariantCulture)); 236 234 } 237 235 -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs
r18132 r18220 184 184 } else if (symbol is BinaryFactorVariable || symbol is FactorVariable) { 185 185 stringBuilder.Append("factor variables are not supported"); 186 } else if (symbol is SubFunctionSymbol) { 187 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 186 188 } else { 187 189 stringBuilder.Append("("); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/TSQLExpressionFormatter.cs
r18132 r18220 157 157 } else if (node.Symbol is Root) { 158 158 FormatRoot(level, node, strBuilder); 159 } else if (node.Symbol is SubFunctionSymbol) { 160 FormatRecursively(level, node.GetSubtree(0), strBuilder); 159 161 } else { 160 162 throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for TSQL symbolic expression tree formatter."); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r18132 r18220 30 30 [Item("TypeCoherentExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that boolean and real-valued expressions are not mixed.")] 31 31 public class TypeCoherentExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar { 32 p rivateconst string ArithmeticFunctionsName = "Arithmetic Functions";33 p rivateconst string TrigonometricFunctionsName = "Trigonometric Functions";34 p rivateconst string ExponentialFunctionsName = "Exponential and Logarithmic Functions";35 p rivateconst string RealValuedSymbolsName = "Real Valued Symbols";36 p rivateconst string TerminalsName = "Terminals";37 p rivateconst string PowerFunctionsName = "Power Functions";38 p rivateconst string ConditionsName = "Conditions";39 p rivateconst string ComparisonsName = "Comparisons";40 p rivateconst string BooleanOperatorsName = "Boolean Operators";41 p rivateconst string ConditionalSymbolsName = "ConditionalSymbols";42 p rivateconst string SpecialFunctionsName = "Special Functions";43 p rivateconst string TimeSeriesSymbolsName = "Time Series Symbols";32 public const string ArithmeticFunctionsName = "Arithmetic Functions"; 33 public const string TrigonometricFunctionsName = "Trigonometric Functions"; 34 public const string ExponentialFunctionsName = "Exponential and Logarithmic Functions"; 35 public const string RealValuedSymbolsName = "Real Valued Symbols"; 36 public const string TerminalsName = "Terminals"; 37 public const string PowerFunctionsName = "Power Functions"; 38 public const string ConditionsName = "Conditions"; 39 public const string ComparisonsName = "Comparisons"; 40 public const string BooleanOperatorsName = "Boolean Operators"; 41 public const string ConditionalSymbolsName = "ConditionalSymbols"; 42 public const string SpecialFunctionsName = "Special Functions"; 43 public const string TimeSeriesSymbolsName = "Time Series Symbols"; 44 44 45 45 [StorableConstructor] -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r18210 r18220 188 188 <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs" /> 189 189 <Compile Include="IntervalUtil.cs" /> 190 <Compile Include="LinearScaling.cs" /> 190 191 <Compile Include="Selectors\DiversitySelector.cs" /> 192 <Compile Include="StructureTemplate\StructureTemplate.cs" /> 193 <Compile Include="StructureTemplate\SubFunction.cs" /> 191 194 <Compile Include="SymbolicDataAnalysisExpressionTreeAverageSimilarityCalculator.cs" /> 192 195 <Compile Include="SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs" /> … … 256 259 <Compile Include="Symbols\Constant.cs" /> 257 260 <Compile Include="Symbols\ConstantTreeNode.cs" /> 261 <Compile Include="Symbols\SubFunctionSymbol.cs" /> 262 <Compile Include="Symbols\SubFunctionTreeNode.cs" /> 258 263 <Compile Include="Symbols\VariableBase.cs" /> 259 264 <Compile Include="Symbols\VariableTreeNodeBase.cs" /> -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs
r18171 r18220 82 82 internal static readonly BidirectionalLookup<string, ISymbol> 83 83 knownSymbols = new BidirectionalLookup<string, ISymbol>(StringComparer.InvariantCulture, new SymbolComparer()); 84 internal static readonly SubFunctionSymbol subFunctionSymbol = new SubFunctionSymbol(); 84 85 85 86 private Number number = new Number(); … … 328 329 329 330 private ISymbol GetSymbol(string tok) { 330 var symb = knownSymbols.GetByFirst(tok).FirstOrDefault(); 331 if (symb == null) throw new ArgumentException(string.Format("Unknown token {0} found.", tok)); 332 return symb; 331 if (knownSymbols.ContainsFirst(tok)) 332 return knownSymbols.GetByFirst(tok).FirstOrDefault(); 333 else 334 return subFunctionSymbol; 333 335 } 334 336 … … 581 583 if (funcNode.Symbol is LaggedVariable) { 582 584 ParseLaggedVariable(tokens, funcNode); 585 } else if (funcNode.Symbol is SubFunctionSymbol) { // SubFunction 586 var subFunction = funcNode as SubFunctionTreeNode; 587 subFunction.Name = idTok.strVal; 588 // input arguments 589 var args = ParseArgList(tokens); 590 IList<string> arguments = new List<string>(); 591 foreach (var arg in args) 592 if (arg is VariableTreeNode varTreeNode) 593 arguments.Add(varTreeNode.VariableName); 594 subFunction.Arguments = arguments; 583 595 } else { 584 596 // functions -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs
r18143 r18220 172 172 Expect(Token.EQ, tokens); 173 173 var initValToken = tokens.Dequeue(); 174 if (initValToken.Symbol == TokenSymbol.CONSTANT) {174 if (initValToken.Symbol == TokenSymbol.CONSTANT) { 175 175 t.Value = initValToken.DoubleValue; 176 176 } else { … … 289 289 if (token.Symbol != TokenSymbol.SYMB && 290 290 token.Symbol != TokenSymbol.LBRACKET && // LBRACKET and RBRACKET are used for <num=..> and as LT, GT operators 291 token.Symbol != TokenSymbol.RBRACKET 291 token.Symbol != TokenSymbol.RBRACKET 292 292 ) throw new FormatException("Expected function symbol, but got: " + token.StringValue); 293 293 return knownSymbols[token.StringValue].CreateTreeNode(); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalArithBoundsEstimator.cs
r18132 r18220 248 248 249 249 break; 250 } 251 case OpCodes.SubFunction: { 252 result = Evaluate(instructions, ref instructionCounter, nodeIntervals, variableIntervals); 253 break; 250 254 } 251 255 default: … … 344 348 !(n.Symbol is Power) && 345 349 !(n.Symbol is Absolute) && 346 !(n.Symbol is AnalyticQuotient) 350 !(n.Symbol is AnalyticQuotient) && 351 !(n.Symbol is SubFunctionSymbol) 347 352 select n).Any(); 348 353 return !containsUnknownSymbols; -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
r18160 r18220 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq;25 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 25 … … 79 78 CubeRoot = 51, 80 79 Tanh = 52, 80 SubFunction = 53, 81 81 Constant = 54 82 82 }; … … 84 84 // constants for API compatibility only 85 85 public const byte Add = (byte)OpCode.Add; 86 public const byte Sub = (byte)OpCode.Sub;87 public const byte Mul = (byte)OpCode.Mul;88 public const byte Div = (byte)OpCode.Div;89 public const byte Sin = (byte)OpCode.Sin;90 public const byte Cos = (byte)OpCode.Cos;91 public const byte Tan = (byte)OpCode.Tan;92 public const byte Log = (byte)OpCode.Log;86 public const byte Sub = (byte)OpCode.Sub; 87 public const byte Mul = (byte)OpCode.Mul; 88 public const byte Div = (byte)OpCode.Div; 89 public const byte Sin = (byte)OpCode.Sin; 90 public const byte Cos = (byte)OpCode.Cos; 91 public const byte Tan = (byte)OpCode.Tan; 92 public const byte Log = (byte)OpCode.Log; 93 93 public const byte Exp = (byte)OpCode.Exp; 94 94 public const byte IfThenElse = (byte)OpCode.IfThenElse; … … 103 103 public const byte LagVariable = (byte)OpCode.LagVariable; 104 104 public const byte Number = (byte)OpCode.Number; 105 public const byte Constant = (byte) 105 public const byte Constant = (byte)OpCode.Constant; 106 106 public const byte Arg = (byte)OpCode.Arg; 107 107 public const byte Power = (byte)OpCode.Power; … … 136 136 public const byte CubeRoot = (byte)OpCode.CubeRoot; 137 137 public const byte Tanh = (byte)OpCode.Tanh; 138 138 public const byte SubFunction = (byte)OpCode.SubFunction; 139 139 140 140 private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() { 141 141 { typeof(Addition), OpCodes.Add }, 142 142 { typeof(Subtraction), OpCodes.Sub }, 143 143 { typeof(Multiplication), OpCodes.Mul }, … … 192 192 { typeof(AnalyticQuotient), OpCodes.AnalyticQuotient }, 193 193 { typeof(Cube), OpCodes.Cube }, 194 { typeof(CubeRoot), OpCodes.CubeRoot } 194 { typeof(CubeRoot), OpCodes.CubeRoot }, 195 { typeof(SubFunctionSymbol), OpCodes.SubFunction } 195 196 }; 196 197 -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
r18132 r18220 662 662 ); 663 663 } 664 case OpCodes.SubFunction: { 665 return MakeExpr(node.GetSubtree(0), variableIndices, row, columns); 666 } 664 667 default: 665 668 throw new NotSupportedException("Unsupported symbol: " + node.Symbol); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
r18132 r18220 182 182 break; 183 183 } 184 184 185 case OpCodes.Tanh: { 185 186 Tanh(instr.buf, code[c].buf); 186 187 break; 187 188 } 189 188 190 case OpCodes.Absolute: { 189 191 Absolute(instr.buf, code[c].buf); … … 194 196 Load(instr.buf, code[c].buf); 195 197 AnalyticQuotient(instr.buf, code[c + 1].buf); 198 break; 199 } 200 201 case OpCodes.SubFunction: { 202 Load(instr.buf, code[c].buf); 196 203 break; 197 204 } -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
r18132 r18220 724 724 " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter"); 725 725 } 726 case OpCodes.SubFunction: { 727 CompileInstructions(il, state, ds); 728 return; 729 } 726 730 default: 727 731 throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name + -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r18132 r18220 529 529 } 530 530 } 531 case OpCodes.SubFunction: { 532 return Evaluate(dataset, ref row, state); 533 } 531 534 default: 532 535 throw new NotSupportedException(); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r18132 r18220 388 388 state.Reset(); 389 389 instr.value = interpreter.Evaluate(dataset, ref row, state); 390 } else if (instr.opCode == OpCodes.SubFunction) { 391 instr.value = code[instr.childIndex].value; 390 392 } else { 391 393 var errorText = string.Format("The {0} symbol is not supported by the linear interpreter. To support this symbol, please use the SymbolicDataAnalysisExpressionTreeInterpreter.", instr.dynamicNode.Symbol.Name); -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs
r18160 r18220 122 122 (byte)OpCode.Cube, 123 123 (byte)OpCode.Absolute, 124 (byte)OpCode.AnalyticQuotient 124 (byte)OpCode.AnalyticQuotient, 125 (byte)OpCode.SubFunction 125 126 }; 126 127 -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeComparer.cs
r18132 r18220 22 22 using System; 23 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 24 using HEAL.Attic;25 24 26 25 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 27 [StorableType("eabf848e-d10c-499e-8c48-c771232ede0e")]28 26 // this comparer considers that a < b if the type of a is "greater" than the type of b, for example: 29 27 // - A function node is "greater" than a terminal node
Note: See TracChangeset
for help on using the changeset viewer.