diff --git a/include/boost/algorithm/cluster/cluster_data.hpp b/include/boost/algorithm/cluster/cluster_data.hpp index c5186db..6e998fb 100644 --- a/include/boost/algorithm/cluster/cluster_data.hpp +++ b/include/boost/algorithm/cluster/cluster_data.hpp @@ -52,6 +52,7 @@ struct cluster_data value_type & back() { return m_pClusters->back(); } value_type const & back() const { return m_pClusters->back(); } + size_t size() const { return m_pClusters->size(); } private: boost::shared_ptr m_pClusters; }; diff --git a/include/boost/algorithm/cluster/dbscan.hpp b/include/boost/algorithm/cluster/dbscan.hpp index a7a9480..f0d8dcc 100644 --- a/include/boost/algorithm/cluster/dbscan.hpp +++ b/include/boost/algorithm/cluster/dbscan.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include namespace boost @@ -45,11 +46,12 @@ struct node * \param[in] d * \return The cluster data (partitioning of the tuples). */ -template +template cluster_data dbscan(NTupleIterT const & begin, NTupleIterT const & end, - typename NTupleIterT::difference_type const & eps, + DistanceT const & eps, size_t min_points, DistFunT const & d) { @@ -57,6 +59,8 @@ dbscan(NTupleIterT const & begin, function_requires< DistanceComparableConcept >(); //DistanceComparableConcept >(); + function_requires< + DistanceComparableConcept >(); // TODO: Rework the algorithm to NOT make this extra collection? typedef detail::node node; diff --git a/include/boost/algorithm/cluster/detail/naive_query.hpp b/include/boost/algorithm/cluster/detail/naive_query.hpp index 7ba780c..5a05409 100644 --- a/include/boost/algorithm/cluster/detail/naive_query.hpp +++ b/include/boost/algorithm/cluster/detail/naive_query.hpp @@ -21,12 +21,12 @@ namespace detail // TODO: Replace this naive query function w/ R*-tree or fractional cascading. // This query mechanism makes the runtime quadratic. -template +template static void naive_query( NTupleIterT const & query_pt, NTupleIterT const & begin, NTupleIterT const & end, - typename NTupleIterT::difference_type eps, + DistanceT const & eps, DistFunT const & d, std::vector & v) {