Changeset 20:8f9a14fd63eb in rrlib_geometry for space_partitioning/tKDTree.h
 Timestamp:
 09.01.2012 02:03:03 (8 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

space_partitioning/tKDTree.h
r19 r20 147 147 typedef geometry::tPoint<Tdimension, TElement> tPoint; 148 148 typedef geometry::tBoundingBox<Tdimension, TElement> tBoundingBox; 149 150 // /*! 151 // * \brief An instantiation of std::binary_function for easier implementation of an own appropriate metric 152 // */ 153 // typedef std::binary_function<tCoordinates, tCoordinates, typename tCoordinates::tElement> tMetric; 149 typedef std::function < TElement(const tPoint &, const tPoint &) > tMetric; 154 150 155 151 /*! … … 185 181 */ 186 182 template <typename TIterator> 187 tNode(TIterator begin, TIterator end );183 tNode(TIterator begin, TIterator end, tMetric metric); 188 184 189 185 /*! … … 263 259 tPoint center_of_mass; 264 260 265 size_t SelectSplitAxis( ) const;261 size_t SelectSplitAxis(tMetric metric) const; 266 262 }; 267 263 … … 288 284 tKDTree(TIterator begin, TIterator end); 289 285 286 template <typename TIterator> 287 tKDTree(TIterator begin, TIterator end, tMetric metric); 288 290 289 /*! 291 290 * \brief The dtor of tKDTree … … 300 299 inline const tNode &Root() const; 301 300 302 // /*!303 // * \brief The default metric (Euklidian norm) used in this algorithm304 // */305 // struct tDefaultMetric : public tMetric306 // {307 // inline const typename tMetric::result_type operator()(const typename tMetric::first_argument_type &x, const typename tMetric::second_argument_type &y) const308 // {309 // return (x  y).Length();310 // }311 // };312 313 301 // 314 302 // Private fields and methods
Note: See TracChangeset
for help on using the changeset viewer.