Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] NN, change the splitting rule of the tree

Subject: CGAL users discussion list

List archive

[cgal-discuss] NN, change the splitting rule of the tree


Chronological Thread 
  • From: Samaras <>
  • To:
  • Subject: [cgal-discuss] NN, change the splitting rule of the tree
  • Date: Wed, 20 Nov 2013 06:23:59 -0800 (PST)

Dear all,

cgal provides a number of splitting rule (
http://doc.cgal.org/latest/Spatial_searching/index.html#title3 ). I would
like, since I am a beginner, to not only read them in the manual, but try
them out too! :) If my understanding is correct, the tree is built before we
search for NNs., i.e. not a lazy built. As a result I am posting the code
until the tree is built. The default splitting rule is Sliding_midpoint.


#include <CGAL/Cartesian_d.h>
typedef CGAL::Cartesian_d<double> Kernel;
typedef Kernel::Point_d Point;

#include <CGAL/Manhattan_distance_iso_box_point.h>
#include <CGAL/K_neighbor_search.h>
#include <CGAL/Search_traits_2.h>

// from documentation
//CGAL::K_neighbor_search< Traits, GeneralDistance, Splitter, SpatialTree
>::K_neighbor_search

typedef Kernel TreeTraits;
typedef CGAL::Manhattan_distance_iso_box_point<TreeTraits> Distance;
//typedef CGAL::Midpoint_of_max_spread<TreeTraits> SplitRule; // This
can be
compiled, but how do I apply it to the tree?
typedef CGAL::K_neighbor_search<TreeTraits> Neighbor_search;
typedef Neighbor_search::Tree Tree;
...
Tree tree;
for(int i = 0; i < N; ++i)
tree.insert(v[i]); // v is an std::vector of points

I have also found two examples related to this question, but didn't help me.



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/NN-change-the-splitting-rule-of-the-tree-tp4658440.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page