Changeset 10008
- Timestamp:
- 09/26/13 23:56:55 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ConvexHullMeasures.cs
r10007 r10008 25 25 namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers { 26 26 public static class ConvexHullMeasures { 27 // TODO: Calculates onlythe volumne of a d-simplex28 p ublic static double CalculateVolume(List<double[]> hyperHull) {27 //Calculates the volumne of a d-simplex 28 private static double CalculateSimplexVolume(List<double[]> hyperHull) { 29 29 double[,] diffs = new double[hyperHull.Count, hyperHull.Count]; 30 30 … … 50 50 return result; 51 51 } 52 53 //calculate inner point for boundary triangulation (slowwwww.....) 54 private static double[] CalculateInnerPoint(List<double[]> hyperHull) { 55 double[] result = new double[hyperHull[0].Count()]; 56 57 for (int i = 0; i < hyperHull[0].Count(); i++) { 58 result[i] = hyperHull.Max(x => x[i]) - hyperHull.Min(x => x[i]); 59 } 60 61 return result; 62 } 63 64 //calculates the volume of a convex d-polytope 65 //decomposition based on boundary triangulation 66 public static double CalculateVolume(List<double[]> hyperHull) { 67 double[] innerPoint = CalculateInnerPoint(hyperHull); 68 double volume = 0.0; 69 70 for (int i = 0; i < hyperHull.Count - 1; i += 2) { 71 List<double[]> simplex = new List<double[]>(); 72 simplex.Add(innerPoint); 73 simplex.Add(hyperHull[i]); 74 simplex.Add(hyperHull[i + 1]); 75 volume += CalculateSimplexVolume(simplex); 76 } 77 return volume; 78 } 52 79 } 53 80 }
Note: See TracChangeset
for help on using the changeset viewer.