// Test of closest pair algorithms // David Eppstein, UC Irvine, 19 Apr 1997 // // Greedy matching application #include "GreedyMatching.h" #include "Error.h" #include double GreedyMatching(unsigned long npoints, PointSet &, ClosestPairs & cp) { double total = 0.0; while (npoints >= 2) { point a, b; total += cp(a,b); cp -= a; cp -= b; npoints -= 2; } return total; }