Closest-pair problem: Difference between revisions
Content added Content deleted
Line 275: | Line 275: | ||
auto closeY = array(filter!((cdouble p){return abs(p.re-xDiv)<dm;})(yP)); |
auto closeY = array(filter!((cdouble p){return abs(p.re-xDiv)<dm;})(yP)); |
||
if (closeY.length > 1) { |
if (closeY.length > 1) { |
||
double minD = |
double minD = typeof(xP[0].re).infinity; |
||
size_t minI, minJ; |
size_t minI, minJ; |
||
foreach (i; 0 .. closeY.length-1) |
foreach (i; 0 .. closeY.length-1) |