- Timestamp:
- 04/14/16 13:33:02 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs
r13040 r13760 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. … … 56 56 public ModifiableDataset() : base() { } 57 57 58 public ModifiableDataset(Dataset dataset) : base(dataset) { }59 58 public ModifiableDataset(IEnumerable<string> variableNames, IEnumerable<IList> variableValues) : base(variableNames, variableValues) { } 60 59 … … 74 73 } 75 74 OnReset(); 75 } 76 77 public void ReplaceColumn<T>(string variableName, List<T> values) { 78 if (!variableValues.ContainsKey(variableName)) 79 throw new ArgumentException(string.Format("Variable {0} is not present in the dataset."), variableName); 80 if (values.Count != variableValues[variableName].Count) 81 throw new ArgumentException("The number of values must coincide with the number of dataset rows."); 82 if (GetVariableType(variableName) != values[0].GetType()) 83 throw new ArgumentException("The type of the provided value does not match the variable type."); 84 variableValues[variableName] = values; 76 85 } 77 86
Note: See TracChangeset
for help on using the changeset viewer.