#include #include using namespace std; #include typedef int *ptr_int; typedef ptr_int *ptr_ptr_int; int n=4; class list{ public: list *first; list *next; int k,number; int lcm; list() { next=NULL; } void new_list(int new_lcm,int k1,int n1); void check(int new_lcm,int k1,int n1); void show(); }; void list::show() { cout << k << " " << number << " with lcm " << lcm << endl; if( next!=NULL ) next->show(); } void list::new_list(int new_lcm,int k1,int n1) { next=new list; next->first=first; next->k=k1; next->number=n1; next->lcm=new_lcm; } void list::check(int new_lcm,int k1,int n1) { if( new_lcm==lcm ) { k=k1; number=n1; } else { if( next!=NULL ) { next->check(new_lcm,k1,n1); } else { // create a new member in the list new_list(new_lcm,k1,n1); } } } int fact(int k) { if( k==0 ) return 1; else return k*fact(k-1); } int binom(int n, int k) { return fact(n)/fact(k)/fact(n-k); } int gcd(int k, int l) { int aux; if( l>k ) { aux=l; l=k; k=aux; return gcd(k,l); } if( k%l==0 ) return l; else return gcd(l,k%l); } int gcdset(int *exponent,ptr_ptr_int *b, int k, int count) { int i; int current_gcd=1; for( i=0; i<=k; i++) { current_gcd*=exponent[b[i][k][count]]; } for( i=0; i<=k; i++) { current_gcd=gcd(exponent[b[i][k][count]],current_gcd); } return current_gcd; } int gcdsetcomplement(int *exponent,ptr_ptr_int *b, int k, int count) { int i,j,found; int current_gcd=1; for( i=0; i> n; int i,count,k,l; int loop; int *a,*last; ptr_int *kappa,*lcms,*tkappa,*C; ptr_ptr_int *b; int *exponent; int sign,rmax,d; int found,maxlcm; list *orbits,*first; int *chrank; int mindeg,mindeg2,maxdeg,maxdeg2,period,degree; a=new int[n]; last=new int[n]; kappa=new ptr_int[n]; tkappa=new ptr_int[n]; lcms=new ptr_int[n]; C=new ptr_int[n]; b=new ptr_ptr_int[n]; exponent=new int[n]; orbits=new list; for( i=0; i> exponent[i]; } for( l=0; lrmax ) rmax=tkappa[k][count]; } } //n odd implies rmax is at least 1 (empty set contributes in that case) if( n%2!=0 ) { if( rmax==0 ) rmax=1; } //cout << "C's" << endl; for( k=0; k0 ) { cout << "The torsion part of H_" << n-2 << "(Sigma;Z) consists of groups with order " << endl; for( i=0; i=i+1 ) { // cout << "bijdrage bij" << k << " " << count << endl; d*=C[k][count]; } } } //empty set counts once if n is odd, tkappa=0 if( n%2!=0 ) d*=gcdset(exponent,b,n-1,0); if( d!=1 ) cout << "d_" << i << "=" << d << endl; } cout << "There are no other torsion subgroups" << endl; } else { cout << "H_" << n-2 << "(Sigma;Z) is torsion-free" << endl; } cout << endl; //lcm determines orbit type orbits->lcm=lcms[1][0]; orbits->k=1; orbits->number=0; for( k=1; kcheck(lcms[k][count],k,count); } } //orbits->show(); first=orbits; //determine minimal and maximal degree in the first period of ch (rough estimates to get bounds for a table) //get period as well; d=1; mindeg=-2-2*d; maxdeg=4*n-6-2*d; period=-2*lcms[n-1][0]; for( i=0; imaxdeg ) maxdeg=maxdeg2; } //cout << "mindeg/maxdeg: " << mindeg << " " << maxdeg << endl; mindeg-=10; maxdeg+=10; //normalize maxdeg maxdeg=maxdeg-mindeg; chrank=new int[maxdeg+1]; //cout << "mindeg/maxdeg: " << mindeg << " " << maxdeg << endl; for( i=0; i<=maxdeg; i++ ) { chrank[i]=0; } // consider time pi/2*d for( d=1; d<=lcms[n-1][0]; d++ ) { //find largest orbit space which period divides d*pi/2 k=0; count=0; found=0; maxlcm=1; while( orbits!=NULL ) { if( d%orbits->lcm==0 ) { if( found ) { if( orbits->lcm>maxlcm ) { k=orbits->k; count=orbits->number; maxlcm=orbits->lcm; } } else { found=1; k=orbits->k; count=orbits->number; maxlcm=orbits->lcm; } } orbits=orbits->next; } //if d is divisible by one of the lcms, we get a contribution for homology if( found ) { // cout << d << ": " << k << " " << count << endl; //increase the rank of the appropriate chgroups degree=0; for( i=0; i=0 && period!=0 ) { count+=chrank[k]; k-=period; } cout << "In degree " << i+mindeg << " ch has rank " << count << endl; } cout << endl; delete chrank; }