Welcome to the NetCologne GmbH open source mirroring service!
This machine mirrors various open-source projects.
20 Gbit/s uplink.
If there are any issues or you want another project mirrored, please contact
mirror-service -=AT=- netcologne DOT de !
GetFEM: src/getfem/bgeot_kdtree.h Source File
Go to the documentation of this file.
32 #ifndef BGEOT_KDTREE_H
33 #define BGEOT_KDTREE_H
47 struct kdtree_elt_base {
48 enum { PTS_PER_LEAF=8 };
50 bool isleaf()
const {
return (n != 0); }
51 kdtree_elt_base(
unsigned n_) : n(n_) {}
52 virtual ~kdtree_elt_base() {}
64 void swap(
index_node_pair& other) { std::swap(i,other.i); n.swap(other.n);}
104 std::unique_ptr<kdtree_elt_base> tree;
114 void reserve(
size_type n) { pts.reserve(n); }
124 GMM_ASSERT2(N == n.size(),
"invalid dimension");
125 if (tree) clear_tree();
128 size_type nb_points()
const {
return pts.size(); }
133 const base_node &min,
134 const base_node &max);
137 scalar_type nearest_neighbor(index_node_pair &ipt,
138 const base_node &pos);
140 typedef std::vector<size_type>::const_iterator ITER;
std::vector< index_node_pair > kdtree_tab_type
store a set of points with associated indexes.
size_t size_type
used as the common size type in the library
size_type add_point(const base_node &n)
insert a new point
Balanced tree over a set of points.
void clear()
reset the tree, remove all points
store a point and the associated index for the kdtree.
void add_point_with_id(const base_node &n, size_type i)
insert a new point, with an associated number.