- Timestamp:
- 11/25/14 03:26:00 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks
- Property svn:mergeinfo changed
-
branches/OptimizationNetworks/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/OptimizationNetworks/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r10406 r11576 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 170 170 yield return value; 171 171 } 172 173 public IEnumerable<string> GetStringValues(string variableName) { 174 IList list; 175 if (!variableValues.TryGetValue(variableName, out list)) 176 throw new ArgumentException("The variable " + variableName + " does not exist in the dataset."); 177 List<string> values = list as List<string>; 178 if (values == null) throw new ArgumentException("The variable " + variableName + " is not a string variable."); 179 180 //mkommend yield return used to enable lazy evaluation 181 foreach (string value in values) 182 yield return value; 183 } 184 185 public IEnumerable<DateTime> GetDateTimeValues(string variableName) { 186 IList list; 187 if (!variableValues.TryGetValue(variableName, out list)) 188 throw new ArgumentException("The variable " + variableName + " does not exist in the dataset."); 189 List<DateTime> values = list as List<DateTime>; 190 if (values == null) throw new ArgumentException("The variable " + variableName + " is not a datetime variable."); 191 192 //mkommend yield return used to enable lazy evaluation 193 foreach (DateTime value in values) 194 yield return value; 195 } 196 172 197 public ReadOnlyCollection<double> GetReadOnlyDoubleValues(string variableName) { 173 198 IList list; … … 194 219 195 220 return rows.Select(index => values[index]); 221 } 222 223 public bool VariableHasType<T>(string variableName) { 224 return variableValues[variableName] is IList<T>; 196 225 } 197 226
Note: See TracChangeset
for help on using the changeset viewer.