105 |
|
if (complist[i].nr != oldnr) |
106 |
|
lastin = -1; /* flag sort */ |
107 |
|
} |
108 |
< |
/* computed rays for each uncommon beams */ |
108 |
> |
/* record computed rays for uncommon beams */ |
109 |
|
for (csm = clist+nents; csm-- > clist; ) |
110 |
|
if (csm->nc < 0) |
111 |
|
csm->nc = bnrays(hdlist[csm->hd], csm->bi); |
134 |
|
; |
135 |
|
n = csm - clist; |
136 |
|
if (op == BS_ADJ) { /* don't regenerate adjusted beams */ |
137 |
< |
for (i = n; i < nents && clist[i].nr > 0; i++) |
137 |
> |
for (++i; i-- && csm->nr > 0; csm++) |
138 |
|
; |
139 |
< |
nents = i; |
139 |
> |
nents = csm - clist; |
140 |
|
} |
141 |
|
if (n) { /* allocate space for merged list */ |
142 |
|
PACKHEAD *newlist; |
246 |
|
else |
247 |
|
frac = 1024.*1024.*16384. / (wtotal*sizeof(RAYVAL)); |
248 |
|
while (k--) |
249 |
< |
complist[k].nr = frac * complist[k].nr; |
249 |
> |
complist[k].nr = frac*complist[k].nr + 0.5; |
250 |
|
listpos = 0; lastin = -1; /* perform initial sort */ |
251 |
|
sortcomplist(); |
252 |
|
} |