- Timestamp:
- 12/12/13 01:06:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/Visualization/Program.cs
r10198 r10224 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Diagnostics; 25 24 using System.Linq; … … 42 41 double[][] inputs = CreateRandomData(nrOfSamples, sampleSize); 43 42 44 var convAlgData = ConvertPermutationToVertex(inputs);45 46 47 43 Stopwatch watch = new Stopwatch(); 48 44 watch.Start(); 49 var result2 = HyperHull.Calculate UsingSMO(inputs);45 var result2 = HyperHull.Calculate(inputs); 50 46 watch.Stop(); 51 47 Console.WriteLine("HyperHull: " + watch.ElapsedMilliseconds); 52 48 watch.Restart(); 53 var result1 = ConvexHull.Create( convAlgData).Points.Select(x => x.Position).ToList();49 var result1 = ConvexHull.Create(inputs).Points.Select(x => x.Position).ToList(); 54 50 watch.Stop(); 55 51 Console.WriteLine("MIConvexHull: " + watch.ElapsedMilliseconds); … … 81 77 } 82 78 83 private static List<DefaultVertex> ConvertPermutationToVertex(double[][] data) {84 List<DefaultVertex> result = new List<DefaultVertex>();85 for (int i = 0; i < data.Count(); i++) {86 double[] d = data[i];87 DefaultVertex vertex = new DefaultVertex();88 vertex.Position = d;89 result.Add(vertex);90 91 }92 return result;93 }94 95 79 private static double[][] CreateRandomData(int n, int m) { 96 80 double[][] result = new double[n][];
Note: See TracChangeset
for help on using the changeset viewer.