0
4
0
... | ... |
@@ -215,12 +215,25 @@ |
215 | 215 |
typename enable_if<typename Graph::NodeNumTag, void>::type |
216 | 216 |
> { |
217 | 217 |
static const bool value = true; |
218 | 218 |
}; |
219 | 219 |
|
220 | 220 |
template <typename Graph, typename Enable = void> |
221 |
struct ArcNumTagIndicator { |
|
222 |
static const bool value = false; |
|
223 |
}; |
|
224 |
|
|
225 |
template <typename Graph> |
|
226 |
struct ArcNumTagIndicator< |
|
227 |
Graph, |
|
228 |
typename enable_if<typename Graph::ArcNumTag, void>::type |
|
229 |
> { |
|
230 |
static const bool value = true; |
|
231 |
}; |
|
232 |
|
|
233 |
template <typename Graph, typename Enable = void> |
|
221 | 234 |
struct EdgeNumTagIndicator { |
222 | 235 |
static const bool value = false; |
223 | 236 |
}; |
224 | 237 |
|
225 | 238 |
template <typename Graph> |
226 | 239 |
struct EdgeNumTagIndicator< |
... | ... |
@@ -228,12 +241,25 @@ |
228 | 241 |
typename enable_if<typename Graph::EdgeNumTag, void>::type |
229 | 242 |
> { |
230 | 243 |
static const bool value = true; |
231 | 244 |
}; |
232 | 245 |
|
233 | 246 |
template <typename Graph, typename Enable = void> |
247 |
struct FindArcTagIndicator { |
|
248 |
static const bool value = false; |
|
249 |
}; |
|
250 |
|
|
251 |
template <typename Graph> |
|
252 |
struct FindArcTagIndicator< |
|
253 |
Graph, |
|
254 |
typename enable_if<typename Graph::FindArcTag, void>::type |
|
255 |
> { |
|
256 |
static const bool value = true; |
|
257 |
}; |
|
258 |
|
|
259 |
template <typename Graph, typename Enable = void> |
|
234 | 260 |
struct FindEdgeTagIndicator { |
235 | 261 |
static const bool value = false; |
236 | 262 |
}; |
237 | 263 |
|
238 | 264 |
template <typename Graph> |
239 | 265 |
struct FindEdgeTagIndicator< |
... | ... |
@@ -303,12 +303,13 @@ |
303 | 303 |
} else { |
304 | 304 |
return INVALID; |
305 | 305 |
} |
306 | 306 |
} |
307 | 307 |
|
308 | 308 |
typedef True NodeNumTag; |
309 |
typedef True ArcNumTag; |
|
309 | 310 |
typedef True EdgeNumTag; |
310 | 311 |
|
311 | 312 |
int nodeNum() const { return _node_num; } |
312 | 313 |
int arcNum() const { return 2 * _edge_num; } |
313 | 314 |
int edgeNum() const { return _edge_num; } |
314 | 315 |
|
... | ... |
@@ -340,12 +341,13 @@ |
340 | 341 |
Node target(Arc arc) const { |
341 | 342 |
return Node((arc._id & 1) == 1 ? |
342 | 343 |
_vid(arc._id >> 1) : _uid(arc._id >> 1)); |
343 | 344 |
} |
344 | 345 |
|
345 | 346 |
typedef True FindEdgeTag; |
347 |
typedef True FindArcTag; |
|
346 | 348 |
|
347 | 349 |
Edge findEdge(Node u, Node v, Edge prev = INVALID) const { |
348 | 350 |
return prev != INVALID ? INVALID : edge(u, v); |
349 | 351 |
} |
350 | 352 |
|
351 | 353 |
Arc findArc(Node s, Node t, Arc prev = INVALID) const { |
... | ... |
@@ -79,12 +79,13 @@ |
79 | 79 |
|
80 | 80 |
int height() const { |
81 | 81 |
return _height; |
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
typedef True NodeNumTag; |
85 |
typedef True EdgeNumTag; |
|
85 | 86 |
typedef True ArcNumTag; |
86 | 87 |
|
87 | 88 |
int nodeNum() const { return _node_num; } |
88 | 89 |
int edgeNum() const { return _edge_num; } |
89 | 90 |
int arcNum() const { return 2 * _edge_num; } |
90 | 91 |
|
... | ... |
@@ -124,12 +125,13 @@ |
124 | 125 |
|
125 | 126 |
static Node nodeFromId(int id) { return Node(id);} |
126 | 127 |
static Edge edgeFromId(int id) { return Edge(id);} |
127 | 128 |
static Arc arcFromId(int id) { return Arc(id);} |
128 | 129 |
|
129 | 130 |
typedef True FindEdgeTag; |
131 |
typedef True FindArcTag; |
|
130 | 132 |
|
131 | 133 |
Edge findEdge(Node u, Node v, Edge prev = INVALID) const { |
132 | 134 |
if (prev != INVALID) return INVALID; |
133 | 135 |
if (v._id > u._id) { |
134 | 136 |
if (v._id - u._id == _width) |
135 | 137 |
return Edge(u._id); |
... | ... |
@@ -64,13 +64,13 @@ |
64 | 64 |
|
65 | 65 |
SmartDigraphBase() : nodes(), arcs() { } |
66 | 66 |
SmartDigraphBase(const SmartDigraphBase &_g) |
67 | 67 |
: nodes(_g.nodes), arcs(_g.arcs) { } |
68 | 68 |
|
69 | 69 |
typedef True NodeNumTag; |
70 |
typedef True |
|
70 |
typedef True ArcNumTag; |
|
71 | 71 |
|
72 | 72 |
int nodeNum() const { return nodes.size(); } |
73 | 73 |
int arcNum() const { return arcs.size(); } |
74 | 74 |
|
75 | 75 |
int maxNodeId() const { return nodes.size()-1; } |
76 | 76 |
int maxArcId() const { return arcs.size()-1; } |
0 comments (0 inline)