K-d tree: Difference between revisions

37 bytes removed ,  10 years ago
m
Explicit string concat in second D entry
(Updated both D entries)
m (Explicit string concat in second D entry)
Line 547:
 
void randPt(size_t dim=3)(ref KdNode v, ref Xorshift rng) nothrow {
foreach (immutable i; Iota!dim) {
v.x[i] = rng.front / double(Xorshift.max)uniform01;
rng.popFront;
}
}
 
Line 565 ⟶ 563:
nearest!2(root, thisPt, 0, found, bestDist, nVisited);
 
writefln("WP tree:\n Searching for %s\n" ~
" Found %s, dist = %g\n Seen %d nodes.\n",
thisPt.x[0..2], found.x[0..2], sqrt(bestDist), nVisited);