xc
|
k-d tree for searching the nearest element to a given position. More...
#include <KDTreeElements.h>
Public Types | |
typedef kd_tree::KDTree< 3, ElemPos, std::pointer_to_binary_function< ElemPos, size_t, double > > | tree_type |
Public Member Functions | |
KDTreeElements (void) | |
Constructor. | |
void | insert (const Element &) |
void | erase (const Element &) |
void | clear (void) |
const Element * | getNearest (const Pos3d &pos) const |
Returns the node closest to the position being passed as parameter. | |
const Element * | getNearest (const Pos3d &pos, const double &r) const |
Returns the element closest to the position being passed as parameter. More... | |
Additional Inherited Members | |
Protected Types inherited from kd_tree::KDTree< 3, ElemPos, std::pointer_to_binary_function< ElemPos, size_t, double > > | |
typedef _Alloc_base< ElemPos, std::allocator< _Node< ElemPos > > > | _Base |
typedef _Base::allocator_type | allocator_type |
typedef _Node_base * | _Base_ptr |
typedef _Node_base const * | _Base_const_ptr |
typedef _Node< ElemPos > * | _Link_type |
typedef _Node< ElemPos > const * | _Link_const_type |
typedef _Node_compare< ElemPos, std::pointer_to_binary_function< ElemPos, size_t, double >, std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > > | _Node_compare_ |
typedef _Region< __K, ElemPos, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, std::pointer_to_binary_function< ElemPos, size_t, double >, std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > > | _Region_ |
typedef ElemPos | value_type |
typedef value_type * | pointer |
typedef value_type const * | const_pointer |
typedef value_type & | reference |
typedef value_type const & | const_reference |
typedef std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type | subvalue_type |
typedef squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > ::distance_type | distance_type |
typedef size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef _Iterator< ElemPos, const_reference, const_pointer > | const_iterator |
typedef const_iterator | iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Protected Types inherited from kd_tree::_Alloc_base< ElemPos, std::allocator< _Node< ElemPos > > > | |
typedef _Node< ElemPos > | _Node_ |
typedef _Node_::_Base_ptr | _Base_ptr |
typedef std::allocator< _Node< ElemPos > > | allocator_type |
Protected Member Functions inherited from kd_tree::KDTree< 3, ElemPos, std::pointer_to_binary_function< ElemPos, size_t, double > > | |
void | _M_check_children (_Link_const_type child, _Link_const_type parent, size_type const level, bool to_the_left) |
void | _M_check_node (_Link_const_type node, size_type const level) |
void | _M_empty_initialise () |
iterator | _M_insert_left (_Link_type __N, const_reference __V) |
iterator | _M_insert_right (_Link_type __N, const_reference __V) |
iterator | _M_insert (_Link_type __N, const_reference __V, size_type const __L) |
_Link_type | _M_erase (_Link_type dead_dad, size_type const level) |
_Link_type | _M_get_erase_replacement (_Link_type node, size_type const level) |
std::pair< _Link_type, size_type > | _M_get_j_min (std::pair< _Link_type, size_type > const node, size_type const level) |
std::pair< _Link_type, size_type > | _M_get_j_max (std::pair< _Link_type, size_type > const node, size_type const level) |
void | _M_erase_subtree (_Link_type __n) |
const_iterator | _M_find (_Link_const_type node, const_reference value, size_type const level) const |
const_iterator | _M_find_exact (_Link_const_type node, const_reference value, size_type const level) const |
bool | _M_matches_node_in_d (_Link_const_type __N, const_reference __V, size_type const __L) const |
bool | _M_matches_node_in_other_ds (_Link_const_type __N, const_reference __V, size_type const __L=0) const |
bool | _M_matches_node (_Link_const_type __N, const_reference __V, size_type __L=0) const |
size_type | _M_count_within_range (_Link_const_type __N, _Region_ const &__REGION, _Region_ const &__BOUNDS, size_type const __L) const |
Visitor | _M_visit_within_range (Visitor visitor, _Link_const_type N, _Region_ const ®ION, _Region_ const &BOUNDS, size_type const L) const |
_OutputIterator | _M_find_within_range (_OutputIterator out, _Link_const_type __N, _Region_ const &__REGION, _Region_ const &__BOUNDS, size_type const __L) const |
void | _M_optimise (_Iter const &__A, _Iter const &__B, size_type const __L) |
_Link_const_type | _M_get_root () const |
_Link_type | _M_get_root () |
void | _M_set_root (_Link_type n) |
_Link_const_type | _M_get_leftmost () const |
void | _M_set_leftmost (_Node_base *a) |
_Link_const_type | _M_get_rightmost () const |
void | _M_set_rightmost (_Node_base *a) |
_Link_type | _M_new_node (const_reference __V, _Base_ptr const __PARENT=NULL, _Base_ptr const __LEFT=NULL, _Base_ptr const __RIGHT=NULL) |
void | _M_delete_node (_Link_type __p) |
KDTree (std::pointer_to_binary_function< ElemPos, size_t, double > const &__acc=std::pointer_to_binary_function< ElemPos, size_t, double >(), squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > const &__dist=squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type >(), std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > const &__cmp=std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type >(), const allocator_type &__a=allocator_type()) | |
KDTree (const KDTree &__x) | |
KDTree (_InputIterator __first, _InputIterator __last, std::pointer_to_binary_function< ElemPos, size_t, double > const &acc=std::pointer_to_binary_function< ElemPos, size_t, double >(), squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > const &__dist=squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type >(), std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > const &__cmp=std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type >(), const allocator_type &__a=allocator_type()) | |
void | efficient_replace_and_optimise (std::vector< value_type > &writable_vector) |
KDTree & | operator= (const KDTree &__x) |
allocator_type | get_allocator () const |
size_type | size () const |
size_type | max_size () const |
bool | empty () const |
void | clear () |
std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > | value_comp () const |
Comparator for the values in the KDTree. More... | |
std::pointer_to_binary_function< ElemPos, size_t, double > | value_acc () const |
Accessor to the value's elements. More... | |
const squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > & | value_distance () const |
Distance calculator between 2 value's element. More... | |
squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > & | value_distance () |
const_iterator | begin () const |
const_iterator | end () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
iterator | insert (iterator, const_reference __V) |
iterator | insert (const_reference __V) |
void | insert (_InputIterator __first, _InputIterator __last) |
void | insert (iterator __pos, size_type __n, const value_type &__x) |
void | insert (iterator __pos, _InputIterator __first, _InputIterator __last) |
void | erase (const_reference __V) |
void | erase (const_iterator const &__IT) |
void | erase_exact (const_reference __V) |
const_iterator | find (SearchVal const &__V) const |
const_iterator | find_exact (SearchVal const &__V) const |
size_type | count_within_range (const_reference __V, subvalue_type const __R) const |
size_type | count_within_range (_Region_ const &__REGION) const |
Visitor | visit_within_range (SearchVal const &V, subvalue_type const R, Visitor visitor) const |
Visitor | visit_within_range (_Region_ const ®ION, Visitor visitor) const |
const_iterator | find_within_range_iterative (const_reference __a, const_reference __b) |
_OutputIterator | find_within_range (SearchVal const &val, subvalue_type const range, _OutputIterator out) const |
_OutputIterator | find_within_range (_Region_ const ®ion, _OutputIterator out) const |
std::pair< const_iterator, distance_type > | find_nearest (SearchVal const &__val) const |
std::pair< const_iterator, distance_type > | find_nearest (SearchVal const &__val, distance_type __max) const |
std::pair< const_iterator, distance_type > | find_nearest_if (SearchVal const &__val, distance_type __max, _Predicate __p) const |
void | optimise () |
void | optimize () |
void | check_tree () |
Protected Member Functions inherited from kd_tree::_Alloc_base< ElemPos, std::allocator< _Node< ElemPos > > > | |
_Node_ * | _M_allocate_node () |
void | _M_deallocate_node (_Node_ *const __P) |
void | _M_construct_node (_Node_ *__p, ElemPos const __V=ElemPos(), _Base_ptr const __PARENT=NULL, _Base_ptr const __LEFT=NULL, _Base_ptr const __RIGHT=NULL) |
void | _M_destroy_node (_Node_ *__p) |
_Alloc_base (allocator_type const &__A) | |
allocator_type | get_allocator () const |
Static Protected Member Functions inherited from kd_tree::KDTree< 3, ElemPos, std::pointer_to_binary_function< ElemPos, size_t, double > > | |
static _Link_type | _S_parent (_Base_ptr N) |
static _Link_const_type | _S_parent (_Base_const_ptr N) |
static void | _S_set_parent (_Base_ptr N, _Base_ptr p) |
static void | _S_set_left (_Base_ptr N, _Base_ptr l) |
static _Link_type | _S_left (_Base_ptr N) |
static _Link_const_type | _S_left (_Base_const_ptr N) |
static void | _S_set_right (_Base_ptr N, _Base_ptr r) |
static _Link_type | _S_right (_Base_ptr N) |
static _Link_const_type | _S_right (_Base_const_ptr N) |
static bool | _S_is_leaf (_Base_const_ptr N) |
static const_reference | _S_value (_Link_const_type N) |
static const_reference | _S_value (_Base_const_ptr N) |
static _Link_const_type | _S_minimum (_Link_const_type __X) |
static _Link_const_type | _S_maximum (_Link_const_type __X) |
Protected Attributes inherited from kd_tree::KDTree< 3, ElemPos, std::pointer_to_binary_function< ElemPos, size_t, double > > | |
_Link_type | _M_root |
_Node_base | _M_header |
size_type | _M_count |
std::pointer_to_binary_function< ElemPos, size_t, double > | _M_acc |
std::less< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > | _M_cmp |
squared_difference< typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type, typename std::pointer_to_binary_function< ElemPos, size_t, double > ::result_type > | _M_dist |
Protected Attributes inherited from kd_tree::_Alloc_base< ElemPos, std::allocator< _Node< ElemPos > > > | |
allocator_type | _M_node_allocator |
k-d tree for searching the nearest element to a given position.
See k-d tree <
const XC::Element * XC::KDTreeElements::getNearest | ( | const Pos3d & | pos, |
const double & | r | ||
) | const |
Returns the element closest to the position being passed as parameter.