File: coinc.c

package info (click to toggle)
magnus 20060324-5.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,436 kB
  • ctags: 20,462
  • sloc: cpp: 130,217; ansic: 37,090; tcl: 10,970; perl: 1,109; makefile: 966; sh: 403; yacc: 372; csh: 57; awk: 33; asm: 10
file content (112 lines) | stat: -rw-r--r-- 2,988 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* file coinc.c  */
#ifdef __DI
#include "tcyacc.h"
#endif
#include "coinc.h"

Void
tc_coinc(lows,highs,tc_pvar)
Int	lows;
Int 	highs;
struct  tc_str_vars     *tc_pvar;
{
#include "tc_void.h"
register Int 	*ct;
register Int 	low;
register Int 	high;
register Int 	i;
register Int 	j;
register Int 	highi;
register int	lowi;
register Int	*ppt;
register Int	*rpt;
/* subroutine to process the primary coincidence coset lows=coset highs
* and its consequences.
* CTAIL -- the tail of the coincidence queue.
* CHEAD -- the head of the coincidence queue.
* within the coincidence processing CT(high,2) is used to link the
* coincidence queue together, CT(high,1) contains minus the value of
* the equivalent (lower numbered) coset (the minus sign acting as a
* redundancy flag).
* this routine utilizes a principle suggested by beetham (space saving
* in coset enumeration, unpublished) but not the data structure. at
* the suggestion of c c simms it uses the data structure used in
* cannon, dimino, havas, watson with some modifications.
*/
	Init;
/* start of coinc processing report  */
#ifdef __DI
	if(DIAG[4]) {
	char *tt;
	tt = STATUS;
	STATUS = "CS";
	tc_text(11,tc_pvar);
	fprintf(fout,"******* HIGH= %d    LOW= %d *******\n",Addr2Num(high),Addr2Num(low));
	STATUS = tt;
	}
#endif
/* process columns 1 and 2 of the primary coincidence. */
	tc_coinc_cols12(low,high,tc_pvar);
	if (INDEX1)
                return;
	for(;;) {
		if(NCOL > 2)
/* process columns 3 to NCOL of the coincidence high=low. */
		for(i = 3; i <= NCOL; i++) {
/* highi -- column i entry of coset high. */
			highi = CT(high, i);
			if (highi == 0)
				continue;
			j = INV_TO_COL[i];
/* delete CT(highi,j) at this stage rather than replace by low to
* avoid having two occurrences of low in the one column. 
*/
			CheckHighi;
/* lowi -- column i entry for coset low. */
			lowi = CT(low, i);
			if (lowi) {
				if(lowi == high)
					lowi = low;
/* we have found a possibly new coincidence highi=lowi. */
				tc_coinc_cols12(lowi, highi, tc_pvar);
				if (INDEX1)
					return;
                  	} else {
/* mark a new deduction to be processed later. */
				CT(low, i) = highi;
#ifdef __DI
        if (DIAG[7]) {
        int n,*pt_d;
        char ch;
        n = COL_TO_GEN[i];
        fprintf(fout,"**** C %d*",Addr2Num(low));
        if(n < 0) {
                ch = Gen_st[-n].gen;
                fprintf(fout,"%c",toupper(ch));
        } else {
                ch = Gen_st[n].gen;
                fprintf(fout,"%c",ch);
        }
        fprintf(fout,"=%d\n",Addr2Num(highi));
	}
#endif
				if(!VeryFirst)
					Save_ded(low,i);
			}
			CheckSet(low,i);
		}
/* get the next coincidence from the queue for processing. */
		Pull(high,low);
	} /* end of 'for(;;)'  */
/* see if row KN becomes redundant.  */
	CheckIntnal;
	CheckKN;
/* delete all entries referencing dead cosets from the deductions stack.
*/
	CheckDed;
/* end of coinc processing report */
#ifdef __DI
	if(DIAG[3]) tc_text(11,tc_pvar);
#endif
}