Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/08/14 15:16:03 (11 years ago)
Author:
mleitner
Message:

Changes to reorderindices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingDataManipulation.cs

    r10256 r10308  
    33using System.Linq;
    44using HeuristicLab.Data;
     5using System.Collections;
    56
    67namespace HeuristicLab.DataPreprocessing {
     
    142143
    143144    private void reOrderToIndices<T>(string variableName, IList<Tuple<int, int>> indices) {
     145
     146      List<T> originalData = new List<T>(preprocessingData.GetValues<T>(variableName));
     147
    144148      // process all columns equally
    145149      foreach (Tuple<int, int> index in indices) {
     
    147151        int replaceIndex = index.Item2;
    148152
    149         T tmp = preprocessingData.GetCell<T>(variableName, originalIndex);
    150         T replaceValue = preprocessingData.GetCell<T>(variableName, replaceIndex);
    151 
     153        T replaceValue = originalData.ElementAt<T>(replaceIndex);
    152154        preprocessingData.SetCell<T>(variableName, originalIndex, replaceValue);
    153         preprocessingData.SetCell<T>(variableName, replaceIndex, tmp);
    154155      }
    155156    }
Note: See TracChangeset for help on using the changeset viewer.