- Timestamp:
- 12/12/13 01:06:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullTest.cs
r10222 r10224 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Diagnostics; 25 24 using System.Linq; … … 36 35 int sampleSize = 2; 37 36 double[][] inputs = ConvexHullTest.CreateRandomData(nrOfSamples, sampleSize); 38 var convAlgData = ConvertPermutationToVertex(inputs);39 37 40 38 Stopwatch watch = new Stopwatch(); … … 44 42 Console.WriteLine("LPHull: " + watch.ElapsedMilliseconds); 45 43 watch.Restart(); 46 var result1 = ConvexHull.Create( convAlgData).Points.Select(x => x.Position).ToList();44 var result1 = ConvexHull.Create(inputs).Points.Select(x => x.Position).ToList(); 47 45 watch.Stop(); 48 46 Console.WriteLine("MIConvexHull: " + watch.ElapsedMilliseconds); … … 140 138 return result; 141 139 } 142 143 private List<DefaultVertex> ConvertPermutationToVertex(double[][] data) {144 List<DefaultVertex> result = new List<DefaultVertex>();145 for (int i = 0; i < data.Count(); i++) {146 double[] d = data[i];147 DefaultVertex vertex = new DefaultVertex();148 vertex.Position = d;149 result.Add(vertex);150 }151 return result;152 }153 140 } 154 141 }
Note: See TracChangeset
for help on using the changeset viewer.