Changeset 1060:7a24bb2e7480 in lemon-0.x for src/lemon/undir_graph_extender.h
- Timestamp:
- 01/07/05 19:53:02 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1456
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/undir_graph_extender.h
r1054 r1060 141 141 template <typename E> 142 142 void _dirFirstOut(E &e, const Node &n) const { 143 Parent::firstIn(e,n); 144 if( UndirEdge(e) != INVALID ) { 145 e.forward = false; 146 } 147 else { 148 Parent::firstOut(e,n); 149 e.forward = true; 150 } 151 } 152 template <typename E> 153 void _dirFirstIn(E &e, const Node &n) const { 143 154 Parent::firstOut(e,n); 144 155 if( UndirEdge(e) != INVALID ) { 156 e.forward = false; 157 } 158 else { 159 Parent::firstIn(e,n); 145 160 e.forward = true; 146 161 } 147 else {148 Parent::firstIn(e,n);149 e.forward = false;150 }151 }152 template <typename E>153 void _dirFirstIn(E &e, const Node &n) const {154 Parent::firstIn(e,n);155 if( UndirEdge(e) != INVALID ) {156 e.forward = true;157 }158 else {159 Parent::firstOut(e,n);160 e.forward = false;161 }162 162 } 163 163 164 164 template <typename E> 165 165 void _dirNextOut(E &e) const { 166 if( e.forward ) { 166 if( ! e.forward ) { 167 Node n = Parent::target(e); 168 Parent::nextIn(e); 169 if( UndirEdge(e) == INVALID ) { 170 Parent::firstOut(e, n); 171 e.forward = true; 172 } 173 } 174 else { 175 Parent::nextOut(e); 176 } 177 } 178 template <typename E> 179 void _dirNextIn(E &e) const { 180 if( ! e.forward ) { 181 Node n = Parent::source(e); 167 182 Parent::nextOut(e); 168 183 if( UndirEdge(e) == INVALID ) { 169 Parent::firstIn(e, Parent::source(e));170 e.forward = false;184 Parent::firstIn(e, n); 185 e.forward = true; 171 186 } 172 187 } 173 188 else { 174 189 Parent::nextIn(e); 175 }176 }177 template <typename E>178 void _dirNextIn(E &e) const {179 if( e.forward ) {180 Parent::nextIn(e);181 if( UndirEdge(e) == INVALID ) {182 Parent::firstOut(e, Parent::target(e));183 e.forward = false;184 }185 }186 else {187 Parent::nextOut(e);188 190 } 189 191 } … … 227 229 228 230 229 int maxId(Node n) const {231 int maxId(Node) const { 230 232 return Parent::maxId(Node()); 231 233 }
Note: See TracChangeset
for help on using the changeset viewer.