Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

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

563674 views
1
#include "defs.h"
2
#include "permfns.h"
3
4
extern char inf[],inf2[],outf[],full,stabcall;
5
extern short perm[], sv2[],cp[],orb[],base[],
6
lorb[],fixpt[],fixb[],pno[],*pptr[],*svptr[],mnpt,mp,mb;
7
8
short npt;
9
FILE *ip,*op;
10
11
int egprog (void)
12
{ short nperms,ngens,nb,stab,olfb,nlfb,i,l,m,z;
13
if (full)
14
{ if ((ip=fopen(inf2,"r"))==0)
15
{ printf("Cannot open %s.\n",inf2); return(-1); }
16
fscanf(ip,"%hd%hd",&i,&ngens);
17
fclose(ip);
18
}
19
if ((ip=fopen(inf,"r"))==0) { printf("Cannot open %s.\n",inf); return(-1); }
20
if (stabcall)
21
{ printf("Stabilize how many points? "); scanf("%hd",&stab);}
22
else stab=0;
23
fscanf(ip,"%hd%hd%hd%hd",&npt,&nperms,&nb,&l);
24
if (npt>mnpt) {fprintf(stderr,"npt,too big. Increase NPT.\n"); return(-1); }
25
if (nperms>mp)
26
{ fprintf(stderr,"nperms too big. Increase MXP.\n"); return(-1);}
27
if (nb>mb) {fprintf(stderr,"nb too big. Increase MNB.\n"); return(-1); }
28
if (l<=0) {fprintf(stderr,"Wrong input format.\n"); return(-1); }
29
for (i=0;i<=nperms;i++) pptr[i]=perm+(npt+1)*i-1;
30
for (i=1;i<=nb;i++) svptr[i]=sv2+npt*(i-1)-1;
31
for (i=1;i<=npt;i++) pptr[0][i]=i;
32
readbaselo(nb,base,lorb);
33
for (i=1;i<=nperms;i++) readvec(pptr[i],1);
34
fclose(ip);
35
36
/* Main algorithm begins */
37
op=fopen(outf,"w");
38
*pno=0; fixpt[nb+1]=0;
39
for (l=nb;l>stab;l--)
40
{ for (i=1;i<=nperms;i++) if (pptr[i][npt+1]==l) {(*pno)++; pno[*pno]=i; }
41
fixpt[l]= *pno;
42
}
43
for (l=stab;l>=1;l--) fixpt[l]=fixpt[stab+1];
44
for (l=nb;l>stab;l--)
45
{ olfb=fixpt[l+1]; nlfb=fixpt[l];
46
if ((nlfb-olfb)>1) for (i=olfb+1;i<=nlfb;i++)
47
{ z=pno[i];
48
/* We test whether perm no z is redundant as a generator.
49
If so, we leave pno[i]=0, if not we put it back to z.
50
*/
51
if (full==0 || z>ngens)
52
{ pno[i]=0;
53
for (m=l;m>stab && pno[i]==0;m--)
54
{*pno=fixpt[m]; if (orbitsv(base[m],svptr[m],0)<lorb[m]) pno[i]=z;}
55
}
56
}
57
}
58
*pno=0; l=0;
59
for (i=nb;i>=1;i--)
60
{ z=fixpt[i];
61
while (l<z)
62
{ l++;
63
if (pno[l]>0) { (*pno)++; pno[*pno]=pno[l]; }
64
}
65
lorb[i]=orbitsv(base[i],svptr[i],0);
66
}
67
fprintf(op,"%4d%4d%4d%4d\n",npt,*pno,nb,3);
68
printbaselo(nb,base,lorb); printpsv(nb,pno,svptr);
69
for (i=1;i<=*pno;i++) fprintf(op,"%4d",pno[i]); fprintf(op,"\n");
70
return(0);
71
}
72
73