Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74594 - in sandbox-branches/geometry/index/boost/geometry/extensions/index: filters rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2011-09-27 15:43:14


Author: awulkiew
Date: 2011-09-27 15:43:13 EDT (Tue, 27 Sep 2011)
New Revision: 74594
URL: http://svn.boost.org/trac/boost/changeset/74594

Log:
templates and functions parameters changed in filters and rtree's functions to suit new distances predicates.
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/filters/nearest_filter.hpp | 26 ++++++++++----------
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/filters.hpp | 6 ++--
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp | 48 ++++++++++++++++++++--------------------
   3 files changed, 40 insertions(+), 40 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/filters/nearest_filter.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/filters/nearest_filter.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/filters/nearest_filter.hpp 2011-09-27 15:43:13 EDT (Tue, 27 Sep 2011)
@@ -23,10 +23,10 @@
     typedef int* iterator;
     typedef const int* const_iterator;
 
- template <typename Point, typename Predicates>
+ template <typename DistancesPredicates, typename Predicates>
     inline nearest_filter(
         Index const&,
- Point const&,
+ DistancesPredicates const&,
         size_t,
         Predicates const&
     )
@@ -40,42 +40,42 @@
 
 namespace detail {
 
-template<typename Point, typename Predicates>
+template<typename DistancesPredicates, typename Predicates>
 struct nearest_filtered
 {
     inline nearest_filtered(
- Point const& pt,
+ DistancesPredicates const& dpred,
         size_t k,
         Predicates const& pred
     )
- : point(pt)
+ : distances_predicates(dpred)
         , count(k)
         , predicates(pred)
     {}
 
- Point const& point;
+ DistancesPredicates const& distances_predicates;
     size_t count;
     Predicates const& predicates;
 };
 
 } // namespace detail
 
-template <typename Point, typename Predicates>
-detail::nearest_filtered<Point, Predicates> nearest_filtered(
- Point const& pt,
+template <typename DistancesPredicates, typename Predicates>
+detail::nearest_filtered<DistancesPredicates, Predicates> nearest_filtered(
+ DistancesPredicates const& dpred,
     size_t k,
     Predicates const& pred = detail::empty())
 {
- return detail::nearest_filtered<Point, Predicates>(pt, k, pred);
+ return detail::nearest_filtered<DistancesPredicates, Predicates>(dpred, k, pred);
 }
 
-template<typename Index, typename Point, typename Predicates>
+template<typename Index, typename DistancesPredicates, typename Predicates>
 index::nearest_filter<Index>
 operator|(
     Index const& si,
- detail::nearest_filtered<Point, Predicates> const& f)
+ detail::nearest_filtered<DistancesPredicates, Predicates> const& f)
 {
- return index::nearest_filter<Index>(si, f.point, f.count, f.predicates);
+ return index::nearest_filter<Index>(si, f.distances_predicates, f.count, f.predicates);
 }
 
 }}} // namespace boost::geometry::index

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/filters.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/filters.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/filters.hpp 2011-09-27 15:43:13 EDT (Tue, 27 Sep 2011)
@@ -55,15 +55,15 @@
     typedef typename result_type::iterator iterator;
     typedef typename result_type::const_iterator const_iterator;
 
- template <typename Point, typename Predicates>
+ template <typename DistancesPredicates, typename Predicates>
     inline nearest_filter(
         index::rtree<Value, Options, Translator> const& rtree,
- Point const& pt,
+ DistancesPredicates const& dpred,
         size_t k,
         Predicates const& pred
     )
     {
- rtree.nearest(pt, k, pred, std::back_inserter(m_result));
+ rtree.nearest(dpred, k, pred, std::back_inserter(m_result));
     }
 
     inline iterator begin() { return m_result.begin(); }

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp 2011-09-27 15:43:13 EDT (Tue, 27 Sep 2011)
@@ -96,27 +96,27 @@
     // return number of elements instead of bool?
 
     template <typename DistancePredicate>
- inline size_t nearest(DistancePredicate const& p, value_type & v) const
+ inline size_t nearest(DistancePredicate const& dpred, value_type & v) const
     {
- return nearest_one(p, detail::empty(), v);
+ return nearest_one(dpred, detail::empty(), v);
     }
 
     template <typename DistancePredicate, typename Predicates>
- inline size_t nearest(DistancePredicate const& p, Predicates const& pred, value_type & v) const
+ inline size_t nearest(DistancePredicate const& dpred, Predicates const& pred, value_type & v) const
     {
- return nearest_one(p, pred, v);
+ return nearest_one(dpred, pred, v);
     }
 
     template <typename DistancePredicate, typename OutIter>
- inline size_t nearest(DistancePredicate const& p, size_t k, OutIter out_it) const
+ inline size_t nearest(DistancePredicate const& dpred, size_t k, OutIter out_it) const
     {
- return nearest_k(p, k, detail::empty(), out_it);
+ return nearest_k(dpred, k, detail::empty(), out_it);
     }
 
     template <typename DistancePredicate, typename Predicates, typename OutIter>
- inline size_t nearest(DistancePredicate const& p, size_t k, Predicates const& pred, OutIter out_it) const
+ inline size_t nearest(DistancePredicate const& dpred, size_t k, Predicates const& pred, OutIter out_it) const
     {
- return nearest_k(p, k, pred, out_it);
+ return nearest_k(dpred, k, pred, out_it);
     }
 
     inline void insert(value_type const& value)
@@ -189,7 +189,7 @@
 
 private:
     template <typename DistancesPredicates, typename Predicates>
- inline size_t nearest_one(DistancesPredicates const& p, Predicates const& pred, value_type & v) const
+ inline size_t nearest_one(DistancesPredicates const& dpred, Predicates const& pred, value_type & v) const
     {
         typedef typename detail::point_relation<DistancesPredicates>::type point_relation;
         typedef typename detail::relation<point_relation>::value_type point_type;
@@ -210,7 +210,7 @@
             DistancesPredicates,
             Predicates,
             result_type
- > nearest_v(m_translator, p, pred, result);
+ > nearest_v(m_translator, dpred, pred, result);
 
         detail::rtree::apply_visitor(nearest_v, *m_root);
 
@@ -218,7 +218,7 @@
     }
 
     template <typename DistancesPredicates, typename Predicates, typename OutIter>
- inline size_t nearest_k(DistancesPredicates const& p, size_t k, Predicates const& pred, OutIter out_it) const
+ inline size_t nearest_k(DistancesPredicates const& dpred, size_t k, Predicates const& pred, OutIter out_it) const
     {
         typedef typename detail::point_relation<DistancesPredicates>::type point_relation;
         typedef typename detail::relation<point_relation>::value_type point_type;
@@ -239,7 +239,7 @@
             DistancesPredicates,
             Predicates,
             result_type
- > nearest_v(m_translator, p, pred, result);
+ > nearest_v(m_translator, dpred, pred, result);
 
         detail::rtree::apply_visitor(nearest_v, *m_root);
 
@@ -270,28 +270,28 @@
     return tree.query(pred, out_it);
 }
 
-template <typename Value, typename Options, typename Translator, typename Point>
-inline size_t nearest(rtree<Value, Options, Translator> const& tree, Point const& pt, Value & v)
+template <typename Value, typename Options, typename Translator, typename DistancesPredicates>
+inline size_t nearest(rtree<Value, Options, Translator> const& tree, DistancesPredicates const& dpred, Value & v)
 {
- return tree.nearest(pt, v);
+ return tree.nearest(dpred, v);
 }
 
-template <typename Value, typename Options, typename Translator, typename Point, typename Predicates>
-inline size_t nearest(rtree<Value, Options, Translator> const& tree, Point const& pt, Predicates const& pred, Value & v)
+template <typename Value, typename Options, typename Translator, typename DistancesPredicates, typename Predicates>
+inline size_t nearest(rtree<Value, Options, Translator> const& tree, DistancesPredicates const& dpred, Predicates const& pred, Value & v)
 {
- return tree.nearest(pt, pred, v);
+ return tree.nearest(dpred, pred, v);
 }
 
-template <typename Value, typename Options, typename Translator, typename Point, typename OutIter>
-inline size_t nearest(rtree<Value, Options, Translator> const& tree, Point const& pt, size_t k, OutIter out_it)
+template <typename Value, typename Options, typename Translator, typename DistancesPredicates, typename OutIter>
+inline size_t nearest(rtree<Value, Options, Translator> const& tree, DistancesPredicates const& dpred, size_t k, OutIter out_it)
 {
- return tree.nearest(pt, k, out_it);
+ return tree.nearest(dpred, k, out_it);
 }
 
-template <typename Value, typename Options, typename Translator, typename Point, typename Predicates, typename OutIter>
-inline size_t nearest(rtree<Value, Options, Translator> const& tree, Point const& pt, size_t k, Predicates const& pred, OutIter out_it)
+template <typename Value, typename Options, typename Translator, typename DistancesPredicates, typename Predicates, typename OutIter>
+inline size_t nearest(rtree<Value, Options, Translator> const& tree, DistancesPredicates const& dpred, size_t k, Predicates const& pred, OutIter out_it)
 {
- return tree.nearest(pt, k, pred, out_it);
+ return tree.nearest(dpred, k, pred, out_it);
 }
 
 template <typename Value, typename Options, typename Translator>


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