Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/11/10 12:59:53 (14 years ago)
Author:
gkronber
Message:

Created a feature/exploration branch for new data analysis features #1142

Location:
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis
Files:
3 added
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs

    r4068 r4193  
    6565      public const byte Constant = 20;
    6666      public const byte Arg = 21;
     67      public const byte Differential = 22;
    6768    }
    6869
     
    8990      { typeof(Constant), OpCodes.Constant },
    9091      { typeof(Argument), OpCodes.Arg },
     92      { typeof(DifferentialVariable), OpCodes.Differential},
    9193    };
    9294    private const int ARGUMENT_STACK_SIZE = 1024;
     
    130132        var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
    131133        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);
    132137      }
    133138      return instr;
     
    277282            return dataset[actualRow, currentInstr.iArg0] * lagVariableTreeNode.Weight;
    278283          }
     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
    279290        case OpCodes.Constant: {
    280291            var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode;
Note: See TracChangeset for help on using the changeset viewer.