Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/12/11 13:48:31 (13 years ago)
Author:
mkommend
Message:

#1597, #1609, #1640:

  • Corrected TableFileParser to handle empty rows correctly.
  • Refactored DataSet to store values in List<List> instead of a two-dimensional array.
  • Enable importing and storing string and datetime values.
  • Changed data access methods in dataset and adapted all concerning classes.
  • Changed interpreter to store the variable values for all rows during the compilation step.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r6732 r6740  
    2626using HeuristicLab.Common;
    2727using HeuristicLab.Core;
     28using HeuristicLab.Data;
    2829using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     30using HeuristicLab.Parameters;
    2931using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Parameters;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    224224        if (instr.opCode == OpCodes.Variable) {
    225225          var variableTreeNode = instr.dynamicNode as VariableTreeNode;
    226           instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
     226          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
    227227          code[i] = instr;
    228228        } else if (instr.opCode == OpCodes.LagVariable) {
    229229          var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
    230           instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
     230          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
    231231          code[i] = instr;
    232232        } else if (instr.opCode == OpCodes.VariableCondition) {
    233233          var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode;
    234           instr.iArg0 = (ushort)dataset.GetVariableIndex(variableConditionTreeNode.VariableName);
     234          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
    235235        } else if (instr.opCode == OpCodes.Call) {
    236236          necessaryArgStackSize += instr.nArguments + 1;
     
    468468          }
    469469        case OpCodes.Variable: {
    470             VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
    471             il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // load dataset
    472             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, 0); // sampleOffset
    473             il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // sampleIndex
    474             il.Emit(System.Reflection.Emit.OpCodes.Add); // row = sampleIndex + sampleOffset
    475             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, currentInstr.iArg0); // load var
    476             il.Emit(System.Reflection.Emit.OpCodes.Call, datasetGetValue); // dataset.GetValue
    477             il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
    478             il.Emit(System.Reflection.Emit.OpCodes.Mul);
     470            //VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
     471            //il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // load dataset
     472            //il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, 0); // sampleOffset
     473            //il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // sampleIndex
     474            //il.Emit(System.Reflection.Emit.OpCodes.Add); // row = sampleIndex + sampleOffset
     475            //il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, currentInstr.iArg0); // load var
     476            //il.Emit(System.Reflection.Emit.OpCodes.Call, datasetGetValue); // dataset.GetValue
     477            //il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
     478            //il.Emit(System.Reflection.Emit.OpCodes.Mul);
    479479            return;
    480480          }
Note: See TracChangeset for help on using the changeset viewer.