17 #ifndef SPATIAL_MANHATTAN_NEIGHBOR_HPP
18 #define SPATIAL_MANHATTAN_NEIGHBOR_HPP
20 #include "spatial_neighbor.hpp"
39 template <
typename Ct,
typename DistanceType,
typename Diff
41 =
typename details::with_builtin_difference<Ct>::type>
52 template <
typename AnyDistanceType>
57 (other.rank(), other.key_comp(), other.metric(),
58 other.target_key(), other.node_dim, other.node,
59 static_cast<AnyDistanceType
>(other.distance())) { }
62 template <
typename Ct,
typename DistanceType,
typename Diff>
73 template <
typename AnyDistanceType>
78 (other.rank(), other.key_comp(), other.metric(),
79 other.target_key(), other.node_dim, other.node,
80 static_cast<AnyDistanceType
>(other.distance())) { }
82 template <
typename AnyDistanceType>
87 (other.rank(), other.key_comp(), other.metric(),
88 other.target_key(), other.node_dim, other.node,
89 static_cast<AnyDistanceType
>(other.distance())) { }
108 template <
typename Ct,
typename DistanceType,
typename Diff
110 =
typename details::with_builtin_difference<Ct>::type>
127 template <
typename AnyDistanceType>
133 (other.first, other.second)) { }
136 template <
typename Ct,
typename DistanceType,
typename Diff>
139 <const Ct, manhattan<Ct, DistanceType, Diff> >
154 template <
typename AnyDistanceType>
160 (other.first, other.second)) { }
162 template <
typename AnyDistanceType>
168 (other.first, other.second)) { }
190 template <
typename Ct,
typename Diff>
192 inline manhattan_neighbor_iterator<Ct, double, Diff>
194 (Ct& container,
const Diff& diff,
201 template <
typename Ct,
typename Diff>
202 inline manhattan_neighbor_iterator<const Ct, double, Diff>
204 (
const Ct& container,
const Diff& diff,
211 template <
typename Ct,
typename Diff>
212 inline manhattan_neighbor_iterator<const Ct, double, Diff>
214 (
const Ct& container,
const Diff& diff,
239 template <
typename Ct>
242 enable_if<details::is_compare_builtin<Ct>,
243 manhattan_neighbor_iterator<Ct, double> >::type
256 template <
typename Ct>
258 enable_if<details::is_compare_builtin<Ct>,
259 manhattan_neighbor_iterator<const Ct, double> >::type
261 (
const Ct& container,
272 template <
typename Ct>
274 enable_if<details::is_compare_builtin<Ct>,
275 manhattan_neighbor_iterator<const Ct, double> >::type
277 (
const Ct& container,
307 template <
typename Ct,
typename Diff>
309 inline manhattan_neighbor_iterator<Ct, double, Diff>
311 (Ct& container,
const Diff& diff,
318 template <
typename Ct,
typename Diff>
319 inline manhattan_neighbor_iterator<const Ct, double, Diff>
321 (
const Ct& container,
const Diff& diff,
328 template <
typename Ct,
typename Diff>
329 inline manhattan_neighbor_iterator<const Ct, double, Diff>
331 (
const Ct& container,
const Diff& diff,
356 template <
typename Ct>
359 enable_if<details::is_compare_builtin<Ct>,
360 manhattan_neighbor_iterator<Ct, double> >::type
373 template <
typename Ct>
375 enable_if<details::is_compare_builtin<Ct>,
376 manhattan_neighbor_iterator<const Ct, double> >::type
378 (
const Ct& container,
389 template <
typename Ct>
391 enable_if<details::is_compare_builtin<Ct>,
392 manhattan_neighbor_iterator<const Ct, double> >::type
394 (
const Ct& container,
415 template <
typename Ct,
typename Diff,
typename DistanceType>
418 enable_if<import::is_arithmetic<DistanceType>,
419 manhattan_neighbor_iterator<Ct, DistanceType, Diff> >::type
421 (Ct& container,
const Diff& diff,
429 template <
typename Ct,
typename Diff,
typename DistanceType>
431 enable_if<import::is_arithmetic<DistanceType>,
432 manhattan_neighbor_iterator<const Ct, DistanceType, Diff> >::type
434 (
const Ct& container,
const Diff& diff,
442 template <
typename Ct,
typename Diff,
typename DistanceType>
444 enable_if<import::is_arithmetic<DistanceType>,
445 manhattan_neighbor_iterator<const Ct, DistanceType, Diff> >::type
447 (
const Ct& container,
const Diff& diff,
464 template <
typename Ct,
typename DistanceType>
467 enable_if_c<details::is_compare_builtin<Ct>::value
468 && import::is_arithmetic<DistanceType>::value,
469 manhattan_neighbor_iterator<Ct, DistanceType> >::type
483 template <
typename Ct,
typename DistanceType>
485 enable_if_c<details::is_compare_builtin<Ct>::value
486 && import::is_arithmetic<DistanceType>::value,
487 manhattan_neighbor_iterator<const Ct, DistanceType> >::type
489 (
const Ct& container,
501 template <
typename Ct,
typename DistanceType>
503 enable_if_c<details::is_compare_builtin<Ct>::value
504 && import::is_arithmetic<DistanceType>::value,
505 manhattan_neighbor_iterator<const Ct, DistanceType> >::type
507 (
const Ct& container,
529 template <
typename Ct,
typename Diff,
typename DistanceType>
532 enable_if<import::is_arithmetic<DistanceType>,
533 manhattan_neighbor_iterator<Ct, DistanceType, Diff> >::type
535 (Ct& container,
const Diff& diff,
543 template <
typename Ct,
typename Diff,
typename DistanceType>
545 enable_if<import::is_arithmetic<DistanceType>,
546 manhattan_neighbor_iterator<const Ct, DistanceType, Diff> >::type
548 (
const Ct& container,
const Diff& diff,
556 template <
typename Ct,
typename Diff,
typename DistanceType>
558 enable_if<import::is_arithmetic<DistanceType>,
559 manhattan_neighbor_iterator<const Ct, DistanceType, Diff> >::type
561 (
const Ct& container,
const Diff& diff,
578 template <
typename Ct,
typename DistanceType>
581 enable_if_c<details::is_compare_builtin<Ct>::value
582 && import::is_arithmetic<DistanceType>::value,
583 manhattan_neighbor_iterator<Ct, DistanceType> >::type
597 template <
typename Ct,
typename DistanceType>
599 enable_if_c<details::is_compare_builtin<Ct>::value
600 && import::is_arithmetic<DistanceType>::value,
601 manhattan_neighbor_iterator<const Ct, DistanceType> >::type
603 (
const Ct& container,
615 template <
typename Ct,
typename DistanceType>
617 enable_if_c<details::is_compare_builtin<Ct>::value
618 && import::is_arithmetic<DistanceType>::value,
619 manhattan_neighbor_iterator<const Ct, DistanceType> >::type
621 (
const Ct& container,
652 template <
typename Ct,
typename Diff>
654 inline manhattan_neighbor_iterator_pair<Ct, double, Diff>
656 (Ct& container,
const Diff& diff,
663 template <
typename Ct,
typename Diff>
664 inline manhattan_neighbor_iterator_pair<const Ct, double, Diff>
666 (
const Ct& container,
const Diff& diff,
673 template <
typename Ct,
typename Diff>
674 inline manhattan_neighbor_iterator_pair<const Ct, double, Diff>
676 (
const Ct& container,
const Diff& diff,
701 template <
typename Ct>
704 enable_if<details::is_compare_builtin<Ct>,
705 manhattan_neighbor_iterator_pair<Ct, double> >::type
718 template <
typename Ct>
720 enable_if<details::is_compare_builtin<Ct>,
721 manhattan_neighbor_iterator_pair<const Ct, double> >::type
723 (
const Ct& container,
734 template <
typename Ct>
736 enable_if<details::is_compare_builtin<Ct>,
737 manhattan_neighbor_iterator_pair<const Ct, double> >::type
739 (
const Ct& container,
753 #endif // SPATIAL_MANHATTAN_NEIGHBOR_HPP
manhattan_neighbor_iterator< const Ct, double, Diff > manhattan_neighbor_cend(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a manhattan_neighbor_iterator pointing past-the-end.
manhattan_neighbor_iterator_pair()
enable_if< import::is_arithmetic< DistanceType >, manhattan_neighbor_iterator< Ct, DistanceType, Diff > >::type manhattan_neighbor_lower_bound(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a manhattan_neighbor_iterator pointing to the closest element to target that is a least as fa...
manhattan_neighbor_iterator_pair< const Ct, double, Diff > manhattan_neighbor_crange(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Make a pair of iterators spanning the range of iterable element in container from the closest to the ...
manhattan_neighbor_iterator()
neighbor_iterator_pair< Ct, Metric > neighbor_range(Ct &container, const Metric &metric, const typename container_traits< Ct >::key_type &target)
Returns a neighbor_iterator_pair representing the range of values from the closest to the furthest in...
enable_if< import::is_arithmetic< DistanceType >, manhattan_neighbor_iterator< const Ct, DistanceType, Diff > >::type manhattan_neighbor_clower_bound(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a manhattan_neighbor_iterator pointing to the closest element to target that is a least as fa...
enable_if< import::is_arithmetic< DistanceType > > check_concept_distance_type_is_arithmetic
manhattan_neighbor_iterator< Ct, double, Diff > manhattan_neighbor_end(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a manhattan_neighbor_iterator pointing past-the-end.
enable_if< import::is_arithmetic< DistanceType >, manhattan_neighbor_iterator< const Ct, DistanceType, Diff > >::type manhattan_neighbor_cupper_bound(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a manhattan_neighbor_iterator pointing to the closest element to target that further than bou...
neighbor_iterator< Ct, Metric > neighbor_lower_bound(Ct &container, const Metric &metric, const typename container_traits< Ct >::key_type &target, typename Metric::distance_type bound)
Build a neighbor_iterator pointing to the neighbor closest to target but for which distance to target...
neighbor_iterator< Ct, Metric > neighbor_end(Ct &container, const Metric &metric, const typename container_traits< Ct >::key_type &target)
Build a past-the-end neighbor iterator with a user-defined Metric.
A spatial iterator for a container Ct that goes through the nearest to the furthest element from a ta...
manhattan_neighbor_iterator< Ct, double, Diff > manhattan_neighbor_begin(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a manhattan_neighbor_iterator pointing to the nearest neighbor of target. ...
manhattan_neighbor_iterator_pair< Ct, double, Diff > manhattan_neighbor_range(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Make a pair of iterators spanning the range of iterable element in container from the closest to the ...
The traits type for all containers in the spatial namespace.
manhattan_neighbor_iterator_pair()
This structure defines a pair of neighbor iterator.
enable_if< import::is_arithmetic< DistanceType > >::type check_concept_distance_type_is_arithmetic
neighbor_iterator< Ct, Metric > neighbor_upper_bound(Ct &container, const Metric &metric, const typename container_traits< Ct >::key_type &target, typename Metric::distance_type bound)
Build a neighbor_iterator pointing to the neighbor closest to target but for which distance to target...
manhattan_neighbor_iterator()
The main namespace used in the library.
enable_if< import::is_arithmetic< DistanceType > > check_concept_distance_type_is_arithmetic
Defines a metric for the a space where distances are the sum of all the elements of the vector...
neighbor_iterator< Ct, Metric > neighbor_begin(Ct &container, const Metric &metric, const typename container_traits< Ct >::key_type &target)
Build a neighbor_iterator pointing to the nearest neighbor of target using a user-defined Metric...
enable_if< import::is_arithmetic< DistanceType > > check_concept_distance_type_is_arithmetic
The generic helper class to determine if a container uses a built-in compare type.
enable_if< import::is_arithmetic< DistanceType >, manhattan_neighbor_iterator< Ct, DistanceType, Diff > >::type manhattan_neighbor_upper_bound(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a manhattan_neighbor_iterator pointing to the closest element to target that further than bou...
Facilitate the creation of an iterator range representing a sequence from closest to furthest from th...
manhattan_neighbor_iterator< const Ct, double, Diff > manhattan_neighbor_cbegin(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a manhattan_neighbor_iterator pointing to the nearest neighbor of target. ...
Facilitate the creation of neighbor iterator that works with a manhattan metric.