void al2_rep(int cntrl, int cnt) { Logic tmpa, tmpm; tmpa = asis; asis = TRUE; tmpm = msgctrl; msgctrl = FALSE; while (cnt-- > 0) { if ((cntrl & 0x1) != 0) { al2_munge_cyc(); } if ((cntrl & 0x2) != 0) { al2_munge_inv(); } if ((cntrl & 0x4) != 0) { al2_munge_per(); } /* (Re)run the enumeration, and then try to sort out what happened. */ lresult = al1_start(0); fprintf(fop, "Group Relators: "); al1_prtwl(rellst, 16); fprintf(fop, ";\n"); al1_rslt(lresult); if (lresult > 0 && sgdone) { okcont = okredo = TRUE; tabinfo = tabindex = TRUE; } else if (lresult >= -259 && sgdone) { okcont = okredo = TRUE; tabinfo = TRUE; tabindex = FALSE; } else { okcont = okredo = FALSE; tabinfo = tabindex = FALSE; } if (!(okcont && okredo && tabinfo)) { asis = tmpa; msgctrl = tmpm; al2_restart("* An unknown problem has occurred"); } } asis = tmpa; msgctrl = tmpm; }
void al2_aep2(Wlelt *p, int *d) { Logic flg; int i,blen; if (p == NULL) /* End of list, run enumerator */ { /* Run the enumeration, and then try to sort out what happened. */ d[2]++; lresult = al1_start(0); if (lresult > 0 && sgdone) { okcont = okredo = TRUE; tabinfo = tabindex = TRUE; } else if (lresult >= -259 && sgdone) { okcont = okredo = TRUE; tabinfo = TRUE; tabindex = FALSE; } else { okcont = okredo = FALSE; tabinfo = tabindex = FALSE; } if (!(okcont && okredo && tabinfo)) { asis = (Logic)d[0]; msgctrl = (Logic)d[1]; al2_restart("* An unknown problem has occurred"); } /* Did we get an index? Any new best/worst values? */ if (tabindex) { d[8]++; flg = FALSE; if (maxcos < d[3]) { d[3] = maxcos; flg = TRUE; } if (maxcos > d[4]) { d[4] = maxcos; flg = TRUE; } if (totcos < d[5]) { d[5] = totcos; flg = TRUE; } if (totcos > d[6]) { d[6] = totcos; flg = TRUE; } if (flg) { fprintf(fop, "Group Relators: "); al1_prtwl(rellst, 16); fprintf(fop, ";\n"); al1_rslt(lresult); } /* DTT code: dump *all* totcos values */ /* fprintf(fop, "DTT: totcos=%d\n", totcos); */ } } /* Cycle and/or invert this word, and then recurse. Note the care to ensure that we always do just what is required; in particular, we must ensure we restore a word to its original form. Note that we correctly cope with cycling in the presence of non-1 exponents. We *cannot* suppress inverting (x)^n, if x is an involution, since the geninv[] array is recalculated by al1_start() & may change since we're manipulating asis. To implement this, we'd need to duplicate the code in the al1_chkinvol() function. In fact, there's no end to this, since inverting (ab)^n, if a & b are involutions, is equivalent to cycling it, and doing *both* is wasteful! */ else { blen = p->len/p->exp; /* Baselength of word */ if ((d[7] & 0x3) == 0) /* Do nothing */ { al2_aep2(p->next, d); } else if ((d[7] & 0x3) == 1) /* Cycle only */ { for (i = 0; i < blen; i++) { al2_cyc_rel(p); al2_aep2(p->next, d); } } else if ((d[7] & 0x3) == 2) /* Invert only */ { al2_aep2(p->next, d); al2_inv_rel(p); al2_aep2(p->next, d); al2_inv_rel(p); } else /* Cycle & invert */ { for (i = 0; i < blen; i++) { al2_cyc_rel(p); al2_aep2(p->next, d); } al2_inv_rel(p); for (i = 0; i < blen; i++) { al2_cyc_rel(p); al2_aep2(p->next, d); } al2_inv_rel(p); } } }
void al1_prtdetails(int bits) { if (bits < 2) { fprintf(fop, " #--- %s: Run Parameters ---\n", ACE_VER); } if (bits == 0 || bits == 1 || bits == 2) { if (grpname != NULL) { fprintf(fop, "Group Name: %s;\n", grpname); } else { fprintf(fop, "Group Name: ;\n"); } } if (bits == 1) { if (ndgen > 0) { fprintf(fop, "Group Generators: "); if (!galpha) { fprintf(fop, "%d", ndgen); } else { fprintf(fop, "%s", &algen[1]); } fprintf(fop, ";\n"); } } if (bits == 0 || bits == 1 || bits == 3) { if (rellst != NULL) { fprintf(fop, "Group Relators: "); al1_prtwl(rellst, 16); fprintf(fop, ";\n"); } else { fprintf(fop, "Group Relators: ;\n"); } } if (bits == 0 || bits == 1 || bits == 4) { if (subgrpname != NULL) { fprintf(fop, "Subgroup Name: %s;\n", subgrpname); } else { fprintf(fop, "Subgroup Name: ;\n"); } } if (bits == 0 || bits == 1 || bits == 5) { if (genlst != NULL) { fprintf(fop, "Subgroup Generators: "); al1_prtwl(genlst, 21); fprintf(fop, ";\n"); } else { fprintf(fop, "Subgroup Generators: ;\n"); } } if (bits == 1) { switch (workmult) { case 1: fprintf(fop, "Wo:%d;", workspace); break; case KILO: fprintf(fop, "Wo:%dK;", workspace); break; case MEGA: fprintf(fop, "Wo:%dM;", workspace); break; case GIGA: fprintf(fop, "Wo:%dG;", workspace); break; } fprintf(fop, " Max:%d;", maxrow); if (msgctrl) { if (msghol) { fprintf(fop, " Mess:-%d;", msgincr); } else { fprintf(fop, " Mess:%d;", msgincr); } } else { fprintf(fop, " Mess:0;"); } fprintf(fop, " Ti:%d; Ho:%d; Loop:%d;\n", tlimit, hlimit, llimit); if (asis) { fprintf(fop, "As:1;"); } else { fprintf(fop, "As:0;"); } if (pcomp) { fprintf(fop, " Path:1;"); } else { fprintf(fop, " Path:0;"); } if (rfill) { fprintf(fop, " Row:1;"); } else { fprintf(fop, " Row:0;"); } if (mendel) { fprintf(fop, " Mend:1;"); } else { fprintf(fop, " Mend:0;"); } fprintf(fop, " No:%d; Look:%d; Com:%d;\n", nrinsgp, lahead, comppc); /* Note that we printout using the aliases, since we want to know (or, at least, be able to deduce) what style was used. Note that, although ffactor is a float, the Level 1 (& Level 2) interfaces use ffactor1, which is an int. So we need to convert for printout, to maintain the ability to read the output back in. */ fprintf(fop, "C:%d; R:%d; Fi:%d;", cfactor1, rfactor1, (int)ffactor); fprintf(fop, " PMod:%d; PSiz:%d; DMod:%d;", pdefn, pdsiz, dedmode); fprintf(fop, " DSiz:%d;\n", dedsiz); } if (bits < 2) { fprintf(fop, " #---------------------------------\n"); } }