6 #define MAX_DOUBLE std::numeric_limits<double>::max()    11     : m_vectorOfPoints(points)
    12     , m_noOfPoints(points.size())
    13     , m_vectorOfPointIndexes(m_noOfPoints)
    14     , m_vectorOfReversedPointIndexes(m_noOfPoints)
    16     int ntmp, m, k, kk, j, nowtask, jbox, np, tmom, tdim, ptlo, pthi;
    19     int taskmom[50], taskdim[50];
    25     for (ntmp = m_noOfPoints; ntmp; ntmp >>= 1)
    49         tmom = taskmom[nowtask];
    50         tdim = taskdim[nowtask];
    70             taskmom[++nowtask] = jbox - 1;
    71             taskdim[nowtask] = (tdim + 1) % 2;
    74             taskmom[++nowtask] = jbox;
    75             taskdim[nowtask] = (tdim + 1) % 2;
    92     int i, ia, ir, j, l, mid;
    99             if (ir == l + 1 && arr[idx[ir]] < arr[idx[l]]) {
   100                 std::swap(idx[l], idx[ir]);
   105             std::swap(idx[mid], idx[l + 1]);
   106             if (arr[idx[l]] > arr[idx[ir]])
   107                 std::swap(idx[l], idx[ir]);
   108             if (arr[idx[l + 1]] > arr[idx[ir]])
   109                 std::swap(idx[l + 1], idx[ir]);
   110             if (arr[idx[l]] > arr[idx[l + 1]])
   111                 std::swap(idx[l], idx[l + 1]);
   119                 while (arr[idx[i]] < a);
   122                 while (arr[idx[j]] > a);
   125                 std::swap(idx[i], idx[j]);
   139     if (idxOfPoint1 == idxOfPoint2)
 
std::vector< int > m_vectorOfPointIndexes
 
std::vector< Point > m_vectorOfPoints
 
int partition(const int k, int *index, int n, double *arr)
 
int locate(const Point &p)
 
KDTree(std::vector< Point > &points)
 
double * m_arrayOfCoordinates
 
double distance(int idxOfPoint1, int idxOfPoint2)
 
std::vector< int > m_vectorOfReversedPointIndexes