staticint al0_rpefn(int cnt, Logic fill)
{ int icol, rcol, irow, ires, col; int first, last, i, ii, j, ifront, iback, k, l, m, mi, n; int *beg, *end, *fwd, *bwd;
INCR(xrdefn);
#include"enum02.c"/* `empty' deduction stack */
/* Count up knh to its `correct' value; its current value may be redundantand/orwemayalreadyhaveacomplete(hole-free)table.Ditto knr;itscurrentvaluemayberedundantand/orwemayalreadyhave
scanned all non-redundant cosets. */
for ( ; knh < nextdf; knh++)
{ if (COL1(knh) >= 0)
{ for (icol = 1; icol <= ncol; icol++)
{ if (CT(knh, icol) == 0)
{ goto hfill1; }
}
}
} return(nalive);
hfill1:
while (knr < nextdf && COL1(knr) < 0)
{ knr++; } if (knr == nextdf)
{ return(nalive); }
/* The main loop. Provided cnt is non-zero, each pass through this scans
and closes one row. */
while (cnt != 0)
{ /* Scan through all relators for this coset. The code here is essentiallythesameasthatinal0_apply.Weinlineforspeed(and
flexibility; the code's not _exactly_ the same). */
for (ii = 1; ii <= ndrel; ii++)
{
j = (mendel ? rellen[ii]/relexp[ii] : 1); for (k = 0; k < j; k++)
{
/* <-- cancel indent */
/* Setup start & stop positions for scan, and the coset at the current
scan positions. */
beg = &(relators[relind[ii]+k]);
end = beg-1 + rellen[ii];
ifront = iback = knr;
/* Forward scan, leaving ifront set to coset at left of leftmost hole in
relator or to the last coset in the relator if no hole. */
/* If the scan completed, then l = ifront & iback = cos, and we'll fall rightthroughandcheckforacoincidence(i.e.,hasifrontcycledback
to cos or not?). Else, there's a hole & a backward scan is required. */
if (l == 0)
{ for (bwd = end; bwd >= fwd; bwd--)
{
m = *bwd;
mi = invcol[m];
if ((l = CT(iback, mi)) > 0)
{ iback = l; } else/* Scan stalled */
{ if (bwd == fwd)
{ /* The backward scan has only one gap, so note the deduction to
complete the cycle & prime for coincidence check. */
CT(iback, mi) = ifront;
SAVED(iback, mi);
if (CT(ifront, m) > 0)
{ ifront = CT(ifront, m); } else
{
CT(ifront, m) = iback;
ifront = iback;
}
INCR(rddedn);
} else/* Need to define a new coset */
{ /* Note that, if m is an involution, and occurs next to itself, thenafterthefirstdefn,theremainderofthestringofm's willclose.Notethatifm^2=1&mis_not_beingtreatedas aninvolution,then`removing'itisaTietzetransformation,not
a free reduction! */
if (nextdf > maxrow) /* Overflow */
{ return(0); }
/* If we get here, the scan has been completed. Check to see if we've foundapairofcoincidentcosets.Recallthat_coinc(ifitdoesnot return>0)isguaranteed_not_tochangeknc/knh,althoughitmayrender
them redundant. */
if (ifront != iback)
{
INCR(rdcoinc); if ((l = al0_coinc(ifront,iback,TRUE)) > 0)
{ return(l); } if (COL1(knr) < 0)
{ goto do_next; } /* knr now redundant */
}
/* --> restore indent */
#include"enum02.c"/* `empty' deduction stack */
if (COL1(knr) < 0)
{ goto do_next; } /* knr now redundant */
}
}
/* All relators close at this coset, any row-filling to do? Only (formally)necessaryifsomeg/Gdoes_not_appearinanyrelator, butit'susuallyagoodthingtodo.Also,don'tbotheriftherow
is guaranteed hole-free. */
if (fill && knr >= knh)
{ for (i = 1; i <= ncol; i++)
{ if (CT(knr,i) == 0)
{ if (nextdf > maxrow) /* Overflow */
{ return(0); }
/* Row knr is fully scanned (or redundant), so we adjust knr up, jumpingoveranyredundancies&checkingtoseeifwe'vefinished.We havealsouseduponeofourallowedrows,ifthere'salimit.Wealso
check to see if the table if complete. */
do_next: /* from al0_coinc() or dedn processing: knr redundant */
do
{ knr++; } while (knr < nextdf && COL1(knr) < 0);
if (knr == nextdf)
{ return(nalive); }
if (cnt > 0)
{ cnt--; }
for ( ; knh < nextdf; knh++)
{ if (COL1(knh) >= 0)
{ for (icol = 1; icol <= ncol; icol++)
{ if (CT(knh, icol) == 0)
{ goto hfill2; }
}
}
} return(nalive);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.