sheree
03-22-2008, 12:29 PM
Hello everyone,
I am new member, and I had problem
I wrote a code which needed a kdtree data structure for nearest neighbour algorithm, so I found a code written in c++, but in there I found " this " variable which I haven't seen like it before and I don't know what does it mean as well. Simply the code is a lass that have find parent function like that:
KDTEMPLATE
KDNODE* KDNODE::FindParent(Xtype* x0)
{
KDNODE* parent ;
KDNODE* next = this ;:eek:
int split ;
while(next)
{
split = next->axis ;
parent = next ;
if(x0[split] > next->x[split])
next = next->Right ;
else
next = next->Left ;
}
return parent ;
}
so if any one know what " this " means please tell me or may be you know where can I find a c++ documentations that illustrates it .
Thank in advance for any kind of help
I am new member, and I had problem
I wrote a code which needed a kdtree data structure for nearest neighbour algorithm, so I found a code written in c++, but in there I found " this " variable which I haven't seen like it before and I don't know what does it mean as well. Simply the code is a lass that have find parent function like that:
KDTEMPLATE
KDNODE* KDNODE::FindParent(Xtype* x0)
{
KDNODE* parent ;
KDNODE* next = this ;:eek:
int split ;
while(next)
{
split = next->axis ;
parent = next ;
if(x0[split] > next->x[split])
next = next->Right ;
else
next = next->Left ;
}
return parent ;
}
so if any one know what " this " means please tell me or may be you know where can I find a c++ documentations that illustrates it .
Thank in advance for any kind of help