Changeset 10209 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers
- Timestamp:
- 12/09/13 16:57:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ConvexHullMeasures.cs
r10207 r10209 44 44 } 45 45 46 //calculate center for boundary triangulation (slowwwww.....)47 private static double[] CalculateInnerPoint(List<double[]> hyperHull) {48 double[] result = new double[hyperHull[0].Count()];49 50 for (int i = 0; i < hyperHull[0].Count(); i++) {51 result[i] = (hyperHull.Max(x => x[i]) + hyperHull.Min(x => x[i])) / 2.0;52 }53 54 return result;55 }56 57 46 //calculates the volume of a convex d-polytope 58 //decomposition based on boundary triangulation47 //decomposition based on delaunay triangulation 59 48 public static double CalculateVolume(List<double[]> convexHull) { 60 double[] innerPoint = CalculateInnerPoint(convexHull);61 double volume = 0.0;62 63 for (int i = 0; i < convexHull.Count - 1; i += 2) {64 List<double[]> simplex = new List<double[]>();65 simplex.Add(innerPoint);66 simplex.Add(convexHull[i]);67 simplex.Add(convexHull[i + 1]);68 volume += CalculateSimplexVolume(simplex);69 }70 return volume;71 }72 73 public static double CalculateVolumeNew(List<double[]> convexHull) {74 49 double volume = 0.0; 75 50
Note: See TracChangeset
for help on using the changeset viewer.