// Test of closest pair algorithms // David Eppstein, UC Irvine, 20 Apr 1997 // // Hierarchical clustering application #include "Cluster.h" double Cluster(unsigned long np, PointSet & ps, ClosestPairs & cp) { double total = 0.0; point a, b; while (np >= 2) { total += cp(a,b); ps.interact(a,b); // merge clusters into a cp -= b; // drop b cp.UpdatePoint(a); // and tell closest pairs about merger np--; } return total; }