1024 /// Such one can be made e.g. by the above wrapper. |
1026 /// Such one can be made e.g. by the above wrapper. |
1025 template<typename Graph> |
1027 template<typename Graph> |
1026 class stGraphWrapper : public GraphWrapper<Graph> { |
1028 class stGraphWrapper : public GraphWrapper<Graph> { |
1027 public: |
1029 public: |
1028 class Node; |
1030 class Node; |
|
1031 friend class Node; |
1029 //GN, int |
1032 //GN, int |
1030 //0 normalis, 1 s, 2, true, ez az iteralasi sorrend, |
1033 //0 normalis, 1 s, 2, true, ez az iteralasi sorrend, |
1031 //es a vege a false azaz (invalid, 3) |
1034 //es a vege a false azaz (invalid, 3) |
1032 class NodeIt; |
1035 class NodeIt; |
|
1036 friend class NodeIt; |
1033 //GNI, int |
1037 //GNI, int |
1034 class Edge; |
1038 class Edge; |
|
1039 friend class Edge; |
1035 //GE, int, GN |
1040 //GE, int, GN |
1036 //0 normalis, 1 s->vmi, 2 vmi->t, ez a sorrend, |
1041 //0 normalis, 1 s->vmi, 2 vmi->t, ez a sorrend, |
1037 //invalid: (invalid, 3, invalid) |
1042 //invalid: (invalid, 3, invalid) |
1038 class OutEdgeIt; |
1043 class OutEdgeIt; |
|
1044 friend class OutEdgeIt; |
1039 //GO, int, GNI |
1045 //GO, int, GNI |
1040 //normalis pontbol (first, 0, invalid), ..., (invalid, 2, vmi), ... (invalid, 3, invalid) |
1046 //normalis pontbol (first, 0, invalid), ..., (invalid, 2, vmi), ... (invalid, 3, invalid) |
1041 //s-bol (invalid, 1, first), ... (invalid, 3, invalid) |
1047 //s-bol (invalid, 1, first), ... (invalid, 3, invalid) |
1042 //t-bol (invalid, 3, invalid) |
1048 //t-bol (invalid, 3, invalid) |
1043 class InEdgeIt; |
1049 class InEdgeIt; |
|
1050 friend class InEdgeIt; |
1044 //GI, int, GNI |
1051 //GI, int, GNI |
1045 //normalis pontbol (first, 0, invalid), ..., (invalid, 1, vmi), ... (invalid, 3, invalid) |
1052 //normalis pontbol (first, 0, invalid), ..., (invalid, 1, vmi), ... (invalid, 3, invalid) |
1046 //s-be (invalid, 3, invalid) |
1053 //s-be (invalid, 3, invalid) |
1047 //t-be (invalid, 2, first), ... (invalid, 3, invalid) |
1054 //t-be (invalid, 2, first), ... (invalid, 3, invalid) |
1048 class EdgeIt; |
1055 class EdgeIt; |
|
1056 friend class EdgeIt; |
1049 //(first, 0, invalid) ... |
1057 //(first, 0, invalid) ... |
1050 //(invalid, 1, vmi) |
1058 //(invalid, 1, vmi) |
1051 //(invalid, 2, vmi) |
1059 //(invalid, 2, vmi) |
1052 //invalid, 3, invalid) |
1060 //invalid, 3, invalid) |
1053 template <typename T> class NodeMap; |
1061 template <typename T> class NodeMap; |
1101 public: |
1109 public: |
1102 NodeIt() { } |
1110 NodeIt() { } |
1103 NodeIt(const typename Graph::NodeIt& _n, int _spec) : |
1111 NodeIt(const typename Graph::NodeIt& _n, int _spec) : |
1104 n(_n), spec(_spec) { } |
1112 n(_n), spec(_spec) { } |
1105 NodeIt(const Invalid& i) : n(i), spec(3) { } |
1113 NodeIt(const Invalid& i) : n(i), spec(3) { } |
1106 NodeIt(const GraphWrapper<Graph>& _G) : n(*(_G.graph)), spec(0) { |
1114 NodeIt(const stGraphWrapper<Graph>& _G) : n(*(_G.graph)), spec(0) { |
1107 if (!_G->valid(n)) spec=1; |
1115 if (!_G->valid(n)) spec=1; |
1108 } |
1116 } |
1109 operator Node() const { return Node(n, spec); } |
1117 operator Node() const { return Node(n, spec); } |
1110 }; |
1118 }; |
1111 class Edge : public Graph::Edge { |
1119 class Edge : public Graph::Edge { |
1146 OutEdgeIt(const typename Graph::OutEdgeIt& _e, int _spec, |
1154 OutEdgeIt(const typename Graph::OutEdgeIt& _e, int _spec, |
1147 const typename Graph::ClassNodeIt& _n) : |
1155 const typename Graph::ClassNodeIt& _n) : |
1148 e(_e), spec(_spec), n(_n) { |
1156 e(_e), spec(_spec), n(_n) { |
1149 } |
1157 } |
1150 OutEdgeIt(const Invalid& i) : e(i), spec(3), n(i) { } |
1158 OutEdgeIt(const Invalid& i) : e(i), spec(3), n(i) { } |
1151 OutEdgeIt(const GraphWrapper<Graph>& _G, const Node& _n) { |
1159 OutEdgeIt(const stGraphWrapper<Graph>& _G, const Node& _n) { |
1152 switch (_n.spec) { |
1160 switch (_n.spec) { |
1153 case 0 : |
1161 case 0 : |
1154 if (_G.graph->inSClass) { //S, van normalis kiel |
1162 if (_G.graph->inSClass(_n)) { //S, van normalis kiel |
1155 e=typename Graph::OutEdgeIt(*(_G.graph), |
1163 e=typename Graph::OutEdgeIt(*(_G.graph), |
1156 typename Graph::Node(_n)); |
1164 typename Graph::Node(_n)); |
1157 spec=0; |
1165 spec=0; |
1158 n=INVALID; |
1166 n=INVALID; |
1159 if (!_G.graph->valid(e)) spec=3; |
1167 if (!_G.graph->valid(e)) spec=3; |
1189 InEdgeIt(const typename Graph::InEdgeIt& _e, int _spec, |
1197 InEdgeIt(const typename Graph::InEdgeIt& _e, int _spec, |
1190 const typename Graph::ClassNodeIt& _n) : |
1198 const typename Graph::ClassNodeIt& _n) : |
1191 e(_e), spec(_spec), n(_n) { |
1199 e(_e), spec(_spec), n(_n) { |
1192 } |
1200 } |
1193 InEdgeIt(const Invalid& i) : e(i), spec(3), n(i) { } |
1201 InEdgeIt(const Invalid& i) : e(i), spec(3), n(i) { } |
1194 InEdgeIt(const GraphWrapper<Graph>& _G, const Node& _n) { |
1202 InEdgeIt(const stGraphWrapper<Graph>& _G, const Node& _n) { |
1195 switch (_n.spec) { |
1203 switch (_n.spec) { |
1196 case 0 : |
1204 case 0 : |
1197 if (_G.graph->inTClass) { //T, van normalis beel |
1205 if (_G.graph->inTClass(_n)) { //T, van normalis beel |
1198 e=typename Graph::InEdgeIt(*(_G.graph), |
1206 e=typename Graph::InEdgeIt(*(_G.graph), |
1199 typename Graph::Node(_n)); |
1207 typename Graph::Node(_n)); |
1200 spec=0; |
1208 spec=0; |
1201 n=INVALID; |
1209 n=INVALID; |
1202 if (!_G.graph->valid(e)) spec=3; |
1210 if (!_G.graph->valid(e)) spec=3; |
1230 EdgeIt() { } |
1238 EdgeIt() { } |
1231 EdgeIt(const typename Graph::EdgeIt& _e, int _spec, |
1239 EdgeIt(const typename Graph::EdgeIt& _e, int _spec, |
1232 const typename Graph::ClassNodeIt& _n) : |
1240 const typename Graph::ClassNodeIt& _n) : |
1233 e(_e), spec(_spec), n(_n) { } |
1241 e(_e), spec(_spec), n(_n) { } |
1234 EdgeIt(const Invalid& i) : e(i), spec(3), n(i) { } |
1242 EdgeIt(const Invalid& i) : e(i), spec(3), n(i) { } |
1235 EdgeIt(const GraphWrapper<Graph>& _G) : |
1243 EdgeIt(const stGraphWrapper<Graph>& _G) : |
1236 e(*(_G.graph)), spec(0), n(INVALID) { |
1244 e(*(_G.graph)), spec(0), n(INVALID) { |
1237 if (!_G.graph->valid(e)) { |
1245 if (!_G.graph->valid(e)) { |
1238 spec=1; |
1246 spec=1; |
1239 _G.graph->first(n, S_CLASS); |
1247 _G.graph->first(n, S_CLASS); |
1240 if (!_G.graph->valid(n)) { //Ha S ures |
1248 if (!_G.graph->valid(n)) { //Ha S ures |