#include #include #include #include using namespace std; struct data { int n; vectora; long double value; bool check; }; // List of functions defined long double bin(int n, int r); long double bin2(int x, int y, int z); long double N0(int k , vectorc); // This function will give number of rational curves in P_k ^2 int product(vectora, vectorb); // This defines the intersection porduct of given two homology class in P_k ^2 vector< vector < int > > produceclock (int k, vector c); vector< vector < int > > produceclock1 (int k, vector c); long double N1(int k , vectorbeta); //This function will give number of elliptic curves in P_k ^2 long double M0(vector< int > beta); // This function will give number of rational curves in P1XP1 long double M1(vector< int > beta); //This function will give number of elliptic curves in P1XP1 vectorstore10; // This function will store all the values of N0( beta) vectorstore11; // This function will store all the values of N1( beta) vector store00; // This function will store all the values of M0( beta) vector store01; // This function will store all the values of M1( beta) vector alpha; /* int b; int c; int d; */ //*************************************************************************************** int main(){ int k,n; cout.precision(30); string cont="y"; while(cont == "Y" || cont =="y" || cont == "yes"){ // b=0,c=0,d=0; cout<<"Enter the number of beta which you want to compute:"<>n; while(n<= 0){ cout<<"Kindly enter positive number."<>n; } int check[n],a[n]; vector< vector< int > > tempstorage; for(int p=0; p< n; p++) { int choice=0; while(choice < 1 || choice > 2) { cout<<"enter 1 for P1XP1 and enter 2 for P^2 blown up upto 8 point for beta_"<> choice; } if(choice==1) { check[p]=1; cout<<"Kindly enter the homology class beta_"< beta; int in; cin>>in; beta.push_back(in); cin>>in; beta.push_back(in); tempstorage.push_back(beta); } if(choice==2) { check[p]=2; cout<<"Kindly enter the number of blowup points (call this number k). The maximum is 8."<>a[p]; cout<<"Specify the k+1 component integral vector beta_"< beta; cin>>in; beta.push_back(in); for(int i=1; i< a[p]+1; i++) { cin>>in; beta.push_back(-in); } tempstorage.push_back(beta); /* cout<<"c[i] is "; for(int i=0;i< beta.size() ;i++){ cout< > clock = produceclock1(beta.size()-1 ,beta); for(int i=0;i>cont; } return 0; } // definitions of the functions //**************************************************************** long double bin(int n, int r){ if(r>n || r<0 || n<0) return 0; if(r==0 && n==0) return 1; long double answer=1; for(int i=0;i > produceclock (int k, vector c){ vector< vector < int > > alphabetcprime; if(k==0) { for(int i=0;i temporary; temporary.push_back(i); alphabetcprime.push_back(temporary); } return alphabetcprime; } vectorsmaller; for(int i=0;i > temporary = produceclock(k-1,smaller); //create vectors inductively for(int j=0;jc){ for(int i=k; i > 0; i--) { if(c[i]==0) { c.pop_back(); k--; } else break; } long double answer=0; long double tempsumi=0; data tempstorage; tempstorage.n=k; tempstorage.a= c; tempstorage.check= false; if(c[0]==0) { for(int i=1;i0) { tempstorage.check=true; tempstorage.value=0; store10.push_back(tempstorage); return tempstorage.value; } tempsumi+=c[i]; } if(tempsumi==-1) { tempstorage.check=true; tempstorage.value=1; store10.push_back(tempstorage); return tempstorage.value; } else { tempstorage.check=true; tempstorage.value=0; store10.push_back(tempstorage); return tempstorage.value; } } // [0,...,1,0..] is 1 every other thing starting with 0 is 0. if(c[0]<0) { tempstorage.check=true; tempstorage.value=0; store10.push_back(tempstorage); return tempstorage.value; } // [negative,...] is 0 tempsumi=0; for(int i=1;i0 and the others leq 0 if(c[0]==1) { for(int i=1;i=0 && deltabeta<3){ vector< vector < int > > alphabetcprime; int loop=0; bool condi=true; while(condi==true){ loop++; if(c[loop]>0){condi=false;} } vectortci; for(int i=0;itempone; vectortemptwo; tempone = alphabetcprime[i]; for(int j=0;jtci[j] || tempone[j]<0 || temptwo[j]>tci[j]) makesense=false; tempsum+=tempone[j]; anothertempsum+=temptwo[j]; } if(tempsum<=0 || anothertempsum<=0) makesense=false; long double deltabetaone = 3*tempone[0]-1; long double deltabetatwo = 3*temptwo[0]-1; for(int u=1;u=3){ vector< vector < int > > alphabetcprime; alphabetcprime = produceclock(k, c); for(int i=0;itempone; vectortemptwo; tempone = alphabetcprime[i]; for(int j=0;jc[j] || tempone[j]<0 || temptwo[j]>c[j]) makesense=false; tempsum+=tempone[j]; anothertempsum+=temptwo[j]; } if(tempsum<=0 || anothertempsum<=0) makesense=false; long double deltabetaone = 3*tempone[0]-1; long double deltabetatwo = 3*temptwo[0]-1; for(int u=1;ua, vectorb){ long double answer= a[0]*b[0]; if(a.size() <= b.size()) { for(int i=1; i< a.size();i++) answer -= a[i]*b[i]; } else { for(int i=1; i< b.size();i++) answer -= a[i]*b[i]; } return answer; } //********************************************************************* vector< vector < int > > produceclock1 (int k, vector c){ vector< vector < int > > alphabetcprime; vector larger; larger.push_back(c[0]); for(int i=1; i<= k; i++) { larger.push_back(c[i]+1); } vector< vector > temporary = produceclock(k, larger); for(int i= temporary.size()-1; i >=1; i--) alphabetcprime.push_back(temporary[i]); vector positive; if(k!= 0) { positive.push_back(0); for(int i=1;i<=k; i++) positive.push_back(1); temporary= produceclock(k, positive); for(int i=1; i< temporary.size(); i++) { for(int j=1; j< temporary[i].size(); j++) { if(temporary[i][j] != 0) temporary[i][j]=-1; } alphabetcprime.push_back(temporary[i]); } } return alphabetcprime; } //********************************************************************* long double N1(int k , vectorbeta){ for(int i=k ; i > 0; i--) { if(beta[i] ==0) { beta.pop_back(); k--; } else break; } vector xi; xi.push_back(3); for(int i=1; i<=k; i++) { xi.push_back(1); } long double T1=0,T2=0,T3=0,T4=0, sum=0; int kappabeta = product(xi, beta); int dX= product(xi, xi); int b2X= 1+k; // cout< 1) { for(int i=1;i<=k;i++) { if(beta[i] < 0) // [positive, ...., positive,...] is 0 So from now on beta[0]>0 and the others leq 0 { return 0; } } } if(beta[0]==1) { long double temp=0; for(int i=1;i<=k;i++) temp += beta[i]; if (temp==0 || temp == -1) { return 0; } } if(kappabeta < 2) { return 0; } data tempstorage; tempstorage.n=k; tempstorage.a= beta; tempstorage.check= false; for(int r=0; r< store11.size(); r++) { if(store11[r].n== k && store11[r].a== beta && store11[r].check== true) return store11[r].value; } vector< vector < int > > secondvector; vector< vector < int > > thirdvector; secondvector= produceclock1(k, beta); thirdvector= produceclock1(k, beta); for(int i=0; i< secondvector.size(); i++) { // computation of T1 for(int j=0; j< thirdvector.size(); j++) { vector beta11; vector beta12; vector beta13; bool makesense1 = true; long double t1=0; int count1=0; beta12= secondvector[i]; beta13= thirdvector[j]; for(int p=0; p beta21; vector beta22; long double t2=0; int count2=0; bool makesense2= true; beta22= secondvector[i]; for(int j=0; j beta31; vector beta32; long double t3=0; int count3=0; bool makesense3= true; beta32= secondvector[i]; for(int p=0; p beta) { long double sum=0; long double kappabeta= 2*(beta[0] + beta[1]); data tempstorage; tempstorage.n=1; tempstorage.check=false; // initial codition of the recurtion if((beta[0]==1 && beta[1] == 0) || (beta[0]==0 && beta[1] == 1)) { tempstorage.check=true; tempstorage.value=1; tempstorage.a= beta; store00.push_back(tempstorage); return tempstorage.value; } if(beta[0] < beta[1]) { vector betaprime; betaprime.push_back(beta[1]); betaprime.push_back(beta[0]); tempstorage.a= betaprime; tempstorage.check= true; tempstorage.value = M0(betaprime); store00.push_back(tempstorage); } for(int k=0; k< store00.size(); k++) { if(store00[k].a== beta && store00[k].check==true && store00[k].n==1) return store00[k].value; } vector< vector > firstvector= produceclock(1, beta); for(int i=1; i< firstvector.size()-1; i++) { vector< int > beta1; vector< int > beta2; beta1= firstvector[i]; beta2.push_back(beta[0]- beta1[0]); beta2.push_back(beta[1]- beta1[1]); long double kappabeta1= 2*(beta1[0] + beta1[1]); long double kappabeta2= 2*(beta2[0] + beta2[1]); long double beta1dotbeta2 = (beta1[0]*beta2[1]) + (beta2[0]* beta1[1]); long double t=0; t= beta1dotbeta2* beta2[1]*((beta1[0]* bin(kappabeta-4,kappabeta1-2))- (beta2[0]* bin(kappabeta-4, kappabeta2-1)))* M0(beta1)* M0(beta2); sum += t; } tempstorage.check=true; tempstorage.value= sum; tempstorage.a= beta; store00.push_back(tempstorage); return tempstorage.value; } //********************************************************************* long double M1(vector< int > beta) { long double sum=0,dX=8,b2X=2, T1=0,T2=0,T3=0,T4=0; long double kappabeta= 2*(beta[0] + beta[1]); data tempstorage; tempstorage.n=1; tempstorage.check=false; // initial codition of the recurtion if((beta[0]==1 && beta[1] == 0) || (beta[0]==0 && beta[1] == 1)) { tempstorage.check=true; tempstorage.value=0; tempstorage.a= beta; store01.push_back(tempstorage); return tempstorage.value; } if(beta[0] < beta[1]) { vector betaprime; betaprime.push_back(beta[1]); betaprime.push_back(beta[0]); tempstorage.a= betaprime; tempstorage.check= true; tempstorage.value = M1(betaprime); store01.push_back(tempstorage); } for(int k=0; k< store01.size(); k++) { if(store01[k].a== beta && store01[k].check==true && store01[k].n==1) return store01[k].value; } vector< vector < int > > secondvector; vector< vector < int > > thirdvector; secondvector= produceclock(1, beta); thirdvector= produceclock(1, beta); for(int i=1; i< secondvector.size()-1; i++) { //computation of T1 for(int j=1; j< thirdvector.size()-1; j++) { vector beta11; vector beta12; vector beta13; bool makesense1 = true; long double t1=0; beta12= secondvector[i]; beta13= thirdvector[j]; beta11.push_back(beta[0]- beta12[0]- beta13[0]); beta11.push_back(beta[1]- beta12[1]- beta13[1]); // Put some restriction on beta1,beta2,beta3 if((beta11[0] < 0 || beta11[1] < 0) || (beta11[0]==0 && beta11[1]==0)) { makesense1 = false; } if(makesense1== true) { long double kappabeta11 = 2*(beta11[0] + beta11[1]); long double kappabeta12 = 2*(beta12[0] + beta12[1]); long double kappabeta13 = 2*(beta13[0] + beta13[1]); long double beta11dotbeta12 = (beta11[0]*beta12[1]) + (beta12[0]* beta11[1]); long double beta11dotbeta13 = (beta11[0]*beta13[1]) + (beta13[0]* beta11[1]); long double beta12dotbeta13 = (beta12[0]*beta13[1]) + (beta13[0]* beta12[1]); t1 = 12* bin2(kappabeta-2, kappabeta12-1, kappabeta13-1)* 2* kappabeta12* pow(kappabeta13,2)* beta11dotbeta12* (( ((4* kappabeta11) + kappabeta12 - (2* kappabeta13) ) * beta12dotbeta13 )- (3* kappabeta12 * beta11dotbeta13))* M0(beta12)* M0(beta13); if(t1!= 0) t1= t1* M1(beta11); T1 += t1; /* if(t1 != 0) { cout<<"Term 1 is \n"; cout<<"beta1 is ("< beta21; vector beta22; long double t2=0; bool makesense2= true; beta22= secondvector[i]; beta21.push_back(beta[0]- beta22[0] ); beta21.push_back(beta[1]- beta22[1] ); long double kappabeta21 = 2*(beta21[0] + beta21[1]); long double kappabeta22 = 2*(beta22[0] + beta22[1]); // Put some restriction on beta1,beta2 if(beta21[0] < 0 || beta21[1] < 0 || (beta21[0]==0 && beta21[1]==0)) { makesense2 = false; } if(makesense2==true) { long double beta21dotbeta22 = (beta21[0]*beta22[1]) + (beta22[0]* beta21[1]); t2= 12* ((bin(kappabeta -2, kappabeta21-1) *4* pow(kappabeta22,2)*((2*kappabeta21* kappabeta22)- pow(kappabeta22,2)- (3* dX * beta21dotbeta22)))+ (bin(kappabeta-2,kappabeta21)* ((2* beta21dotbeta22 * kappabeta22 * dX * ((4* kappabeta21)+ kappabeta22)) + (4 * kappabeta21* pow(kappabeta22,2)* ((2* kappabeta21)- kappabeta22)) ))) * M0(beta22); if(t2 !=0) { t2= t2* M1(beta21); // this is the formula for T2 if(t2 != 0) { T2 += t2; } } /* if(t2 != 0) { cout<<"Term 2 is \n"; cout<<"beta1 is ("< beta31 = beta21; vector beta32 = beta22; long double t3=0; bool makesense3= true; /* beta32= secondvector[i]; for(int p=0;p<2;p++) beta31.push_back(beta[p]- beta32[p]); */ // Put some restriction on beta1,beta2 if((beta31[0] < 0 || beta31[1] < 0) || (beta31[0]==0 && beta31[1]==0)) { makesense3 = false; } if(makesense3== true) { long double kappabeta31= kappabeta21; long double kappabeta32= kappabeta22; long double beta31dotbeta32 = (beta31[0]*beta32[1]) + (beta32[0]* beta31[1]); long double beta31dotbeta31 = 2* beta31[0]*beta31[1]; t3= bin(kappabeta-2, kappabeta31-1)* pow(kappabeta32,2)* beta31dotbeta32*(pow(kappabeta31,2)*(kappabeta31- (2* kappabeta32)- (6*beta31dotbeta32))+ (kappabeta32* beta31dotbeta31*((4*kappabeta31)+ kappabeta32)))* M0(beta31) * M0(beta32); //This is the formula for T3 T3 += t3; /* if(t3 != 0) { cout<<"Term 3 is \n"; cout<<"beta1 is ("<