예제 #1
0
파일: KDNode.hpp 프로젝트: shazzing/KDTree
valType findDistance(const point<valType, dim>& lhs, const point<valType, dim>& rhs){
    valType dist = 0.0;
    size_t dimIndex = dim;
    while(dimIndex--){
        valType t = lhs.at(dimIndex) - rhs.at(dimIndex);
        dist += t*t;
    }
    return sqrt(dist);
}
예제 #2
0
파일: KDNode.hpp 프로젝트: shazzing/KDTree
 bool operator()(const point<valType, dim>& lhs, const point<valType, dim>& rhs){
     return lhs.at(index) < rhs.at(index);
 }