- Timestamp:
- 04/24/17 14:45:37 (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/ManhattanDistance.cs
r14884 r14885 50 50 } 51 51 52 public static double GetDistance(IEnumerable<double> a, IEnumerable<double> b, double threshold) {53 double sum = 0;54 var it1 = a.GetEnumerator();55 var it2 = b.GetEnumerator();56 while (sum > threshold && it1.MoveNext() && it2.MoveNext()) {57 sum += Math.Abs(it1.Current - it2.Current);58 }59 it1.Dispose();60 it2.Dispose();61 return sum;62 }63 64 52 public override double Get(IEnumerable<double> a, IEnumerable<double> b) { 65 53 return GetDistance(a.ToArray(), b.ToArray()); 66 54 } 67 68 public override double Get(IEnumerable<double> a, IEnumerable<double> b, double threshold) {69 return GetDistance(a, b, threshold);70 }71 72 73 55 } 74 56 }
Note: See TracChangeset
for help on using the changeset viewer.