package Current.popups.Deg100; import Current.*; import Current.basic.*; import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.math.*; /**This class contains all the routines from the Function class that we need for the 100 degree result.*/ public class Deg100Function { public Deg100Function() {} /**for a generic word, the functions have a numerator and a denominator. One tricky part of this business is getting the sign right. So, we have a separate routine for computing the sign.*/ public static int[][] computeNumerator(VertexPair V,CombinatorialTriangle[] CT) { int[] n=Deg100Spine.computeSpine(V,CT); int spine=n[n[0]+2]; int[][] m=new int[4][n[0]+2]; for(int j=1;j<=n[0];++j) { m[1][j]=CT[n[j]].d[spine][0]; m[2][j]=CT[n[j]].d[spine][1]; m[3][j]=(2*(j%2)-1)*n[n[0]+1]; } m[0][0]=n[0]; //length m[0][1]=n[1]; //start return(m); } public static int[][] computeDenominator(int spine,CombinatorialTriangle[] CT) { int[] n=Deg100Spine.fullSpine(spine,CT); int[][] m=new int[4][n[0]+1]; for(int j=1;j<=n[0];++j) { m[0][j]=n[j]; m[1][j]=CT[n[j]].d[spine][0]; m[2][j]=CT[n[j]].d[spine][1]; m[3][j]=2*(j%2)-1; } m[0][0]=n[0]; return(m); } public static int[][] computeDenominator(VertexPair V,CombinatorialTriangle[] CT) { int spine=Deg100Spine.spineNumber(V,CT); return(computeDenominator(spine,CT)); } public static int getSign(int nn,int[][] d) { if(d[0][d[0][0]]=0)&&(imax=0) { a[v1][200+v2]=a[v1][200+v2]+sign; } if(v1<0) { a[-v1][200-v2]=a[-v1][200-v2]-sign; } } } a[0][200]=0; count=1; for(i=0;i<=imax;++i) { for(j=1;j<=399;++j) { if(a[i][j]>0) { f3[0][count]=i; f3[1][count]=j-200; f3[2][count]=a[i][j]; ++count; } if(a[i][j]<0) { f3[0][count]=-i; f3[1][count]=-j+200; f3[2][count]=-a[i][j]; ++count; } } } f3[0][0]=count-1; return(f3); } /**This is the bound which requires the foil method*/ public static int absoluteSecondDerivative(int[][] f,int n1,int n2) { int a,b,c,d; int total=0; d=0; for(int i=1;i<=f[0][0];++i) { a=f[0][i]; b=f[1][i]; c=f[2][i]; if((n1==2)&&(n2==0)) d=c*a*a; if((n1==1)&&(n2==1)) d=c*a*b; if((n1==0)&&(n2==2)) d=c*b*b; if(d<0) d=-d; total=total+d; } return(total); } }