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