Feel++ 0.91.0

Feel::KDTree Class Reference

KDTree class. More...

#include <kdtree.hpp>

List of all members.

Public Types

Typedefs
typedef ublas::vector< double > node_type
typedef boost::tuple
< node_type, size_type,
uint16_type, size_type
index_node_type
typedef std::vector
< index_node_type > 
points_type
typedef points_type::iterator points_iterator
typedef points_type::const_iterator points_const_iterator
typedef boost::tuple
< node_type, size_type,
uint16_type, size_type, double > 
index_node_search_type
typedef std::vector
< index_node_search_type > 
points_search_type
typedef
points_search_type::iterator 
points_search_iterator
typedef
points_search_type::const_iterator 
points_search_const_iterator

Public Member Functions

Constructors, destructor
 KDTree ()
 KDTree (KDTree const &tree)
 ~KDTree ()
Accessors
size_type nPoints () const
const points_type & points () const
const points_search_type & pointsNearNeighbor () const
Methods
void clear ()
void reserve (size_type n)
void nbNearNeighbor (size_type n)
size_type addPoint (node_type const &n, size_type indice_global=0)
void addPointWithId (const node_type &n, size_type i, uint16_type comp, size_type indice_global=0)
void pointsInBox (points_type &inpts, const node_type &min, const node_type &max)
void search (const node_type &node_)
void showResultSearch ()
void writeLatexData (std::string __nameFile="kdtreeData.tex")

Detailed Description

KDTree class.

In computer science, a kd-tree (short for k-dimensional tree) is a space-partitioning data structure for organizing points in a k-dimensional space. kd-trees are a useful data structure for several applications, such as searches involving a multidimensional search key (e.g. range searches and nearest neighbor searches). kd-trees are a special case of BSP trees.

Author:
Christophe Prud'homme
See also:
RegionTree

Member Function Documentation

size_type Feel::KDTree::addPoint ( node_type const &  n,
size_type  indice_global = 0 
) [inline]

insert a new point in the tree

Returns:
the index of the point

References addPointWithId().

void Feel::KDTree::addPointWithId ( const node_type &  n,
size_type  i,
uint16_type  comp,
size_type  indice_global = 0 
) [inline]

insert a new point, with an associated number.

Referenced by addPoint().

void Feel::KDTree::clear ( ) [inline]

reset the tree, remove all points

void Feel::KDTree::nbNearNeighbor ( size_type  n) [inline]

define the max number of point for the research( Default is 4 )

size_type Feel::KDTree::nPoints ( ) const [inline]

get the number of points in the tree

const points_type& Feel::KDTree::points ( ) const [inline]

get the points set

void Feel::KDTree::pointsInBox ( points_type &  inpts,
const node_type &  min,
const node_type &  max 
)

fills ipts with the indexes of points in the box [min,max]

const points_search_type& Feel::KDTree::pointsNearNeighbor ( ) const [inline]

get the points Near Neighbor set

void Feel::KDTree::reserve ( size_type  n) [inline]

reserve memory for the index/node pair

void Feel::KDTree::search ( const node_type &  node_)

search the neighbors points of M_node_search in the kd-tree

void Feel::KDTree::showResultSearch ( )

print the result of the research

void Feel::KDTree::writeLatexData ( std::string  __nameFile = "kdtreeData.tex")

print in a file the scatterplot with the cuts of hyperplan (2d et 3d)