Changeset 16310 for branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/MultiObjective/GenerationalDistanceCalculator.cs
- Timestamp:
- 11/20/18 14:53:51 (5 years ago)
- Location:
- branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Optimization (added) merged: 16179
- Property svn:mergeinfo changed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/MultiObjective/GenerationalDistanceCalculator.cs
r16171 r16310 23 23 24 24 #region 25 26 25 using System; 27 26 using System.Collections.Generic; 28 27 using System.Linq; 29 28 using HeuristicLab.Common; 30 31 29 #endregion 32 30 … … 40 38 public static class GenerationalDistanceCalculator { 41 39 public static double CalculateGenerationalDistance<TP1, TP2>(IEnumerable<TP1> qualities, IEnumerable<TP2> bestKnownFront, double p) where TP1 : IReadOnlyList<double> where TP2 : IReadOnlyList<double> { 42 if (qualities == null || bestKnownFront == null) throw new ArgumentNullException( "Fronts must not be null");40 if (qualities == null || bestKnownFront == null) throw new ArgumentNullException(nameof(qualities)); 43 41 if (p.IsAlmost(0.0)) throw new ArgumentException("p must not be zero."); 44 42 var mat = bestKnownFront.ToMatrix(); 45 43 if (mat.GetLength(0) == 0) throw new ArgumentException("Fronts must not be empty."); 46 44 47 alglib.kdtree tree; 48 alglib.kdtreebuild(mat, mat.GetLength(0), mat.GetLength(1), 0, 2, out tree); 45 alglib.kdtreebuild(mat, mat.GetLength(0), mat.GetLength(1), 0, 2, out var tree); 49 46 var sum = 0.0; 50 47 var summand = new double[1];
Note: See TracChangeset
for help on using the changeset viewer.