1 #include "defs.h"
2 
3 # define  NPT    32767
4 # define PSP   1000000
5 # define SVSP  100000
6 # define  MP     500
7 # define  MB      80
8 # define SPACE   1000000
9 # define MEXP    4000
10 # define RISP   32767
11 /* SPACE is for cosetrep perms and various arrays defined by pointers
12    MEXP is max no of stored cosetrep perms (as in syld.c)
13    RISP is size of space set aside for reular orbit info
14        (this cannot be set bigger than 2^15-1).
15 */
16 
17 char cent,sym,opt,hgst,nop,nonb[NPT],inf1[80],inf2[80],inf3[80],outf1[80],
18      outf2[80];
19 /*   inf1 =gpname.?1 (can be sym. No default)
20      inf2 =gpname.?2 (must be subgroup of ?1. No default)
21      inf3 =gpname.?3 (Usually not used. Small generating set for ?2.
22                       No default)
23      Defaults:  outf1 gpname.norm (or cent, if -c set)
24                 outf2 gpname.ng (only if -n called)
25 */
26 short  mp=MP,mexp=MEXP,mb=MB-1,mnpt=NPT,risp=RISP,prime=0,
27        perm[PSP],sv[SVSP],cp[10*NPT],orb[1+NPT],gbase[NPT],hbase[MB],obase[MB],
28        nbase[MB],lorbg[NPT],lorbn[NPT],lorbh[MB],ntno[NPT],reg[NPT],
29        ntorno[NPT],tsv1[NPT+1],tsv2[NPT+1],tsv3[NPT+1],genorb[NPT+1],expcp[NPT],
30        fp[MP],pno[MP/2],start[NPT+1],space[SPACE],ipno[MP],endorno[NPT],
31        *pptr[MP],*svgptr[MB],*svhptr[MB],*svnptr[NPT],*intorb[MB],
32        *horno[MB],*hlorb[MB],*expptr[MEXP],*imorno[MB],
33        *imlorb[MB],*orbperm[MB],*deftime[MB],*regsv[MB],
34        orep[NPT+1];
35 int    psp=PSP,sp=SPACE,svsp=SVSP;
36 
37 int
main(int argc,char * argv[])38 main (int argc, char *argv[])
39 { short arg,r;  char c,err;
40   err=0; arg=1; hgst=0; opt=0; cent=0; nop=0;
41   if (argc<=arg) {err=1; goto error;}
42   while (argv[arg][0]=='-')
43   { c=argv[arg][1];
44     if (c=='h') hgst=1; else if (c=='o') opt=1; else if (c=='c') cent=1;
45     else if (c=='n') nop=1;
46     else {err=1; goto error;}
47     arg++; if (argc<=arg) {err=1; goto error;}
48   }
49   if (argc<=arg+2) {err=1; goto error;}
50   strcpy(inf1,argv[arg]); strcat(inf1,"."); strcpy(inf2,inf1);
51   strcpy(inf3,inf1); strcpy(outf1,inf1); strcpy(outf2,inf1);
52   if (strcmp(argv[arg+1],"sym")==0) sym=1;
53   else {strcat(inf1,argv[arg+1]); sym=0;}
54   strcat(inf2,argv[arg+2]); arg+=3;
55   if (hgst)
56   { if (argc<=arg) {err=1; goto error;} strcat(inf3,argv[arg]);arg++;}
57   if (argc<=arg)
58   { if (cent) strcat(outf1,"cent"); else strcat(outf1,"norm");}
59   else
60   { strcat(outf1,argv[arg]); arg++;}
61   if (nop) {if (argc<=arg) strcat(outf2,"ng");else strcat(outf2,argv[arg]);}
62   if (sym) printf("G is the symmetric group.\n");
63   if (cent) printf("Calculation of C(H) ^ G.\n"); else
64   printf("Calculation of N(H) ^ G.\n");
65   if ((r=nprg1())==-1) exit(1);
66   if (r==1) exit(2);  /* This means H = G */
67   if ((r=nprg2())==-1) exit(1);
68   error:  if (err)
69   { fprintf(stderr,"Usage:    normrun [-h] [-n] [-c] [-o] ");
70     fprintf(stderr,"gpname inf1 inf2 (inf3) [outf1] [outf2].\n");
71     exit(1);
72   }
73   exit(0);
74 }
75