1 #include "defs.h"
2
3 # define MNG 16001
4 # define MEXP 16001
5 # define RSP 2500000
6 # define PTRSP 250000
7 # define MCL 31
8 # define MSP 200000
9 # define MV 25000
10 # define MM 60
11 # define MWL 5000
12 # define MARG 16000
13 # define MPR 500
14
15 /* MEXP-1=max exponent, MNG-1=max no of new gens introduced, RSP=basic space,
16 PTRSP=basic pointer space, MCL=max class, MSP,MV,MM as in mcd.c,
17 MARG=safety margin for collections (effect is unpredictable if this is
18 too small - I think it should be at least 2*MEXP!), MPR=max prime, MWL=max
19 length of words for matrix computations (done in array cp) (no warnings
20 given if this is too small!).
21 */
22
23 char inf0[80],inf1[80],inf2[80],inf3[80],inf4[80],inf[80],
24 outf0[80],outf1[80],outf2[80],outfd[80],outcopy[80],
25 act,ch1,crel,cfm,gap;
26 short mv=MV,mm=MM,mexp=MEXP,mng=MNG,mcl=MCL,
27 facexp,tails,depth,no,
28 prime,exp,nng,class,*rpf,*rpb,*eexpnt,*enexpnt,**pcb,intexp,stage,
29 dim,onng,**opcb,**npcb,*nd1,*nd2,*spv,**spm,
30 rel[RSP],expnt[MEXP],nexpnt[MNG],prvec[MNG],pinv[MPR],wt[MEXP+MNG],
31 d1[MEXP+MNG],d2[MEXP+MNG],*pcptr[PTRSP],**powptr[MEXP],**comptr[MEXP],
32 *sspc[MCL],*sspf[MCL],sgen[MCL],sex[MCL],spgen[MCL],spex[MCL],
33 spugen[MCL],dpth[MEXP+MNG],sd1[MEXP],sd2[MEXP],swt[MEXP],
34 mspace[MSP],*vec[MV],**mat[MM],cp[MWL];
35 int rsp=RSP,msp=MSP,ptrsp=PTRSP,wsp,marg=MARG;
36
37 /* act=1 if -a set, ch1=1 if -1 set, crel=1 if -c set,
38 inf0 (if act) = pcp output from previous run of nqrun,
39 inf1 = current pcp input file (variable),
40 inf2 = matrices of min gen set for P,
41 inf3 (if act) = output from scrun,
42 inf4 (if act) = matrices of dcreps,
43 inf remembers group name,
44 outf0 = pcp output file used in comp of H^2(P,M) or H^2(Q,M),
45 outf1 = current pcp output file (variable),
46 outf2 = matrices of pcp gens of P,
47 outfd = output of dimension of cohomolgy group for GAP
48 */
49
50 int
main(int argc,char * argv[])51 main (int argc, char *argv[])
52 { short arg,n; char err;
53 act=0; ch1=0; cfm=0; err=0; arg=1; crel=0; gap=0;
54 if (argc<=arg) {err=1; goto error;}
55 while (argv[arg][0]=='-')
56 { if (argv[arg][1]=='a') act=1;
57 else if (argv[arg][1]=='1') ch1=1;
58 else if (argv[arg][1]=='c') crel=1;
59 else if (argv[arg][1]=='f') cfm=1;
60 else if (argv[arg][1]=='g') gap=1;
61 else {err=1; goto error; }
62 arg++; if (argc<=arg) {err=1; goto error; }
63 }
64 strcpy(inf1,argv[arg]); strcat(inf1,"."); strcpy(outf1,inf1);
65 strcpy(inf2,inf1); strcpy(outf2,inf1); strcpy(outf0,inf1);
66 strcpy(inf,inf1); strcpy(outfd,inf1); strcat(outfd,"cdim");
67 if (ch1) {strcpy(outcopy,inf1); strcat(outcopy,"copy");}
68 if (act)
69 { strcpy(inf3,inf1); strcpy(inf4,inf1); strcpy(inf0,inf1);
70 arg++; if (argc<=arg) strcat(inf3,"sc"); else strcat(inf3,argv[arg]);
71 arg++; if (argc<=arg) strcat(inf4,"dcrmat"); else strcat(inf4,argv[arg]);
72 }
73 arg++;
74 if (argc<=arg)
75 { if (act) { if (ch1) strcat(inf0,"ch1"); else strcat(inf0,"ch2"); }
76 else strcat(inf1,"pcp");
77 }
78 else { if (act) strcat(inf0,argv[arg]); else strcat(inf1,argv[arg]);}
79 arg++;
80 if (argc<=arg)
81 { if (act) strcat(outf0,"octemp");
82 else if (ch1) strcat(outf0,"ch1"); else strcat(outf0,"ch2");
83 }
84 else strcat(outf0,argv[arg]);
85 if (act==0)
86 {arg++; if (argc<=arg) strcat(inf2,"pgmat"); else strcat(inf2,argv[arg]);}
87 arg++; if (argc<=arg) strcat(outf2,"pmats"); else strcat(outf2,argv[arg]);
88 n=nqprog();
89 if (n == -1) exit(1);
90 if (n == 2) exit(2);
91 /* This means cohomology group has become trivial */
92 exit(0);
93 error:
94 if (err)
95 { fprintf(stderr,"Usage: nqrun");
96 fprintf(stderr," [-1] [-c] [-a] [-f] gpname (if a [inf3] [inf4] )\n");
97 fprintf(stderr," [inf1] [outf1] (if not a [inf2] [outf2]).\n");
98 exit(1);
99 }
100 }
101