Changeset 8564
- Timestamp:
- 09/04/12 11:24:29 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common/3.3/EnumerableStatisticExtensions.cs
r8531 r8564 45 45 return (valuesArr[(n / 2) - 1] + valuesArr[n / 2]) / 2.0; 46 46 } 47 } 48 49 /// <summary> 50 /// Calculates the range (max - min) of the enumeration. 51 /// </summary> 52 /// <param name="values"></param> 53 /// <returns></returns> 54 public static double Range(this IEnumerable<double> values) { 55 double min = double.PositiveInfinity; 56 double max = double.NegativeInfinity; 57 int i = 0; 58 foreach (var e in values) { 59 if (min > e) min = e; 60 if (max < e) max = e; 61 i++; 62 } 63 if (i <= 2) throw new ArgumentException("The enumerable must contain at least two elements", "values"); 64 return max - min; 47 65 } 48 66 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs
r7851 r8564 32 32 namespace HeuristicLab.Problems.Instances.DataAnalysis { 33 33 public class TableFileParser { 34 private const int BUFFER_SIZE = 1024;34 private const int BUFFER_SIZE = 65536; 35 35 private static readonly char[] POSSIBLE_SEPARATORS = new char[] { ',', ';', '\t' }; 36 36 private Tokenizer tokenizer;
Note: See TracChangeset
for help on using the changeset viewer.