Changeset 66:bbb9483fe715 in rrlib_geometry
 Timestamp:
 14.03.2014 17:15:51 (6 years ago)
 Branch:
 13.10
 Children:
 67:904ae7bd448b, 71:15933528431e
 Phase:
 public
 Location:
 space_partitioning
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

space_partitioning/tKDTree.h
r60 r66 147 147 typedef geometry::tPoint<Tdimension, TElement> tPoint; 148 148 149 typedef typename tPoint::tMetric tMetric;150 151 149 /*! 152 150 * \brief An inner class of the tKDTree template for the nodes of the tree … … 182 180 * \param metric A functor that computes an appropriate metric 183 181 */ 184 template <typename TIterator >185 tNode(TIterator points_begin, TIterator points_end, tMetric metric);182 template <typename TIterator, typename Metric> 183 tNode(TIterator points_begin, TIterator points_end, Metric metric); 186 184 187 185 /*! … … 261 259 tPoint center_of_mass; 262 260 263 size_t SelectSplitAxis(tMetric metric) const; 261 template <typename Metric> 262 size_t SelectSplitAxis(Metric metric) const; 264 263 }; 265 264 … … 283 282 * in the underlying data. 284 283 */ 285 template <typename TIterator >286 tKDTree(TIterator points_begin, TIterator points_end, tMetric metric = tPoint::cEUCLIDEAN_DISTANCE);284 template <typename TIterator, typename Metric = decltype(tPoint::EuclideanDistance)> 285 tKDTree(TIterator points_begin, TIterator points_end, Metric metric = tPoint::EuclideanDistance); 287 286 288 287 /*! 
space_partitioning/tKDTree.hpp
r60 r66 67 67 // 68 68 template <size_t Tdimension, typename TElement> 69 template <typename TIterator >70 tKDTree<Tdimension, TElement>::tKDTree(TIterator begin_points, TIterator end_points, tMetric metric)69 template <typename TIterator, typename Metric> 70 tKDTree<Tdimension, TElement>::tKDTree(TIterator begin_points, TIterator end_points, Metric metric) 71 71 : root(new tNode(begin_points, end_points, metric)) 72 72 {} … … 95 95 // 96 96 template <size_t Tdimension, typename TElement> 97 template <typename TIterator >98 tKDTree<Tdimension, TElement>::tNode::tNode(TIterator points_begin, TIterator points_end, tMetric metric)97 template <typename TIterator, typename Metric> 98 tKDTree<Tdimension, TElement>::tNode::tNode(TIterator points_begin, TIterator points_end, Metric metric) 99 99 : bounding_box(points_begin, points_end), 100 100 split_axis(SelectSplitAxis(metric)), … … 232 232 // 233 233 template <size_t Tdimension, typename TElement> 234 size_t tKDTree<Tdimension, TElement>::tNode::SelectSplitAxis(tMetric metric) const 234 template <typename Metric> 235 size_t tKDTree<Tdimension, TElement>::tNode::SelectSplitAxis(Metric metric) const 235 236 { 236 237 tPoint sample_point;
Note: See TracChangeset
for help on using the changeset viewer.