2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
22
static Halfedge *PQhash;
23
static int PQhashsize;
28
PQbucket(Halfedge *he)
32
bucket = (he->ystar - ymin)/deltay * PQhashsize;
33
if (bucket<0) bucket = 0;
34
if (bucket>=PQhashsize) bucket = PQhashsize-1 ;
35
if (bucket < PQmin) PQmin = bucket;
40
PQinsert(Halfedge *he, Site *v, float offset)
42
Halfedge *last, *next;
46
he -> ystar = v -> coord.y + offset;
47
last = &PQhash[PQbucket(he)];
48
while ((next = last -> PQnext) != (struct Halfedge *) NULL &&
49
(he -> ystar > next -> ystar ||
50
(he -> ystar == next -> ystar && v -> coord.x > next->vertex->coord.x)))
54
he -> PQnext = last -> PQnext;
60
PQdelete(Halfedge *he)
64
if(he -> vertex != (Site *) NULL) {
65
last = &PQhash[PQbucket(he)];
66
while (last -> PQnext != he) last = last -> PQnext;
67
last -> PQnext = he -> PQnext;
70
he -> vertex = (Site *) NULL;
87
while(PQhash[PQmin].PQnext == (struct Halfedge *)NULL) {PQmin += 1;}
88
answer.x = PQhash[PQmin].PQnext -> vertex -> coord.x;
89
answer.y = PQhash[PQmin].PQnext -> ystar;
98
curr = PQhash[PQmin].PQnext;
99
PQhash[PQmin].PQnext = curr -> PQnext;
112
PQhashsize = 4 * sqrt_nsites;
114
PQhash = (Halfedge *) myalloc(PQhashsize * sizeof *PQhash);
115
for(i=0; i<PQhashsize; i+=1) PQhash[i].PQnext = (Halfedge *)NULL;
119
PQdumphe (Halfedge *p)
121
printf (" [%x] %x %x %d %d %d %d %f\n",
122
p, p->ELleft, p->ELright, p->ELedge->edgenbr,
123
p->ELrefcnt, p->ELpm, (p->vertex ? p->vertex->sitenbr : -1), p->ystar);
131
for(i=0; i<PQhashsize; i+=1) {
133
p = PQhash[i].PQnext;