CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Path: gap4r8 / pkg / ace-5.2 / src / enum02.c
Views: 418346
1
2
/**************************************************************************
3
4
enum02.c
5
Colin Ramsay ([email protected])
6
25 Feb 00
7
8
ADVANCED COSET ENUMERATOR, Version 3.001
9
10
Copyright 2000
11
Centre for Discrete Mathematics and Computing,
12
Department of Mathematics and
13
Department of Computer Science & Electrical Engineering,
14
The University of Queensland, QLD 4072.
15
(http://staff.itee.uq.edu.au/havas)
16
17
To fully process all deductions properly we need to invoke the stack
18
clearing routine several times in _rpefn(). The following code allow us
19
to do this; it's equivalent to the `standard' code, but the loops have been
20
unrolled & jumps removed. This allows multiple copies to be included
21
without problems, although we still have to be careful about the variable
22
names used. The (local) variables used are: irow, icol, ires, rcol, first,
23
last, i, beg, end, ifront, iback, fwd, l, bwd, m, mi.
24
25
**************************************************************************/
26
27
while (topded >= 0)
28
{
29
INCR(cddproc);
30
31
irow = dedrow[topded];
32
icol = dedcol[topded--];
33
if (COL1(irow) < 0)
34
{
35
INCR(cdddedn);
36
continue;
37
}
38
else
39
{
40
ires = CT(irow,icol);
41
rcol = invcol[icol];
42
}
43
44
if ((first = edpbeg[icol]) >= 0)
45
{
46
last = edpend[icol];
47
for (i = first; i <= last; i += 2)
48
{
49
beg = &(relators[edp[i]]);
50
end = beg + edp[i+1]-1;
51
52
ifront = l = ires;
53
iback = irow;
54
55
for (fwd = beg+1; fwd <= end; fwd++)
56
{
57
if ((l = CT(ifront, *fwd)) > 0)
58
{ ifront = l; }
59
else
60
{ break; }
61
}
62
63
if (l == 0)
64
{
65
for (bwd = end; bwd >= fwd; bwd--)
66
{
67
m = *bwd;
68
mi = invcol[m];
69
70
if ((l = CT(iback, mi)) > 0)
71
{ iback = l; }
72
else if (bwd == fwd)
73
{
74
CT(iback, mi) = ifront;
75
CT(ifront, m) = iback;
76
77
SAVED(iback, mi);
78
INCR(cddedn);
79
iback = ifront;
80
}
81
else
82
{
83
iback = ifront;
84
break;
85
}
86
}
87
}
88
89
if (iback != ifront)
90
{
91
INCR(cdcoinc);
92
93
if ((l = al0_coinc(ifront,iback,TRUE)) > 0)
94
{ return(l); }
95
if (COL1(irow) < 0 || COL1(ires) < 0)
96
{ break; }
97
}
98
}
99
}
100
101
if (COL1(irow) >= 0 && COL1(ires) >= 0 && (irow != ires || icol != rcol))
102
{
103
if ((first = edpbeg[rcol]) >= 0)
104
{
105
last = edpend[rcol];
106
for (i = first; i <= last; i += 2)
107
{
108
beg = &(relators[edp[i]]);
109
end = beg + edp[i+1]-1;
110
111
ifront = l = irow;
112
iback = ires;
113
114
for (fwd = beg+1; fwd <= end; fwd++)
115
{
116
if ((l = CT(ifront, *fwd)) > 0)
117
{ ifront = l; }
118
else
119
{ break; }
120
}
121
122
if (l == 0)
123
{
124
for (bwd = end; bwd >= fwd; bwd--)
125
{
126
m = *bwd;
127
mi = invcol[m];
128
129
if ((l = CT(iback, mi)) > 0)
130
{ iback = l; }
131
else if (bwd == fwd)
132
{
133
CT(iback, mi) = ifront;
134
CT(ifront, m) = iback;
135
136
SAVED(iback, mi);
137
INCR(cddedn);
138
iback = ifront;
139
}
140
else
141
{
142
iback = ifront;
143
break;
144
}
145
}
146
}
147
148
if (iback != ifront)
149
{
150
INCR(cdcoinc);
151
152
if ((l = al0_coinc(ifront,iback,TRUE)) > 0)
153
{ return(l); }
154
if (COL1(irow) < 0 || COL1(ires) < 0)
155
{ break; }
156
}
157
}
158
}
159
}
160
161
#ifdef AL0_DD
162
if (msgctrl && --msgnext == 0)
163
{
164
msgnext = msgincr;
165
ETINT;
166
fprintf(fop, "DD: a=%d r=%d h=%d n=%d;", nalive, knr, knh, nextdf);
167
MSGMID;
168
fprintf(fop, " d=%d\n", topded+1);
169
BTINT;
170
}
171
#endif
172
}
173
174
175