summaryrefslogtreecommitdiff
path: root/src/Spatial_searching
diff options
context:
space:
mode:
authorcjamin <cjamin@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-29 16:11:49 +0000
committercjamin <cjamin@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-29 16:11:49 +0000
commit0a2844e38d40bebb0825f7833f14f434635628ae (patch)
tree63b846c1c3c5ec66147b4c3ca924470a1e009441 /src/Spatial_searching
parentb50f6cf3469880a807554fc08695fa4d55c47758 (diff)
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
Diffstat (limited to 'src/Spatial_searching')
-rw-r--r--src/Spatial_searching/include/gudhi/Spatial_tree_data_structure.h29
1 files changed, 25 insertions, 4 deletions
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 .
+ * <a target="_blank" href="http://doc.cgal.org/latest/Spatial_searching/index.html">CGAL dD spatial searching data structures</a>.
+ * 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 <a target="_blank"
+ * href="http://doc.cgal.org/latest/Kernel_d/classCGAL_1_1Epick__d.html">CGAL::Epick_d</a> 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 <typename K, typename Point_container_>
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<std::ptrdiff_t,Point*,CGAL::Euclidean_distance<Traits_base> >(
(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<std::ptrdiff_t, Point*, CGAL::Euclidean_distance<Traits_base> >(
(Point*)&(m_points[0])) );