Changeset 12891 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter
- Timestamp:
- 08/22/15 14:27:37 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
r12155 r12891 138 138 #endregion 139 139 140 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {140 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) { 141 141 if (CheckExpressionsWithIntervalArithmetic.Value) 142 142 throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); … … 161 161 } 162 162 163 private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {163 private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) { 164 164 Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode); 165 165 Dictionary<string, int> doubleVariableNames = dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i); … … 182 182 } 183 183 184 private void CompileInstructions(ILGenerator il, InterpreterState state, Dataset ds) {184 private void CompileInstructions(ILGenerator il, InterpreterState state, IDataset ds) { 185 185 Instruction currentInstr = state.NextInstruction(); 186 186 int nArgs = currentInstr.nArguments; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r12155 r12891 95 95 #endregion 96 96 97 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {97 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) { 98 98 if (CheckExpressionsWithIntervalArithmetic.Value) 99 99 throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); … … 111 111 } 112 112 113 private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {113 private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) { 114 114 Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode); 115 115 int necessaryArgStackSize = 0; … … 132 132 133 133 134 public virtual double Evaluate( Dataset dataset, ref int row, InterpreterState state) {134 public virtual double Evaluate(IDataset dataset, ref int row, InterpreterState state) { 135 135 Instruction currentInstr = state.NextInstruction(); 136 136 switch (currentInstr.opCode) { -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r12155 r12891 102 102 #endregion 103 103 104 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {104 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) { 105 105 if (CheckExpressionsWithIntervalArithmetic.Value) 106 106 throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); … … 116 116 117 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) {118 public IEnumerable<double> GetValues(ISymbolicExpressionTreeNode node, IDataset dataset, IEnumerable<int> rows) { 119 119 var code = SymbolicExpressionTreeLinearCompiler.Compile(node, OpCodes.MapSymbolToOpCode); 120 120 PrepareInstructions(code, dataset); … … 122 122 } 123 123 124 private double Evaluate( Dataset dataset, int row, LinearInstruction[] code) {124 private double Evaluate(IDataset dataset, int row, LinearInstruction[] code) { 125 125 for (int i = code.Length - 1; i >= 0; --i) { 126 126 if (code[i].skip) continue; … … 361 361 } 362 362 363 public static void PrepareInstructions(LinearInstruction[] code, Dataset dataset) {363 public static void PrepareInstructions(LinearInstruction[] code, IDataset dataset) { 364 364 for (int i = 0; i != code.Length; ++i) { 365 365 var instr = code[i];
Note: See TracChangeset
for help on using the changeset viewer.