30 #ifndef __CLAW_GRAPH_HPP__ 31 #define __CLAW_GRAPH_HPP__ 65 template <
class S,
class A = meta::no_type,
class Comp = std::less<S> >
84 typedef std::map<vertex_type, neighbours_list, vertex_compare>
101 typedef ptrdiff_t difference_type;
103 typedef std::bidirectional_iterator_tag iterator_category;
112 reference operator*()
const;
113 pointer operator->()
const;
119 typename graph_content::const_iterator it);
123 typename graph_content::const_iterator m_iterator;
161 typedef const edge*
const pointer;
162 typedef ptrdiff_t difference_type;
164 typedef std::bidirectional_iterator_tag iterator_category;
174 pointer operator->()
const;
180 typename graph_content::const_iterator it_begin,
181 typename graph_content::const_iterator it_end,
182 typename graph_content::const_iterator it_s,
183 typename neighbours_list::const_iterator it_d);
187 typename graph_content::const_iterator m_vertex_begin;
190 typename graph_content::const_iterator m_vertex_end;
193 typename graph_content::const_iterator m_vertex_iterator;
196 typename neighbours_list::const_iterator m_neighbours_iterator;
205 typedef std::reverse_iterator<vertex_iterator> reverse_vertex_iterator;
206 typedef std::reverse_iterator<edge_iterator> reverse_edge_iterator;
216 void neighbours(
const vertex_type& s, std::vector<vertex_type>& v)
const;
217 void vertices(std::vector<vertex_type>& v)
const;
223 reverse_vertex_iterator vertex_rbegin()
const;
224 reverse_vertex_iterator vertex_rend()
const;
225 reverse_vertex_iterator vertex_rbegin(
const vertex_type& s)
const;
232 reverse_edge_iterator edge_rbegin()
const;
233 reverse_edge_iterator edge_rend()
const;
234 reverse_edge_iterator edge_rbegin(
const vertex_type& s1,
239 std::size_t outer_degree(
const vertex_type& s)
const;
240 std::size_t inner_degree(
const vertex_type& s)
const;
241 std::size_t vertices_count()
const;
242 std::size_t edges_count()
const;
249 std::map<vertex_type, std::size_t, vertex_compare> m_inner_degrees;
252 std::size_t m_edges_count;
258 #include <claw/graph.tpp> 260 #endif // __CLAW_GRAPH_HPP__ Iterator on the graph's edges.
S vertex_type
Type of the vertices.
A edge_type
Type of the edges.
Value pointed by the iterator.
A simple class to use as exception with string message.
claw::exception graph_exception
The exceptions thrown by the graphs.
Comp vertex_compare
Binary predicate to compare vertices.
Iterator on the graph's vertices.
std::map< vertex_type, neighbours_list, vertex_compare > graph_content
The whole graph: an adjacency list for each vertex.
An empty class not considered as a effective type.
A simple class to use as exception with string message.
claw::graph< vertex_type, edge_type, vertex_compare > self_type
Type of the current structure.
std::map< vertex_type, edge_type, vertex_compare > neighbours_list
The adjacency list of a vertex. vertex_type is the target vertex, edge_type is the label on the edge...
A class to represent a graph.
This is the main namespace.