Changeset 11571 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 11/24/14 15:16:59 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs
r11523 r11571 71 71 } 72 72 73 public string Format(ISymbolicExpressionTree symbolicExpressionTree, Dataset dataset) {73 public string Format(ISymbolicExpressionTree symbolicExpressionTree, IDataset dataset) { 74 74 var stringBuilder = new StringBuilder(); 75 75 if (dataset != null) CalculateVariableMapping(symbolicExpressionTree, dataset); … … 85 85 } 86 86 87 private void CalculateVariableMapping(ISymbolicExpressionTree tree, Dataset dataset) {87 private void CalculateVariableMapping(ISymbolicExpressionTree tree, IDataset dataset) { 88 88 int columnIndex = 0; 89 89 int inputIndex = 0; -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionTreeInterpreter.cs
r11171 r11571 27 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 28 28 public interface ISymbolicDataAnalysisExpressionTreeInterpreter : INamedItem, IStatefulItem { 29 IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows);29 IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows); 30 30 IntValue EvaluatedSolutions { get; set; } 31 31 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
r11171 r11571 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.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r11171 r11571 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.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r11171 r11571 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."); … … 115 115 } 116 116 117 private double Evaluate( Dataset dataset, int row, LinearInstruction[] code) {117 private double Evaluate(IDataset dataset, int row, LinearInstruction[] code) { 118 118 for (int i = code.Length - 1; i >= 0; --i) { 119 119 if (code[i].skip) continue; … … 352 352 } 353 353 354 private static void PrepareInstructions(LinearInstruction[] code, Dataset dataset) {354 private static void PrepareInstructions(LinearInstruction[] code, IDataset dataset) { 355 355 for (int i = 0; i != code.Length; ++i) { 356 356 var instr = code[i]; -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs
r11171 r11571 41 41 42 42 protected static double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, 43 Dataset dataset, IEnumerable<int> rows) {43 IDataset dataset, IEnumerable<int> rows) { 44 44 //optimization: constant nodes return always the same value 45 45 ConstantTreeNode constantNode = node as ConstantTreeNode;
Note: See TracChangeset
for help on using the changeset viewer.