Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74510 - in sandbox-branches/geometry/index/boost/geometry/extensions/index: . rtree/visitors
From: adam.wulkiewicz_at_[hidden]
Date: 2011-09-22 07:34:03


Author: awulkiew
Date: 2011-09-22 07:34:02 EDT (Thu, 22 Sep 2011)
New Revision: 74510
URL: http://svn.boost.org/trac/boost/changeset/74510

Log:
some todo comments added, names changed
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/distance_calc.hpp | 43 ++++++++++++++++++++++++++++++++-------
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/nearest.hpp | 8 +++---
   2 files changed, 39 insertions(+), 12 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/distance_calc.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/distance_calc.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/distance_calc.hpp 2011-09-22 07:34:02 EDT (Thu, 22 Sep 2011)
@@ -119,10 +119,10 @@
     typedef typename geometry::default_distance_result<Point, Indexable>::type distance_type;
 
     static inline distance_type apply(
- detail::distance_xxx<Point, detail::distance_near_tag> const& d,
+ detail::distance_xxx<Point, detail::distance_near_tag> const& dx,
         Indexable const& i)
     {
- return index::mindist(d.point, i);
+ return index::mindist(dx.point, i);
     }
 };
 
@@ -136,15 +136,15 @@
     typedef typename geometry::default_distance_result<Point, Indexable>::type distance_type;
 
     static inline distance_type apply(
- detail::distance_xxx<Point, detail::distance_far_tag> const& d,
+ detail::distance_xxx<Point, detail::distance_far_tag> const& dx,
         Indexable const& i)
     {
- return index::maxdist(d.point, i);
+ return index::maxdist(dx.point, i);
     }
 };
 
 template <typename Point>
-struct is_distance_ok
+struct distance_comp
 {
     template <typename DistanceType>
     static inline bool apply(Point const&, DistanceType const&)
@@ -154,7 +154,7 @@
 };
 
 template <typename Point, typename Tag>
-struct is_distance_ok< detail::distance_xxx<Point, Tag> >
+struct distance_comp< detail::distance_xxx<Point, Tag> >
 {
     template <typename DistanceType>
     static inline bool apply(
@@ -165,6 +165,33 @@
     }
 };
 
+// TODO: awulkiew - pruning for nodes!
+// if 0 < comp_near node is pruned if maxdist(point, node_box) < comp_near
+// if comp_far < INF node is pruned if comp_far < min_dist(point, node_box)
+// still nodes must be sorted by min_dist(point, node_box)
+
+// for values, proper distance values are calculated min, max or centroid
+// and tested with comp_near and/or comp_far
+
+// implement versions with only one comp or without comp distances?
+// less tests == speed increase
+// near_between, near_lesser, near_greater
+// far_xxx
+// centroid_xxx, center_xxx
+
+// distance_range, distance_bound, distance_upper_bound
+
+// distance_between<near | far| centroid tag> - now distance_xxx
+// distance_xxxxxx<near|far|centroid, less|more>
+// distance_point_only
+
+// distance_calc for each <near|far|centroid>
+// distance_comp for each class and xxxxxx<less|more>
+
+// + something in case of nodes
+// additional calculation of maxdist in case of distance_between and
+// distance_xxxxx<more>
+
 } // namespace detail
 
 template <typename PointData, typename Indexable>
@@ -177,9 +204,9 @@
 
 template <typename PointData, typename DistanceType>
 inline bool
-is_distance_ok(PointData const& p, DistanceType const& d)
+distance_comp(PointData const& p, DistanceType const& d)
 {
- return detail::is_distance_ok<PointData>
+ return detail::distance_comp<PointData>
         ::apply(p, d);
 }
 

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/nearest.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/nearest.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/nearest.hpp 2011-09-22 07:34:02 EDT (Thu, 22 Sep 2011)
@@ -134,7 +134,7 @@
     typename Options,
     typename Translator,
     typename Box,
- typename Point,
+ typename PointData,
     typename Predicates,
     typename Result
>
@@ -149,8 +149,8 @@
 
     typedef typename geometry::default_distance_result<Point, Box>::type node_distance_type;
 
- inline nearest(Translator const& t, Point const& pt, Predicates const& pr, Result & r)
- : m_tr(t), m_point(pt), m_pred(pr)
+ inline nearest(Translator const& t, PointData const& point_data, Predicates const& pr, Result & r)
+ : m_tr(t), m_point_data(point_data), m_pred(pr)
         , m_result(r)
     {}
 
@@ -241,7 +241,7 @@
     }
 
     Translator const& m_tr;
- Point const& m_point;
+ Point const& m_point_data;
     Predicates const& m_pred;
 
     Result & m_result;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk