Changeset 21341 for issm/trunk/src/c/classes/kriging/Covertree.h
- Timestamp:
- 11/04/16 13:48:43 (8 years ago)
- Location:
- issm/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c
- Property svn:ignore
-
issm/trunk/src/c/classes/kriging/Covertree.h
r20500 r21341 25 25 * has itself as a child in a cover tree. 26 26 */ 27 std::vector<CoverTreeNode*> getChildren(int level) const;28 27 void addChild(int level, CoverTreeNode* p); 29 void removeChild(int level, CoverTreeNode* p);30 28 void addObservation(const Observation& o); 31 void removeObservation(const Observation& o);32 const std::vector<Observation>& getObservations() { return _observations; }33 29 double distance(const CoverTreeNode& p) const; 34 30 bool isSingle() const; 35 31 bool hasObservation(const Observation& o) const; 32 std::vector<CoverTreeNode*> getChildren(int level) const; 36 33 const Observation& getObservation() const; 34 const std::vector<Observation>& getObservations() { return _observations; } 35 void removeChild(int level, CoverTreeNode* p); 36 void removeObservation(const Observation& o); 37 37 38 38 /** … … 51 51 int _minLevel; //A level beneath which there are no more new nodes. 52 52 53 std::vector<CoverTreeNode*> kNearestNodes(const Observation& o, const unsigned int& k) const; 53 /* Finds the node in Q with the minimum distance to p. Returns a pair 54 * consisting of this node and the distance. */ 55 distNodePair distance(const Observation& p,const std::vector<CoverTreeNode*>& Q); 54 56 /** 55 57 * Recursive implementation of the insert algorithm (see paper). … … 57 59 bool insert_rec(const Observation& p, const std::vector<distNodePair>& Qi,const int& level); 58 60 59 /* Finds the node in Q with the minimum distance to p. Returns a pair 60 * consisting of this node and the distance. */ 61 distNodePair distance(const Observation& p,const std::vector<CoverTreeNode*>& Q); 62 63 61 std::vector<CoverTreeNode*> kNearestNodes(const Observation& o, const unsigned int& k) const; 64 62 void remove_rec(const Observation& p, std::map<int,std::vector<distNodePair> >& coverSets, int level, bool& multi); 65 63 … … 80 78 81 79 /** 80 * Insert newPoint into the cover tree. If newPoint is already present, 81 * (that is, newPoint==p for some p already in the tree), then the tree 82 * is unchanged. If p.distance(newPoint)==0.0 but newPoint!=p, then 83 * newPoint WILL be inserted and both points may be returned in k-nearest- 84 * neighbor searches. 85 */ 86 void insert(const Observation& newObservation); 87 88 /** 82 89 * Just for testing/debugging. Returns true iff the cover tree satisfies the 83 90 * the covering tree invariants (every node in level i is greater than base^i … … 88 95 bool isValidTree() const; 89 96 90 /**91 * Insert newPoint into the cover tree. If newPoint is already present,92 * (that is, newPoint==p for some p already in the tree), then the tree93 * is unchanged. If p.distance(newPoint)==0.0 but newPoint!=p, then94 * newPoint WILL be inserted and both points may be returned in k-nearest-95 * neighbor searches.96 */97 void insert(const Observation& newObservation);98 97 99 98 /**
Note:
See TracChangeset
for help on using the changeset viewer.