Jump to content

K-d tree: Difference between revisions

Updated second D entry
m (Updated first D entry)
(Updated second D entry)
Line 512:
}
 
void nearest(size_t dim)(in KdNode* root, in ref KdNode nd,
in size_t i, ref const(KdNode)* bestnd,
refin doublesize_t bestDisti, ref size_t nVisited)
ref const(KdNode)* best,
pure nothrow {
ref double bestDist,
ref size_t nVisited) pure nothrow {
static double dist(in ref KdNode a, in ref KdNode b) pure nothrow {
typeof(KdNode.x[0]) result = 0;
Line 564 ⟶ 566:
KdNode* root = makeTree!(2, 0)(wp);
 
const(KdNode)* found = null;
double bestDist = 0;
size_t nVisited = 0;
Line 587 ⟶ 589:
randPt(thisPt, rng);
 
const(KdNode)* found = null;
double bestDist = 0;
size_t nVisited = 0;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.