Changeset 66:bbb9483fe715 in rrlib_geometry


Ignore:
Timestamp:
14.03.2014 17:15:51 (6 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
13.10
Children:
67:904ae7bd448b, 71:15933528431e
Phase:
public
Message:

Adapted to changes in rrlib_math

Location:
space_partitioning
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • space_partitioning/tKDTree.h

    r60 r66  
    147147  typedef geometry::tPoint<Tdimension, TElement> tPoint; 
    148148 
    149   typedef typename tPoint::tMetric tMetric; 
    150  
    151149  /*! 
    152150   * \brief An inner class of the tKDTree template for the nodes of the tree 
     
    182180     * \param metric         A functor that computes an appropriate metric 
    183181     */ 
    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); 
    186184 
    187185    /*! 
     
    261259    tPoint center_of_mass; 
    262260 
    263     size_t SelectSplitAxis(tMetric metric) const; 
     261    template <typename Metric> 
     262    size_t SelectSplitAxis(Metric metric) const; 
    264263  }; 
    265264 
     
    283282   * in the underlying data. 
    284283   */ 
    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); 
    287286 
    288287  /*! 
  • space_partitioning/tKDTree.hpp

    r60 r66  
    6767//---------------------------------------------------------------------- 
    6868template <size_t Tdimension, typename TElement> 
    69 template <typename TIterator> 
    70 tKDTree<Tdimension, TElement>::tKDTree(TIterator begin_points, TIterator end_points, tMetric metric) 
     69template <typename TIterator, typename Metric> 
     70tKDTree<Tdimension, TElement>::tKDTree(TIterator begin_points, TIterator end_points, Metric metric) 
    7171  : root(new tNode(begin_points, end_points, metric)) 
    7272{} 
     
    9595//---------------------------------------------------------------------- 
    9696template <size_t Tdimension, typename TElement> 
    97 template <typename TIterator> 
    98 tKDTree<Tdimension, TElement>::tNode::tNode(TIterator points_begin, TIterator points_end, tMetric metric) 
     97template <typename TIterator, typename Metric> 
     98tKDTree<Tdimension, TElement>::tNode::tNode(TIterator points_begin, TIterator points_end, Metric metric) 
    9999  : bounding_box(points_begin, points_end), 
    100100    split_axis(SelectSplitAxis(metric)), 
     
    232232//---------------------------------------------------------------------- 
    233233template <size_t Tdimension, typename TElement> 
    234 size_t tKDTree<Tdimension, TElement>::tNode::SelectSplitAxis(tMetric metric) const 
     234template <typename Metric> 
     235size_t tKDTree<Tdimension, TElement>::tNode::SelectSplitAxis(Metric metric) const 
    235236{ 
    236237  tPoint sample_point; 
Note: See TracChangeset for help on using the changeset viewer.