Changeset 22:f73e1bdbc9bf in rrlib_geometry


Ignore:
Timestamp:
14.01.2012 03:30:00 (8 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Message:

Moved metric definitions to vector class in rrlib_math

Location:
space_partitioning
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • space_partitioning/tKDTree.h

    r21 r22  
    146146 
    147147  typedef geometry::tPoint<Tdimension, TElement> tPoint; 
    148   typedef std::function < TElement(const tPoint &, const tPoint &) > tMetric; 
    149  
    150   static const tMetric cDEFAULT_METRIC; 
     148 
     149  typedef typename tPoint::tMetric tMetric; 
    151150 
    152151  /*! 
     
    285284   */ 
    286285  template <typename TIterator> 
    287   tKDTree(TIterator points_begin, TIterator points_end, tMetric metric = cDEFAULT_METRIC); 
    288 // 
    289 //  template <typename TIterator> 
    290 //  tKDTree(TIterator begin, TIterator end, tMetric metric); 
     286  tKDTree(TIterator points_begin, TIterator points_end, tMetric metric = tPoint::cEUCLIDEAN_DISTANCE); 
    291287 
    292288  /*! 
  • space_partitioning/tKDTree.hpp

    r21 r22  
    5858// Const values 
    5959//---------------------------------------------------------------------- 
    60  
    61 template <size_t Tdimension, typename TElement> 
    62 const typename tKDTree<Tdimension, TElement>::tMetric tKDTree<Tdimension, TElement>::cDEFAULT_METRIC = [](const tPoint &a, const tPoint &b) 
    63 { 
    64   return (a - b).Length(); 
    65 }; 
    6660 
    6761//---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.