Changeset 11458 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter
- Timestamp:
- 10/13/14 13:03:24 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Property svn:ignore
-
old new 5 5 TreeDistance 6 6 SymbolicDataAnalysisExpressionTreeMatching.cs 7 Importer
-
- Property svn:ignore
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
r11208 r11458 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 25 26 26 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 83 84 public const byte Erf = 43; 84 85 public const byte Bessel = 44; 86 public const byte Passthrough = 45; 85 87 86 88 private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() { … … 130 132 { typeof(Norm), OpCodes.Norm}, 131 133 { typeof(Erf), OpCodes.Erf}, 132 { typeof(Bessel), OpCodes.Bessel} 134 { typeof(Bessel), OpCodes.Bessel}, 135 { typeof(Passthrough), OpCodes.Passthrough} 133 136 }; 134 137 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r11232 r11458 111 111 112 112 var code = SymbolicExpressionTreeLinearCompiler.Compile(tree, OpCodes.MapSymbolToOpCode); 113 PrepareInstructions(code, dataset); 114 return rows.Select(row => Evaluate(dataset, row, code)); 115 } 116 117 // NOTE: do not use this method when evaluating trees. this method is provided as a shortcut for evaluating subtrees ad-hoc 118 public IEnumerable<double> GetValues(ISymbolicExpressionTreeNode node, Dataset dataset, IEnumerable<int> rows) { 119 var code = SymbolicExpressionTreeLinearCompiler.Compile(node, OpCodes.MapSymbolToOpCode); 113 120 PrepareInstructions(code, dataset); 114 121 return rows.Select(row => Evaluate(dataset, row, code)); … … 329 336 state.Reset(); 330 337 instr.value = interpreter.Evaluate(dataset, ref row, state); 338 } else if (instr.opCode == OpCodes.Passthrough) { 339 instr.value = code[instr.childIndex].value; 331 340 } else { 332 341 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);
Note: See TracChangeset
for help on using the changeset viewer.