15 #ifndef PAAL_VERTEX_TO_EDGE_ITERATOR_HPP
16 #define PAAL_VERTEX_TO_EDGE_ITERATOR_HPP
21 namespace data_structures {
34 typedef typename std::iterator_traits<vertex_iterator>::value_type Vertex;
35 typedef std::pair<Vertex, Vertex> Edge;
37 typedef std::forward_iterator_tag iterator_category;
38 typedef Edge value_type;
39 typedef ptrdiff_t difference_type;
40 typedef Edge *pointer;
41 typedef const Edge &reference;
50 : m_idx(b), m_begin(b), m_end(e) {
98 return m_idx == ei.m_idx;
120 if (m_idx != m_end) {
121 m_curr.first = *m_idx;
122 vertex_iterator next = m_idx;
125 m_curr.second = *m_begin;
127 m_curr.second = *next;
132 vertex_iterator m_idx;
133 vertex_iterator m_begin;
134 vertex_iterator m_end;
147 template <
typename vertex_iterator>
148 vertex_to_edge_iterator<vertex_iterator>
161 template <
typename vertex_iterator>
162 vertex_to_edge_iterator<vertex_iterator>
170 #endif // PAAL_VERTEX_TO_EDGE_ITERATOR_HPP
bool operator!=(vertex_to_edge_iterator ei) const
operator !=
bool operator==(vertex_to_edge_iterator ei) const
operator==
const Edge & operator*() const
operator*
vertex_to_edge_iterator(vertex_iterator b, vertex_iterator e)
constructor
const Edge *const operator->() const
operator->
vertex_to_edge_iterator operator++(int)
operator++ pre increment
transforms collection to collection of pairs consecutive elements of the input collection. The last element and the first element are considered consecutive.
vertex_to_edge_iterator & operator++()
operator++ post increment
vertex_to_edge_iterator< vertex_iterator > make_vertex_to_edge_iterator(vertex_iterator b, vertex_iterator e)
make for vertex_to_edge_iterator