- Timestamp:
- 07/26/13 15:01:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r9776 r9788 129 129 130 130 private static LinearInstruction[] GetPrefixSequence(LinearInstruction[] code, int startIndex) { 131 var instr = code[startIndex]; 132 var list = new List<LinearInstruction> { instr }; 133 for (int i = 0; i != instr.nArguments; ++i) { 134 list.AddRange(GetPrefixSequence(code, instr.childIndex + i)); 135 } 136 return list.ToArray(); 131 Action<LinearInstruction, List<LinearInstruction>> getPrefix = null; 132 getPrefix = (instr, list) => { 133 list.Add(instr); 134 for (int i = 0; i != instr.nArguments; ++i) { 135 getPrefix(code[instr.childIndex + i], list); 136 } 137 }; 138 var l = new List<LinearInstruction>(); 139 getPrefix(code[startIndex], l); 140 return l.ToArray(); 137 141 } 138 142 … … 199 203 var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode; 200 204 int actualRow = row + laggedVariableTreeNode.Lag; 201 if (actualRow < 0 || actualRow >= dataset.Rows) instr.value = double.NaN; 202 instr.value = ((IList<double>)instr.iArg0)[actualRow] * laggedVariableTreeNode.Weight; 205 if (actualRow < 0 || actualRow >= dataset.Rows) 206 instr.value = double.NaN; 207 else 208 instr.value = ((IList<double>)instr.iArg0)[actualRow] * laggedVariableTreeNode.Weight; 203 209 } 204 210 break;
Note: See TracChangeset
for help on using the changeset viewer.