Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::euclidian_neighbor_iterator< Ct, DistanceType, Diff > Class Template Reference

Facilitate the creation of neighbor iterator that works with an euclidian metric. More...

#include <spatial_euclidian_neighbor.hpp>

Inherits spatial::neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > >.

Public Member Functions

 euclidian_neighbor_iterator ()
 
template<typename AnyDistanceType >
 euclidian_neighbor_iterator (const neighbor_iterator< Ct, euclidian< Ct, AnyDistanceType, Diff > > &other)
 
- Public Member Functions inherited from spatial::neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > >
 neighbor_iterator ()
 Uninitialized iterator. More...
 
 neighbor_iterator (Ct &container_, const euclidian< Ct, DistanceType, Diff > &metric_, const typename container_traits< Ct >::key_type &target_, const typename container_traits< Ct >::iterator &iter_, typename euclidian< Ct, DistanceType, Diff >::distance_type distance_)
 The standard way to build this iterator: specify a metric to apply, an iterator on a container, and that container. More...
 
 neighbor_iterator (Ct &container_, const euclidian< Ct, DistanceType, Diff > &metric_, const typename container_traits< Ct >::key_type &target_, dimension_type node_dim_, typename container_traits< Ct >::mode_type::node_ptr node_, typename euclidian< Ct, DistanceType, Diff >::distance_type distance_)
 When the information of the dimension for the current node being pointed to by the iterator is known, this constructor saves some CPU cycle, by comparison to the other constructor. More...
 
 neighbor_iterator (const typename container_traits< Ct >::rank_type &rank_, const typename container_traits< Ct >::key_compare &key_comp_, const euclidian< Ct, DistanceType, Diff > &metric_, const typename container_traits< Ct >::key_type &target_, dimension_type node_dim_, typename container_traits< Ct >::mode_type::node_ptr node_, typename euclidian< Ct, DistanceType, Diff >::distance_type distance_)
 Build the iterator with a given rank and key compare functor, if the container is not available. More...
 
neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > > & operator++ ()
 Increments the iterator and returns the incremented value. More...
 
neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > > operator++ (int)
 Increments the iterator but returns the value of the iterator before the increment. More...
 
neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > > & operator-- ()
 Decrements the iterator and returns the decremented value. More...
 
neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > > operator-- (int)
 Decrements the iterator but returns the value of the iterator before the decrement. More...
 
key_compare key_comp () const
 Return the key_comparator used by the iterator. More...
 
metric_type metric () const
 Return the metric used by the iterator. More...
 
const distance_typedistance () const
 Read-only accessor to the last valid distance of the iterator. More...
 
distance_typedistance ()
 Read/write accessor to the last valid distance of the iterator. More...
 
const key_typetarget_key () const
 Read-only accessor to the target of the iterator. More...
 
key_typetarget_key ()
 Read/write accessor to the target of the iterator. More...
 
- Public Member Functions inherited from spatial::details::Bidirectional_iterator< container_traits< Ct >::mode_type, container_traits< Ct >::rank_type >
 Bidirectional_iterator ()
 Build an uninitialized iterator. More...
 
 Bidirectional_iterator (const container_traits< Ct >::rank_type &rank_, node_ptr node_, dimension_type node_dim_)
 Initialize the node at construction time. More...
 
reference operator* ()
 Returns the reference to the value pointed to by the iterator. More...
 
pointer operator-> ()
 Returns a pointer to the value pointed to by the iterator. More...
 
bool operator== (const Const_node_iterator< container_traits< Ct >::mode_type > &x) const
 A bidirectional iterator can be compared with a node iterator if they work on identical linking modes. More...
 
bool operator!= (const Const_node_iterator< container_traits< Ct >::mode_type > &x) const
 A bidirectional iterator can be compared for inequality with a node iterator if they work on identical linking modes. More...
 
const rank_typerank () const
 Return the current Rank type used by the iterator. More...
 
dimension_type dimension () const
 Return the number of dimensions stored by the Rank of the iterator. More...
 
 operator Node_iterator< container_traits< Ct >::mode_type > () const
 This iterator can be casted silently into a container iterator. More...
 
 operator Const_node_iterator< container_traits< Ct >::mode_type > () const
 This iterator can be casted silently into a container iterator. More...
 

Private Types

typedef enable_if< import::is_floating_point< DistanceType > >::type check_concept_distance_type_is_floating_point
 

Additional Inherited Members

- Public Types inherited from spatial::neighbor_iterator< Ct, euclidian< Ct, DistanceType, Diff > >
typedef container_traits< Ct >::key_compare key_compare
 Key comparator type transferred from the container. More...
 
typedef euclidian< Ct, DistanceType, Diff > metric_type
 The metric type used by the iterator. More...
 
typedef euclidian< Ct, DistanceType, Diff >::distance_type distance_type
 The distance type that is read from metric_type. More...
 
typedef container_traits< Ct >::key_type key_type
 The key type that is used as a target for the nearest neighbor search. More...
 
- Public Types inherited from spatial::details::Bidirectional_iterator< container_traits< Ct >::mode_type, container_traits< Ct >::rank_type >
typedef mutate< typename container_traits< Ct >::mode_type::value_type >::type value_type
 The value_type can receive a copy of the reference pointed to be the iterator. More...
 
typedef container_traits< Ct >::mode_type::value_type & reference
 The reference type of the object pointed to by the iterator. More...
 
typedef container_traits< Ct >::mode_type::value_type * pointer
 The pointer type of the object pointed to by the iterator. More...
 
typedef std::ptrdiff_t difference_type
 The difference_type returned by the distance between 2 iterators. More...
 
typedef std::bidirectional_iterator_tag iterator_category
 The iterator category that is always Bidirectional_iterator_tag. More...
 
typedef container_traits< Ct >::mode_type::node_ptr node_ptr
 The type for the node pointed to by the iterator. More...
 
typedef container_traits< Ct >::rank_type rank_type
 The type of rank used by the iterator. More...
 
typedef container_traits< Ct >::mode_type::invariant_category invariant_category
 The invariant category of the the iterator. More...
 
- Public Attributes inherited from spatial::details::Bidirectional_iterator< container_traits< Ct >::mode_type, container_traits< Ct >::rank_type >
node_ptr node
 The pointer to the current node. More...
 
dimension_type node_dim
 The dimension of the current node. More...
 

Detailed Description

template<typename Ct, typename DistanceType, typename Diff = typename details::with_builtin_difference<Ct>::type>
class spatial::euclidian_neighbor_iterator< Ct, DistanceType, Diff >

Facilitate the creation of neighbor iterator that works with an euclidian metric.

This class has an associated group of functions designed to initialize the iterator position at the beginning, end, lower bound or upper bound of the container to iterate.

Template Parameters
CtThe container to iterate.
DistanceTypeThe type used to represent the distance, it must be a primitive floating point type.
DiffThe difference functor that will compute the difference between 2 key element in the container, along a specific dimension. See Difference for further explanation.

Definition at line 42 of file spatial_euclidian_neighbor.hpp.

Member Typedef Documentation

template<typename Ct, typename DistanceType, typename Diff = typename details::with_builtin_difference<Ct>::type>
typedef enable_if<import::is_floating_point<DistanceType> >::type spatial::euclidian_neighbor_iterator< Ct, DistanceType, Diff >::check_concept_distance_type_is_floating_point
private

Definition at line 47 of file spatial_euclidian_neighbor.hpp.

Constructor & Destructor Documentation

template<typename Ct, typename DistanceType, typename Diff = typename details::with_builtin_difference<Ct>::type>
spatial::euclidian_neighbor_iterator< Ct, DistanceType, Diff >::euclidian_neighbor_iterator ( )

Definition at line 50 of file spatial_euclidian_neighbor.hpp.

template<typename Ct, typename DistanceType, typename Diff = typename details::with_builtin_difference<Ct>::type>
template<typename AnyDistanceType >
spatial::euclidian_neighbor_iterator< Ct, DistanceType, Diff >::euclidian_neighbor_iterator ( const neighbor_iterator< Ct, euclidian< Ct, AnyDistanceType, Diff > > &  other)

Definition at line 54 of file spatial_euclidian_neighbor.hpp.


The documentation for this class was generated from the following file: