263 const g2int mallow = 1073741825;
264 static g2int ifeed = 12;
265 static g2int ifirst = 0;
268 g2int i__1, i__2, i__3;
271 static g2int j, k, l;
273 static g2int ired, kinc, mina, maxa, minb, maxb, minc, maxc, ibxx2[31];
274 static char cfeed[1];
275 static g2int nenda, nendb, ibita, ibitb, minak, minbk, maxak, maxbk,
276 minck, maxck, nouta, lmiss, itest, nount;
280 static g2int ibitbs, mislla, misllb, misllc, iersav, lminpk, ktotal,
281 kounta, kountb, kstart, mstart, mintst, maxtst,
282 kounts, mintstk, maxtstk;
289 misslx = (
g2int *)calloc(*ndg,
sizeof(
g2int));
303 *(
unsigned char *)cfeed = (
char)ifeed;
324 kinc = (*inc > 1) ? *inc : 1;
334 for (j = 1; j <= 30; ++j)
336 ibxx2[j] = ibxx2[j - 1] << 1;
383 i__1 = kstart + lminpk - 1;
385 nenda = (i__1 < *nxy) ? i__1 : *nxy;
386 if (*nxy - nenda <= lminpk / 2)
404 if (nenda != *nxy && ic[kstart] == ic[kstart + 1])
413 for (k = kstart + 1; k <= i__1; ++k)
416 if (ic[k] != ic[kstart])
419 i__2 = nenda, i__3 = k - 1;
421 nenda = (i__2 > i__3) ? i__2 : i__3;
431 else if (*is523 == 1)
436 for (k = kstart + 1; k <= i__1; ++k)
442 if (ic[k] != ic[kstart])
445 i__2 = nenda, i__3 = k - 1;
447 nenda = (i__2 > i__3) ? i__2 : i__3;
463 for (k = kstart + 1; k <= i__1; ++k)
466 if (ic[k] != *missp && ic[k] != *misss)
469 if (ic[k] != ic[kstart])
472 i__2 = nenda, i__3 = k - 1;
474 nenda = (i__2 > i__3) ? i__2 : i__3;
492 for (k = kstart; k <= i__1; ++k)
507 else if (*is523 == 1)
511 for (k = kstart; k <= i__1; ++k)
534 for (k = kstart; k <= i__1; ++k)
536 if (ic[k] == *missp || ic[k] == *misss)
554 kounta = nenda - kstart + 1;
578 itest = maxa - mina + lmiss;
580 for (ibita = 0; ibita <= 30; ++ibita)
582 if (itest < ibxx2[ibita])
637 for (k = mstart + 1; k <= i__1; ++k)
640 if (ic[k] != ic[mstart])
658 i__3 = ktotal + lminpk;
660 i__1 = nendb, i__2 = (i__3 < *nxy) ? i__3 : *nxy;
662 nendb = (i__1 > i__2) ? i__1 : i__2;
665 if (*nxy - nendb <= lminpk / 2)
681 for (k = mstart; k <= i__1; ++k)
700 else if (*is523 == 1)
704 for (k = mstart; k <= i__1; ++k)
727 for (k = mstart; k <= i__1; ++k)
729 if (ic[k] == *missp || ic[k] == *misss)
747 kountb = nendb - ktotal;
768 for (ibitb = ibitbs; ibitb <= 30; ++ibitb)
770 if (maxb - minb < ibxx2[ibitb] - lmiss)
827 for (k = ktotal; k >= i__1; --k)
835 else if (ic[k] > maxb)
840 if (maxtst - mintst >= ibxx2[ibitb])
854 else if (*is523 == 1)
858 for (k = ktotal; k >= i__1; --k)
870 else if (ic[k] > maxb)
875 if (maxtst - mintst >= ibxx2[ibitb] - lmiss)
896 for (k = ktotal; k >= i__1; --k)
899 if (ic[k] == *missp || ic[k] == *misss)
908 else if (ic[k] > maxb)
913 if (maxtst - mintst >= ibxx2[ibitb] - lmiss)
939 if (kounta == kounts)
951 nouta = kounts - kounta;
954 if (nenda - nouta > minak && nenda - nouta > maxak)
972 i__1 = nenda - nouta;
973 for (k = kstart; k <= i__1; ++k)
986 else if (*is523 == 1)
989 i__1 = nenda - nouta;
990 for (k = kstart; k <= i__1; ++k)
1010 i__1 = nenda - nouta;
1011 for (k = kstart; k <= i__1; ++k)
1013 if (ic[k] == *missp || ic[k] == *misss)
1047 itest = maxa - mina + lmiss;
1049 for (ibita = 0; ibita <= 30; ++ibita)
1051 if (itest < ibxx2[ibita])
1094 if (*nxy - (ktotal + kinc) <= lminpk / 2)
1096 kinc = *nxy - ktotal;
1111 i__2 = ktotal + kinc;
1113 i__1 = (i__2 < *nxy) ? i__2 : *nxy;
1114 for (k = ktotal + 1; k <= i__1; ++k)
1130 else if (*is523 == 1)
1134 i__2 = ktotal + kinc;
1136 i__1 = (i__2 < *nxy) ? i__2 : *nxy;
1137 for (k = ktotal + 1; k <= i__1; ++k)
1139 if (ic[k] == *missp)
1162 i__2 = ktotal + kinc;
1164 i__1 = (i__2 < *nxy) ? i__2 : *nxy;
1165 for (k = ktotal + 1; k <= i__1; ++k)
1167 if (ic[k] == *missp || ic[k] == *misss)
1213 if (maxc - minc >= ibxx2[ibita] - lmiss)
1237 if (minbk > ktotal && maxbk > ktotal)
1266 lminpk += lminpk / 2;
1279 kstart = ktotal + 1;
1283 misslx[*lx - 1] = mallow;
1287 misslx[*lx - 1] = ic[ktotal];
1328 for (l = 1; l <= i__1; ++l)
1331 if (jmin[l] < ibxx2[*ibit])
1348 for (l = 1; l <= i__1; ++l)
1354 if (misslx[l - 1] == *missp)
1356 jmin[l] = ibxx2[*ibit] - 1;
1382 for (k = 1; k <= i__1; ++k)
1384 if (lbit[k] < *lbitref)
1395 for (k = 1; k <= i__1; ++k)
1397 lbit[k] -= *lbitref;
1413 for (k = 1; k <= i__1; ++k)
1416 if (lbit[k] < ibxx2[*jbit])
1443 for (k = 1; k <= i__1; ++k)
1445 if (nov[k] < *novref)
1456 for (k = 1; k <= i__1; ++k)
1479 for (k = 1; k <= i__1; ++k)
1482 if (nov[k] < ibxx2[*kbit])
1496 reduce(kfildo, &jmin[1], &jmax[1], &lbit[1], &nov[1], lx, ndg, ibit,
1497 jbit, kbit, novref, ibxx2, ier);
1499 if (*ier == 714 || *ier == 715)
int pack_gp(g2int *kfildo, g2int *ic, g2int *nxy, g2int *is523, g2int *minpk, g2int *inc, g2int *missp, g2int *misss, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *ndg, g2int *lx, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *lbitref, g2int *ier)
Determines groups of variable size, but at least of size minpk, the associated max (jmax( )) and min ...
int reduce(g2int *kfildo, g2int *jmin, g2int *jmax, g2int *lbit, g2int *nov, g2int *lx, g2int *ndg, g2int *ibit, g2int *jbit, g2int *kbit, g2int *novref, g2int *ibxx2, g2int *ier)
Determines whether the number of groups should be increased in order to reduce the size of the large ...