Changeset 14030 for branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Calculators/Spacing.cs
- Timestamp:
- 07/08/16 15:30:46 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Calculators/Spacing.cs
r14018 r14030 33 33 public static class Spacing { 34 34 35 public static double Calculate(IEnumerable<double[]> points) {36 if ( points== null) throw new ArgumentException("Front must not be null.");37 if (! points.Any()) throw new ArgumentException("Front must not be empty.");35 public static double Calculate(IEnumerable<double[]> front) { 36 if (front == null) throw new ArgumentException("Front must not be null."); 37 if (!front.Any()) throw new ArgumentException("Front must not be empty."); 38 38 39 39 List<double> d = new List<double>(); 40 foreach (double[] r in points) {40 foreach (double[] r in front) { 41 41 var point = r; 42 var otherPoints = points.Where(p => p != point).DefaultIfEmpty(point);42 var otherPoints = front.Where(p => p != point).DefaultIfEmpty(point); 43 43 double dist = Utilities.MinimumDistance(point, otherPoints); 44 44 d.Add(dist);
Note: See TracChangeset
for help on using the changeset viewer.