00001
00002
00003
00004 POINTER (u,v,e)
00005 int u,v,e;
00006
00007 { int i, del;
00008
00009 #ifdef DEBUG
00010 printf("Pointer u,v,e=%d %d %d-%d\n",u,v,END[OPPEDGE(e)],END[e]);
00011 #endif
00012
00013 LINK[u] = -DUMMYEDGE;
00014 NEXTVTX[LASTVTX[u]] = DUMMYVERTEX;
00015 NEXTVTX[LASTVTX[v]] = DUMMYVERTEX;
00016
00017 if (LASTVTX[u] != u) {
00018 i = MATE[NEXTVTX[u]];
00019 del = -SLACK(i) / 2;
00020 }
00021 else del = LAST_D;
00022
00023 i = u;
00024 while (i != DUMMYVERTEX) {
00025 Y[i] += del;
00026 NEXT_D[i] += del;
00027 i = NEXTVTX[i];
00028 }
00029 if (LINK[v] < 0) {
00030 LINK[v] = e;
00031 NEXTPAIR[DUMMYEDGE] = DUMMYEDGE;
00032 SCAN (v, DELTA);
00033 return;
00034 }
00035 else {
00036 LINK[v] = e;
00037 return;
00038 }
00039 }
00040
00041
00042
00043
00044 SCAN (x, del)
00045 int x, del;
00046
00047 { int u, del_e;
00048
00049 #ifdef DEBUG
00050 printf("Scan del=%d x=%d\n",del,x);
00051 #endif
00052
00053 newbase = BASE[x];
00054 stopscan = NEXTVTX[LASTVTX[x]];
00055 while (x != stopscan) {
00056 Y[x] += del;
00057 NEXT_D[x] = LAST_D;
00058 pairpoint = DUMMYEDGE;
00059 e = A[x];
00060 while (e != 0) {
00061 neighbor = END[e];
00062 u = BASE[neighbor];
00063 if (LINK[u] < 0) {
00064 if (LINK[BMATE (u)] < 0 || LASTVTX[u] != u) {
00065 del_e = SLACK (e);
00066 if (NEXT_D[neighbor] > del_e) {
00067 NEXT_D[neighbor] = del_e;
00068 NEXTEDGE[neighbor] = e;
00069 }
00070 }
00071 }
00072 else if (u != newbase) {
00073 INSERT_PAIR();
00074 }
00075 e = A[e];
00076 }
00077 x = NEXTVTX[x];
00078 }
00079 NEXTEDGE[newbase] = NEXTPAIR[DUMMYEDGE];
00080 }
00081
00082