00001
00002
00003
00004 SET_BOUNDS ()
00005
00006 { int del;
00007
00008 for (v=1; v <= U; ++v) {
00009 if (LINK[v] < 0 || BASE[v] != v) {
00010 NEXT_D[v] = LAST_D;
00011 continue;
00012 }
00013 LINK[v] = -LINK[v];
00014 i = v;
00015 while (i != DUMMYVERTEX) {
00016 Y[i] -= DELTA;
00017 i = NEXTVTX[i];
00018 }
00019 f = MATE[v];
00020 if (f != DUMMYEDGE) {
00021 i = BEND(f);
00022 del = SLACK(f);
00023 while (i != DUMMYVERTEX) {
00024 Y[i] -= del;
00025 i = NEXTVTX[i];
00026 }
00027 }
00028 NEXT_D[v] = LAST_D;
00029 }
00030 }
00031
00032
00033
00034
00035 UNPAIR_ALL ()
00036
00037 { int u;
00038
00039 for (v=1; v <= U; ++v) {
00040 if (BASE[v] != v || LASTVTX[v] == v)
00041 continue;
00042 nextu = v;
00043 NEXTVTX[LASTVTX[nextu]] = DUMMYVERTEX;
00044 while (1) {
00045 u = nextu;
00046 nextu = NEXTVTX[nextu];
00047 UNLINK (u);
00048 if (LASTVTX[u] != u) {
00049 f = (LASTEDGE[2] == OPPEDGE(e)) ? LASTEDGE[1] : LASTEDGE[2];
00050 NEXTVTX[LASTVTX[BEND(f)]] = u;
00051 }
00052 newbase = BMATE (BMATE(u));
00053 if (newbase != DUMMYVERTEX && newbase != u) {
00054 LINK[u] = -DUMMYEDGE;
00055 REMATCH (newbase, MATE[u]);
00056 }
00057 while (LASTVTX[nextu] == nextu && nextu != DUMMYVERTEX)
00058 nextu = NEXTVTX[nextu];
00059 if (LASTVTX[nextu] == nextu && nextu == DUMMYVERTEX)
00060 break;
00061 }
00062 }
00063 }
00064
00065