A class that represents a two dimensional K-d Tree (2-d Tree) that store data-elements into the leafs. More...
#include <Index.h>
Public Types | |
| typedef KdTreeNode::kdData | kdData | 
| Export data type.  More... | |
| typedef KdTreeNode::kdDataItem | kdDataItem | 
| Export data item type.  More... | |
| typedef KdTreeNode::kdKey | kdKey | 
| Export key type.  More... | |
| typedef KdTreeNode | kdNode | 
| Export node type.  More... | |
Public Member Functions | |
| AdaptativeIndex (const te::gm::Envelope &mbr, const std::size_t &bucketSize=12) | |
| Constructor.  More... | |
| void | build (std::vector< std::pair< kdKey, kdDataItem > > &dataSet) | 
| It inserts the data set into the tree.  More... | |
| void | clear () | 
| It clears all tree nodes.  More... | |
| const std::size_t & | getBucketSize () const | 
| It gets bucket size for leaf nodes.  More... | |
| const te::gm::Envelope & | getMBR () const | 
| It gets the minimum bounding box of all elements in the tree.  More... | |
| bool | isEmpty () const | 
| It returns true if the tree is empty and false otherwise.  More... | |
| void | nearestNeighborSearch (const kdKey &key, std::vector< kdDataItem > &report, std::vector< double > &sqrDists, const std::size_t &k) const | 
| It searches the nearest data in nodes: you must pass an array of kdDataItem of size "k" with coordinates values (X() and Y()) adjusted to td::numeric_limits<double>::max() (this dummy values will be replaced at processing time), and if not all neighbors are found so sqrDists will contains td::numeric_limits<double>::max() in array index.  More... | |
| void | search (const te::gm::Envelope &e, std::vector< KdTreeNode * > &report) const | 
| Range search query.  More... | |
| void | search (const te::gm::Envelope &e, std::vector< kdDataItem > &report) const | 
| Range search query: the refinement is already done.  More... | |
| void | setBucketSize (const std::size_t &size) | 
| It sets bucket size for leaf nodes.  More... | |
| void | setMBR (const te::gm::Envelope &mbr) | 
| It sets the minimum bounding box of all elements in the tree.  More... | |
| const std::size_t & | size () const | 
| It returns the number of tree nodes.  More... | |
| ~AdaptativeIndex () | |
| Destructor.  More... | |
Private Member Functions | |
| AdaptativeIndex (const AdaptativeIndex &rhs) | |
| No copy constructor allowed.  More... | |
| double | average (std::vector< std::pair< kdKey, kdDataItem > > &dataSet, const char &discriminator) const | 
| It returns the average value along the axis.  More... | |
| KdTreeNode * | build (std::vector< std::pair< kdKey, kdDataItem > > &dataSet, double averageValue, const te::gm::Envelope &mbr) | 
| It builds the tree recursivily.  More... | |
| void | erase (KdTreeNode *node) | 
| It Erases a node from the tree and all nodes below it.  More... | |
| void | nearestNeighborSearch (KdTreeNode *node, const kdKey &key, std::vector< kdDataItem > &report, std::vector< double > &sqrDists, te::gm::Envelope &e) const | 
| Recursive nearest neighbor search.  More... | |
| AdaptativeIndex & | operator= (const AdaptativeIndex &rhs) | 
| No assignment operator allowed.  More... | |
| void | search (const te::gm::Envelope &e, KdTreeNode *node, std::vector< KdTreeNode * > &report) const | 
| Recursive range query.  More... | |
| void | update (KdTreeNode *node, const kdKey &key, std::vector< kdDataItem > &report, std::vector< double > &sqrDists, te::gm::Envelope &e) const | 
| It updates the neighbor list.  More... | |
Private Attributes | |
| std::size_t | m_bucketSize | 
| Bucket size (maximum number of elements in each node).  More... | |
| te::gm::Envelope | m_mbr | 
| Minimum bounding box of all nodes.  More... | |
| KdTreeNode * | m_root | 
| Pointer to the root node.  More... | |
| std::size_t | m_size | 
| The size of the K-d Tree (number of nodes).  More... | |
A class that represents a two dimensional K-d Tree (2-d Tree) that store data-elements into the leafs.
| typedef KdTreeNode::kdData te::sam::kdtree::AdaptativeIndex< KdTreeNode >::kdData | 
| typedef KdTreeNode::kdDataItem te::sam::kdtree::AdaptativeIndex< KdTreeNode >::kdDataItem | 
| typedef KdTreeNode::kdKey te::sam::kdtree::AdaptativeIndex< KdTreeNode >::kdKey | 
| typedef KdTreeNode te::sam::kdtree::AdaptativeIndex< KdTreeNode >::kdNode | 
      
  | 
  inline | 
      
  | 
  inline | 
Destructor.
Definition at line 379 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::clear().
      
  | 
  private | 
No copy constructor allowed.
| rhs | The other index. | 
      
  | 
  inlineprivate | 
It returns the average value along the axis.
Definition at line 495 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::operator=(), and te::sam::kdtree::Index< KdTreeNode >::size().
      
  | 
  inline | 
It inserts the data set into the tree.
Definition at line 432 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_mbr, and te::sam::kdtree::Index< KdTreeNode >::m_root.
      
  | 
  inlineprivate | 
It builds the tree recursivily.
Definition at line 563 of file Index.h.
References te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::sam::kdtree::Index< KdTreeNode >::m_size, te::gm::Envelope::m_urx, te::gm::Envelope::m_ury, and te::sam::kdtree::Index< KdTreeNode >::size().
      
  | 
  inline | 
It clears all tree nodes.
Definition at line 385 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::erase(), te::sam::kdtree::Index< KdTreeNode >::m_root, and te::sam::kdtree::Index< KdTreeNode >::m_size.
      
  | 
  inlineprivate | 
It Erases a node from the tree and all nodes below it.
Definition at line 471 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::erase(), and te::sam::kdtree::Index< KdTreeNode >::search().
      
  | 
  inline | 
      
  | 
  inline | 
It gets the minimum bounding box of all elements in the tree.
Definition at line 414 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_mbr.
      
  | 
  inline | 
It returns true if the tree is empty and false otherwise.
Definition at line 402 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_root.
      
  | 
  inline | 
It searches the nearest data in nodes: you must pass an array of kdDataItem of size "k" with coordinates values (X() and Y()) adjusted to td::numeric_limits<double>::max() (this dummy values will be replaced at processing time), and if not all neighbors are found so sqrDists will contains td::numeric_limits<double>::max() in array index.
Definition at line 442 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_root.
      
  | 
  inlineprivate | 
Recursive nearest neighbor search.
Definition at line 664 of file Index.h.
References te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, and te::gm::Envelope::m_ury.
      
  | 
  private | 
No assignment operator allowed.
| rhs | The other index. | 
      
  | 
  inline | 
Range search query.
Definition at line 459 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_root, and te::sam::kdtree::Index< KdTreeNode >::search().
      
  | 
  inline | 
Range search query: the refinement is already done.
Definition at line 542 of file Index.h.
References te::gm::Intersects(), and te::sam::kdtree::Index< KdTreeNode >::search().
      
  | 
  inlineprivate | 
Recursive range query.
Definition at line 707 of file Index.h.
References te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, te::gm::Envelope::m_ury, and te::sam::kdtree::Index< KdTreeNode >::search().
      
  | 
  inline | 
It sets bucket size for leaf nodes.
Definition at line 420 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::size().
      
  | 
  inline | 
It sets the minimum bounding box of all elements in the tree.
Definition at line 408 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_mbr.
      
  | 
  inline | 
It returns the number of tree nodes.
Definition at line 396 of file Index.h.
References te::sam::kdtree::Index< KdTreeNode >::m_size.
      
  | 
  inlineprivate | 
It updates the neighbor list.
Definition at line 734 of file Index.h.
References te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, te::gm::Envelope::m_ury, and te::sam::kdtree::Index< KdTreeNode >::size().
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private |