17 #ifndef SPATIAL_QUADRANCE_NEIGHBOR_HPP
18 #define SPATIAL_QUADRANCE_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, quadrance<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 quadrance_neighbor_iterator<Ct, double, Diff>
194 (Ct& container,
const Diff& diff,
201 template <
typename Ct,
typename Diff>
202 inline quadrance_neighbor_iterator<const Ct, double, Diff>
204 (
const Ct& container,
const Diff& diff,
211 template <
typename Ct,
typename Diff>
212 inline quadrance_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 quadrance_neighbor_iterator<Ct, double> >::type
256 template <
typename Ct>
258 enable_if<details::is_compare_builtin<Ct>,
259 quadrance_neighbor_iterator<const Ct, double> >::type
261 (
const Ct& container,
272 template <
typename Ct>
274 enable_if<details::is_compare_builtin<Ct>,
275 quadrance_neighbor_iterator<const Ct, double> >::type
277 (
const Ct& container,
307 template <
typename Ct,
typename Diff>
309 inline quadrance_neighbor_iterator<Ct, double, Diff>
311 (Ct& container,
const Diff& diff,
318 template <
typename Ct,
typename Diff>
319 inline quadrance_neighbor_iterator<const Ct, double, Diff>
321 (
const Ct& container,
const Diff& diff,
328 template <
typename Ct,
typename Diff>
329 inline quadrance_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 quadrance_neighbor_iterator<Ct, double> >::type
373 template <
typename Ct>
375 enable_if<details::is_compare_builtin<Ct>,
376 quadrance_neighbor_iterator<const Ct, double> >::type
378 (
const Ct& container,
389 template <
typename Ct>
391 enable_if<details::is_compare_builtin<Ct>,
392 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_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 quadrance_neighbor_iterator<const Ct, DistanceType> >::type
621 (
const Ct& container,
652 template <
typename Ct,
typename Diff>
654 inline quadrance_neighbor_iterator_pair<Ct, double, Diff>
656 (Ct& container,
const Diff& diff,
663 template <
typename Ct,
typename Diff>
664 inline quadrance_neighbor_iterator_pair<const Ct, double, Diff>
666 (
const Ct& container,
const Diff& diff,
673 template <
typename Ct,
typename Diff>
674 inline quadrance_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 quadrance_neighbor_iterator_pair<Ct, double> >::type
718 template <
typename Ct>
720 enable_if<details::is_compare_builtin<Ct>,
721 quadrance_neighbor_iterator_pair<const Ct, double> >::type
723 (
const Ct& container,
734 template <
typename Ct>
736 enable_if<details::is_compare_builtin<Ct>,
737 quadrance_neighbor_iterator_pair<const Ct, double> >::type
739 (
const Ct& container,
753 #endif // SPATIAL_QUADRANCE_NEIGHBOR_HPP
quadrance_neighbor_iterator_pair< const Ct, double, Diff > quadrance_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 ...
enable_if< import::is_arithmetic< DistanceType >, quadrance_neighbor_iterator< const Ct, DistanceType, Diff > >::type quadrance_neighbor_cupper_bound(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a quadrance_neighbor_iterator pointing to the closest element to target that further than bou...
quadrance_neighbor_iterator< Ct, double, Diff > quadrance_neighbor_end(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a quadrance_neighbor_iterator pointing past-the-end.
enable_if< import::is_arithmetic< DistanceType >, quadrance_neighbor_iterator< Ct, DistanceType, Diff > >::type quadrance_neighbor_lower_bound(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a quadrance_neighbor_iterator pointing to the closest element to target that is a least as fa...
quadrance_neighbor_iterator< Ct, double, Diff > quadrance_neighbor_begin(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a quadrance_neighbor_iterator pointing to the nearest neighbor of target. ...
quadrance_neighbor_iterator_pair< Ct, double, Diff > quadrance_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 ...
Facilitate the creation of an iterator range representing a sequence from closest to furthest from th...
enable_if< import::is_arithmetic< DistanceType >, quadrance_neighbor_iterator< Ct, DistanceType, Diff > >::type quadrance_neighbor_upper_bound(Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a quadrance_neighbor_iterator pointing to the closest element to target that further than bou...
Facilitate the creation of neighbor iterator that works with a quadrance metric.
Defines a metric in the Euclidian space where only the square of the distances are being computed int...
enable_if< import::is_arithmetic< DistanceType > > check_concept_distance_type_is_arithmetic
quadrance_neighbor_iterator_pair()
quadrance_neighbor_iterator< const Ct, double, Diff > quadrance_neighbor_cbegin(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a quadrance_neighbor_iterator pointing to the nearest neighbor of target. ...
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...
quadrance_neighbor_iterator()
enable_if< import::is_arithmetic< DistanceType > > check_concept_distance_type_is_arithmetic
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...
The traits type for all containers in the spatial namespace.
This structure defines a pair of neighbor iterator.
quadrance_neighbor_iterator_pair()
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...
quadrance_neighbor_iterator()
The main namespace used in the library.
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 >, quadrance_neighbor_iterator< const Ct, DistanceType, Diff > >::type quadrance_neighbor_clower_bound(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target, DistanceType bound)
Returns a quadrance_neighbor_iterator pointing to the closest element to target that is a least as fa...
The generic helper class to determine if a container uses a built-in compare type.
enable_if< import::is_arithmetic< DistanceType > >::type check_concept_distance_type_is_arithmetic
quadrance_neighbor_iterator< const Ct, double, Diff > quadrance_neighbor_cend(const Ct &container, const Diff &diff, const typename container_traits< Ct >::key_type &target)
Returns a quadrance_neighbor_iterator pointing past-the-end.
enable_if< import::is_arithmetic< DistanceType > > check_concept_distance_type_is_arithmetic