Changeset 4193 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
- Timestamp:
- 08/11/10 12:59:53 (14 years ago)
- Location:
- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
r4068 r4193 65 65 public const byte Constant = 20; 66 66 public const byte Arg = 21; 67 public const byte Differential = 22; 67 68 } 68 69 … … 89 90 { typeof(Constant), OpCodes.Constant }, 90 91 { typeof(Argument), OpCodes.Arg }, 92 { typeof(DifferentialVariable), OpCodes.Differential}, 91 93 }; 92 94 private const int ARGUMENT_STACK_SIZE = 1024; … … 130 132 var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode; 131 133 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName); 134 } else if (instr.opCode == OpCodes.Differential) { 135 var variableTreeNode = instr.dynamicNode as DifferentialVariableTreeNode; 136 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName); 132 137 } 133 138 return instr; … … 277 282 return dataset[actualRow, currentInstr.iArg0] * lagVariableTreeNode.Weight; 278 283 } 284 case OpCodes.Differential: { 285 var diffTreeNode = currentInstr.dynamicNode as DifferentialVariableTreeNode; 286 if (row < 2 || row >= dataset.Rows - 2) throw new ArgumentException("Out of range access to dataset row: " + row); 287 return (-dataset[row + 2, currentInstr.iArg0] + 8 * dataset[row + 1, currentInstr.iArg0] - 8 * dataset[row - 1, currentInstr.iArg0] + dataset[row - 2, currentInstr.iArg0]) * (1.0/12.0) * diffTreeNode.Weight; 288 } 289 279 290 case OpCodes.Constant: { 280 291 var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode;
Note: See TracChangeset
for help on using the changeset viewer.