From 0a2844e38d40bebb0825f7833f14f434635628ae Mon Sep 17 00:00:00 2001 From: cjamin Date: Wed, 29 Jun 2016 16:11:49 +0000 Subject: Doc + new param (epsilon) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1355 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b2e70ef17cac8ca0f9dfaab430349468b59a60f5 --- .../include/gudhi/Spatial_tree_data_structure.h | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/Spatial_searching') diff --git a/src/Spatial_searching/include/gudhi/Spatial_tree_data_structure.h b/src/Spatial_searching/include/gudhi/Spatial_tree_data_structure.h index e633bfc0..5153720b 100644 --- a/src/Spatial_searching/include/gudhi/Spatial_tree_data_structure.h +++ b/src/Spatial_searching/include/gudhi/Spatial_tree_data_structure.h @@ -36,6 +36,26 @@ namespace Gudhi { namespace spatial_searching { + + /** + * \class Spatial_tree_data_structure Spatial_tree_data_structure.h gudhi/Spatial_tree_data_structure.h + * \brief Spatial tree data structure to perform (approximate) nearest neighbor search. + * + * \ingroup spatial_searching + * + * \details + * The class Spatial_tree_data_structure represents a tree-based data structure, based on . + * CGAL dD spatial searching data structures. + * It provides a simplified API to perform (approximate) nearest neighbor searches. Contrary to CGAL default behavior, the tree + * does not store the points themselves, but stores indices. + * + * \tparam K requires a CGAL::Epick_d class, which + * can be static if you know the ambiant dimension at compile-time, or dynamic if you don't. + * \tparam Point_container_ is the type of the container where points are stored (on the user side). + * It must provide random-access via `operator[]` and the points should be stored contiguously in memory. + * `std::vector` is a good candidate. + */ template class Spatial_tree_data_structure { @@ -126,7 +146,8 @@ public: KNS_range query_ANN(const Point &sp, unsigned int k, - bool sorted = true) const + bool sorted = true, + FT eps = FT(0)) const { // Initialize the search structure, and search all N points // Note that we need to pass the Distance explicitly since it needs to @@ -135,7 +156,7 @@ public: m_tree, sp, k, - FT(0), + eps, true, CGAL::Distance_adapter >( (Point*)&(m_points[0])), @@ -144,7 +165,7 @@ public: return search; } - INS_range query_incremental_ANN(const Point &sp) const + INS_range query_incremental_ANN(const Point &sp, FT eps = FT(0)) const { // Initialize the search structure, and search all N points // Note that we need to pass the Distance explicitly since it needs to @@ -152,7 +173,7 @@ public: Incremental_neighbor_search search( m_tree, sp, - FT(0), + eps, true, CGAL::Distance_adapter >( (Point*)&(m_points[0])) ); -- cgit v1.2.3