- Timestamp:
- 10/22/13 00:05:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/DistanceMatrixToPointsTest.cs
r10060 r10078 29 29 [TestMethod] 30 30 public void TestDistanceMatrixConversion() { 31 int nrOfPoints = 5;31 int nrOfPoints = 4; 32 32 int dim = 2; 33 33 double[][] orgPoints = new double[nrOfPoints][]; … … 44 44 45 45 newPoints = DistanceMatrixToPoints.ConvertDistanceMatrixToPoints(orgDm); 46 46 47 CalculateDistanceMatrix(newDm, newPoints); 47 48 //TODO … … 68 69 69 70 private static double CalcEuclideanDistance(double[] p1, double[] p2) { 70 return Math.Sqrt(Math.Pow(p1[0] - p2[0], 2) + Math.Pow(p1[1] - p2[1], 2)); 71 double result = 0.0; 72 for (int i = 0; i < p1.Length; i++) { 73 result += Math.Pow(p1[i] - p2[i], 2); 74 } 75 return Math.Sqrt(result); 71 76 } 72 77
Note: See TracChangeset
for help on using the changeset viewer.