1 | /* -*- C++ -*- |
---|
2 | * |
---|
3 | * src/lemon/concept/undir_graph_component.h - Part of LEMON, a generic |
---|
4 | * C++ optimization library |
---|
5 | * |
---|
6 | * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi |
---|
7 | * Kutatocsoport (Egervary Combinatorial Optimization Research Group, |
---|
8 | * EGRES). |
---|
9 | * |
---|
10 | * Permission to use, modify and distribute this software is granted |
---|
11 | * provided that this copyright notice appears in all copies. For |
---|
12 | * precise terms see the accompanying LICENSE file. |
---|
13 | * |
---|
14 | * This software is provided "AS IS" with no warranty of any kind, |
---|
15 | * express or implied, and with no claim as to its suitability for any |
---|
16 | * purpose. |
---|
17 | * |
---|
18 | */ |
---|
19 | |
---|
20 | ///\ingroup concept |
---|
21 | ///\file |
---|
22 | ///\brief Undirected graphs and components of. |
---|
23 | |
---|
24 | |
---|
25 | #ifndef LEMON_CONCEPT_UNDIR_GRAPH_H |
---|
26 | #define LEMON_CONCEPT_UNDIR_GRAPH_H |
---|
27 | |
---|
28 | #include <lemon/concept/graph_component.h> |
---|
29 | |
---|
30 | namespace lemon { |
---|
31 | namespace concept { |
---|
32 | |
---|
33 | /// \todo to be done |
---|
34 | class BaseIterableUndirGraph; |
---|
35 | |
---|
36 | template <typename Graph> |
---|
37 | struct BaseIterableUndirGraphConcept { |
---|
38 | typedef typename Graph::UndirEdge UndirEdge; |
---|
39 | typedef typename Graph::Edge Edge; |
---|
40 | typedef typename Graph::Node Node; |
---|
41 | void constraints() { |
---|
42 | function_requires< BaseIterableGraphComponentConcept<Graph> >(); |
---|
43 | function_requires< GraphItemConcept<UndirEdge> >(); |
---|
44 | |
---|
45 | /// \bug this should be base_and_derived: |
---|
46 | UndirEdge ue = e; |
---|
47 | ue = e; |
---|
48 | |
---|
49 | Node n; |
---|
50 | n = graph.head(ue); |
---|
51 | n = graph.tail(ue); |
---|
52 | |
---|
53 | graph.first(ue); |
---|
54 | graph.next(ue); |
---|
55 | } |
---|
56 | const Graph &graph; |
---|
57 | Edge e; |
---|
58 | }; |
---|
59 | |
---|
60 | template <typename Graph> |
---|
61 | struct IterableUndirGraphConcept { |
---|
62 | void constraints() { |
---|
63 | function_requires< BaseIterableUndirGraphConcept<Graph> > (); |
---|
64 | function_requires< IterableGraphComponentConcept<Graph> > (); |
---|
65 | |
---|
66 | typedef typename Graph::UndirEdge UndirEdge; |
---|
67 | typedef typename Graph::UndirEdgeIt UndirEdgeIt; |
---|
68 | |
---|
69 | function_requires< |
---|
70 | GraphIteratorConcept<UndirEdgeIt, Graph, UndirEdge> >(); |
---|
71 | } |
---|
72 | }; |
---|
73 | |
---|
74 | } |
---|
75 | |
---|
76 | } |
---|
77 | |
---|
78 | #endif |
---|