Changeset 18916
- Timestamp:
- 12/03/14 13:37:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/kriging/Covertree.cpp
r18914 r18916 29 29 std::vector<CoverTreeNode*> children = byeNode->getAllChildren(); 30 30 nodes.insert(nodes.begin(),children.begin(),children.end()); 31 //std::cout << _numNodes << "\n";32 31 delete byeNode; 33 //_numNodes--;34 32 } 35 33 } 36 34 35 /*Methods*/ 37 36 std::vector<Covertree::CoverTreeNode*> Covertree::kNearestNodes(const Observation& p, const unsigned int& k) const{ 38 37 if(_root==NULL) return std::vector<CoverTreeNode*>(); … … 82 81 return kNN; 83 82 } 84 bool Covertree::insert_rec(const Observation& p, 85 const std::vector<distNodePair>& Qi, 86 const int& level) 87 { 83 bool Covertree::insert_rec(const Observation& p, const std::vector<distNodePair>& Qi, const int& level){ 88 84 std::vector<std::pair<double, CoverTreeNode*> > Qj; 89 85 double sep = pow(base,level); … … 125 121 } 126 122 127 void Covertree::remove_rec(const Observation& p, 128 std::map<int,std::vector<distNodePair> >& coverSets, 129 int level, 130 bool& multi) 131 { 123 void Covertree::remove_rec(const Observation& p, std::map<int,std::vector<distNodePair> >& coverSets, int level, bool& multi){ 132 124 std::vector<distNodePair>& Qi = coverSets[level]; 133 125 std::vector<distNodePair>& Qj = coverSets[level-1]; … … 315 307 } 316 308 317 std::vector<Observation> Covertree::kNearestNeighbors(const Observation& p, 318 const unsigned int& k) const 319 { 309 std::vector<Observation> Covertree::kNearestNeighbors(const Observation& p, const unsigned int& k) const{ 320 310 if(_root==NULL) return std::vector<Observation>(); 321 311 std::vector<CoverTreeNode*> v = kNearestNodes(p, k); … … 330 320 } 331 321 332 void Covertree::print() const 333 { 322 void Covertree::print() const{ 334 323 int d = _maxLevel-_minLevel+1; 335 324 std::vector<CoverTreeNode*> Q; … … 477 466 return true; 478 467 } 479 480 /*Methods*/
Note:
See TracChangeset
for help on using the changeset viewer.