Browse files

Merge pull request #3 from pechy/master

fixed compilation error
  • Loading branch information...
2 parents 8763418 + 95b3fd2 commit b6de5de9cafcc496f640dd8ddc63e061d0226519 @DNCrane committed Jul 6, 2015
Showing with 11 additions and 11 deletions.
  1. +11 −11 Cover_Tree.h
View
22 Cover_Tree.h
@@ -216,8 +216,8 @@ CoverTree<Point>::kNearestNodes(const Point& p, const unsigned int& k) const
//minNodes stores the k nearest known points to p.
std::set<distNodePair> minNodes;
- minNodes.insert(make_pair(maxDist,_root));
- std::vector<distNodePair> Qj(1,make_pair(maxDist,_root));
+ minNodes.insert(std::make_pair(maxDist,_root));
+ std::vector<distNodePair> Qj(1,std::make_pair(maxDist,_root));
for(int level = _maxLevel; level>=_minLevel;level--) {
typename std::vector<distNodePair>::const_iterator it;
int size = Qj.size();
@@ -228,13 +228,13 @@ CoverTree<Point>::kNearestNodes(const Point& p, const unsigned int& k) const
for(it2=children.begin(); it2!=children.end(); ++it2) {
double d = p.distance((*it2)->getPoint());
if(d < maxDist || minNodes.size() < k) {
- minNodes.insert(make_pair(d,*it2));
+ minNodes.insert(std::make_pair(d,*it2));
//--minNodes.end() gives us an iterator to the greatest
//element of minNodes.
if(minNodes.size() > k) minNodes.erase(--minNodes.end());
maxDist = (--minNodes.end())->first;
}
- Qj.push_back(make_pair(d,*it2));
+ Qj.push_back(std::make_pair(d,*it2));
}
}
double sep = maxDist + pow(base, level);
@@ -275,7 +275,7 @@ bool CoverTree<Point>::insert_rec(const Point& p,
double d = p.distance((*it2)->getPoint());
if(d<minDist) minDist = d;
if(d<=sep) {
- Qj.push_back(make_pair(d,*it2));
+ Qj.push_back(std::make_pair(d,*it2));
}
}
}
@@ -335,7 +335,7 @@ void CoverTree<Point>::remove_rec(const Point& p,
if(dist == 0.0) parent = it->second;
}
if(dist <= sep) {
- Qj.push_back(make_pair(dist,*it2));
+ Qj.push_back(std::make_pair(dist,*it2));
}
}
}
@@ -390,7 +390,7 @@ void CoverTree<Point>::remove_rec(const Point& p,
}
minDQ=DBL_MAX;
if(br) break;
- Q.push_back(make_pair((*it)->distance(p),*it));
+ Q.push_back(std::make_pair((*it)->distance(p),*it));
i++;
sep = pow(base,i);
}
@@ -421,7 +421,7 @@ CoverTree<Point>::distance(const Point& p,
minNode = *it;
}
}
- return make_pair(minDist,minNode);
+ return std::make_pair(minDist,minNode);
}
template<class Point>
@@ -442,7 +442,7 @@ void CoverTree<Point>::insert(const Point& newPoint)
//distance 0 to newPoint in the cover tree (the previous lines check it)
insert_rec(newPoint,
std::vector<distNodePair>
- (1,make_pair(_root->distance(newPoint),_root)),
+ (1,std::make_pair(_root->distance(newPoint),_root)),
_maxLevel);
}
}
@@ -476,9 +476,9 @@ void CoverTree<Point>::remove(const Point& p)
}
}
std::map<int, std::vector<distNodePair> > coverSets;
- coverSets[_maxLevel].push_back(make_pair(_root->distance(p),_root));
+ coverSets[_maxLevel].push_back(std::make_pair(_root->distance(p),_root));
if(removingRoot)
- coverSets[_maxLevel].push_back(make_pair(newRoot->distance(p),newRoot));
+ coverSets[_maxLevel].push_back(std::make_pair(newRoot->distance(p),newRoot));
bool multi = false;
remove_rec(p,coverSets,_maxLevel,multi);
if(removingRoot) {

0 comments on commit b6de5de

Please sign in to comment.