| ... | ... |
@@ -2184,54 +2184,54 @@ |
| 2184 | 2184 |
/// Just gives back an undirected view of the given digraph |
| 2185 | 2185 |
template<typename Digraph> |
| 2186 | 2186 |
Undirector<const Digraph> |
| 2187 | 2187 |
undirector(const Digraph& digraph) {
|
| 2188 | 2188 |
return Undirector<const Digraph>(digraph); |
| 2189 | 2189 |
} |
| 2190 | 2190 |
|
| 2191 | 2191 |
template <typename _Graph, typename _DirectionMap> |
| 2192 | 2192 |
class OrienterBase {
|
| 2193 | 2193 |
public: |
| 2194 | 2194 |
|
| 2195 | 2195 |
typedef _Graph Graph; |
| 2196 | 2196 |
typedef _DirectionMap DirectionMap; |
| 2197 | 2197 |
|
| 2198 | 2198 |
typedef typename Graph::Node Node; |
| 2199 | 2199 |
typedef typename Graph::Edge Arc; |
| 2200 | 2200 |
|
| 2201 | 2201 |
void reverseArc(const Arc& arc) {
|
| 2202 | 2202 |
_direction->set(arc, !(*_direction)[arc]); |
| 2203 | 2203 |
} |
| 2204 | 2204 |
|
| 2205 | 2205 |
void first(Node& i) const { _graph->first(i); }
|
| 2206 | 2206 |
void first(Arc& i) const { _graph->first(i); }
|
| 2207 | 2207 |
void firstIn(Arc& i, const Node& n) const {
|
| 2208 |
bool d; |
|
| 2208 |
bool d = true; |
|
| 2209 | 2209 |
_graph->firstInc(i, d, n); |
| 2210 | 2210 |
while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d); |
| 2211 | 2211 |
} |
| 2212 | 2212 |
void firstOut(Arc& i, const Node& n ) const {
|
| 2213 |
bool d; |
|
| 2213 |
bool d = true; |
|
| 2214 | 2214 |
_graph->firstInc(i, d, n); |
| 2215 | 2215 |
while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d); |
| 2216 | 2216 |
} |
| 2217 | 2217 |
|
| 2218 | 2218 |
void next(Node& i) const { _graph->next(i); }
|
| 2219 | 2219 |
void next(Arc& i) const { _graph->next(i); }
|
| 2220 | 2220 |
void nextIn(Arc& i) const {
|
| 2221 | 2221 |
bool d = !(*_direction)[i]; |
| 2222 | 2222 |
_graph->nextInc(i, d); |
| 2223 | 2223 |
while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d); |
| 2224 | 2224 |
} |
| 2225 | 2225 |
void nextOut(Arc& i) const {
|
| 2226 | 2226 |
bool d = (*_direction)[i]; |
| 2227 | 2227 |
_graph->nextInc(i, d); |
| 2228 | 2228 |
while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d); |
| 2229 | 2229 |
} |
| 2230 | 2230 |
|
| 2231 | 2231 |
Node source(const Arc& e) const {
|
| 2232 | 2232 |
return (*_direction)[e] ? _graph->u(e) : _graph->v(e); |
| 2233 | 2233 |
} |
| 2234 | 2234 |
Node target(const Arc& e) const {
|
| 2235 | 2235 |
return (*_direction)[e] ? _graph->v(e) : _graph->u(e); |
| 2236 | 2236 |
} |
| 2237 | 2237 |
|
0 comments (0 inline)