version 1.27, 2004/01/10 14:47:01 |
version 1.31, 2004/01/15 07:20:31 |
Line 199 def fixedpoint(A,FLAG){ |
|
Line 199 def fixedpoint(A,FLAG){ |
|
return fixpointmain(F,Vars)$ |
return fixpointmain(F,Vars)$ |
} |
} |
|
|
def nonzerovec(A){ |
|
|
|
for(I=0;I<size(A)[0];I++) |
|
if(A[I]!=0) |
|
return 1$ |
|
|
|
return 0$ |
|
} |
|
|
|
def junban(A,B){ |
def junban(A,B){ |
return (A<B ? 1:(A>B ? -1:0))$ |
return (A<B ? 1:(A>B ? -1:0))$ |
} |
} |
|
|
def worder(A,B){ |
|
return (A[0]<B[0] ? 1:(A[0]>B[0] ? -1:0))$ |
|
} |
|
|
|
def bsort(A){ |
def bsort(A){ |
|
|
K=size(A)[0]-1$ |
K=size(A)[0]-1$ |
Line 263 def nonposdegchk(Res){ |
|
Line 250 def nonposdegchk(Res){ |
|
|
|
def getgcd(A,B){ |
def getgcd(A,B){ |
|
|
VarsNumA=length(A)$ |
Anum=length(A)$ |
VarsNumB=length(B)$ |
|
|
|
C=newvect(VarsNumB,B)$ |
TMP=[]$ |
|
for(I=0;I<length(B);I++){ |
|
|
for(I=0;I<VarsNumA;I++){ |
for(J=0;J<Anum;J++) |
|
if(B[I]==A[J][0]) |
|
break; |
|
|
for(J=0;J<VarsNumB;J++) |
if(J==Anum) |
if(B[J]==A[I][0]) |
TMP=cons([B[I],B[I]],TMP)$ |
break$ |
|
|
|
if(J<VarsNumB) |
|
C[J]=A[I][1]$ |
|
} |
} |
|
A=append(A,TMP)$ |
|
|
D=0$ |
Anum=length(A)$ |
for(I=0;I<VarsNumB;I++) |
A=map(ltov,A)$ |
D=gcd(D,C[I])$ |
|
|
|
|
for(D=0,I=0;I<Anum;I++) |
|
D=gcd(D,A[I][1])$ |
|
|
if(D!=0){ |
if(D!=0){ |
C=C/D$ |
for(I=0;I<Anum;I++) |
C=map(red,C)$ |
A[I][1]=red(A[I][1]/D)$ |
} |
} |
|
|
for(L=1,D=0,I=0;I<VarsNumB;I++){ |
for(L=1,D=0,I=0;I<Anum;I++){ |
if(type(TMP=dn(C[I]))==1) |
if(type(TMP=dn(A[I][1]))==1) |
L=ilcm(L,TMP)$ |
L=ilcm(L,TMP)$ |
|
|
if(type(TMP=nm(C[I]))==1) |
if(type(TMP=nm(A[I][1]))==1) |
D=igcd(D,TMP)$ |
D=igcd(D,TMP)$ |
} |
} |
|
|
C=C*L$ |
for(I=0;I<Anum;I++) |
if(D!=0) |
A[I][1]=A[I][1]*L$ |
C=C/D$ |
|
|
|
RET=[]$ |
if(D!=0){ |
for(I=0;I<VarsNumB;I++) |
|
RET=cons([B[I],C[I]],RET)$ |
|
|
|
return RET$ |
for(I=0;I<Anum;I++) |
|
A[I][1]=A[I][1]/D$ |
|
} |
|
|
|
return map(vtol,A)$ |
} |
} |
|
|
def makeret(Res,Vars,FLAG){ |
def makeret(Res,Vars,FLAG){ |
Line 313 def makeret(Res,Vars,FLAG){ |
|
Line 302 def makeret(Res,Vars,FLAG){ |
|
|
|
ResVec=newvect(ResNum)$ |
ResVec=newvect(ResNum)$ |
|
|
for(M=0,I=0;I<ResNum;I++){ |
if(FLAG) |
|
M=0$ |
|
else |
|
M=-1$ |
|
|
|
for(I=0;I<ResNum;I++){ |
if(member(Res[I][0],Vars)){ |
if(member(Res[I][0],Vars)){ |
ResVec[I]=Res[I][1]$ |
ResVec[I]=Res[I][1]$ |
|
|
if(FLAG && type(ResVec[I])==1){ |
if(FLAG){ |
if(M==0) |
if(type(ResVec[I])==1){ |
M=ResVec[I]$ |
if(M==0) |
else |
M=ResVec[I]$ |
if(ResVec[I]<M) |
else |
M=ResVec[I]$ |
if(ResVec[I]<M) |
} |
M=ResVec[I]$ |
} |
} |
|
else |
|
M=-1$ |
|
} |
|
} |
} |
} |
|
|
if(M!=0) |
|
|
if(M!=-1) |
ResVec=ResVec/M; |
ResVec=ResVec/M; |
|
|
RET=newvect(VarsNum,Vars)$ |
RET=newvect(VarsNum,Vars)$ |
Line 341 def makeret(Res,Vars,FLAG){ |
|
Line 340 def makeret(Res,Vars,FLAG){ |
|
RET[J]=ResVec[I]$ |
RET[J]=ResVec[I]$ |
} |
} |
|
|
|
|
for(J=0;J<length(Vars);J++) |
|
RET=map(subst,RET,Vars[J], |
|
strtov(rtostr(Vars[J])+"_deg"))$ |
|
|
|
for(I=0;I<VarsNum;I++) |
for(I=0;I<VarsNum;I++) |
if(type(RET[I])!=1) |
if(type(RET[I])!=1) |
return [1,RET]$ |
return [1,RET]$ |
Line 467 def value2(Vars,Ans){ |
|
Line 461 def value2(Vars,Ans){ |
|
Res[I][0]=Vars[I]$ |
Res[I][0]=Vars[I]$ |
Res[I][1]=Ans[I]$ |
Res[I][1]=Ans[I]$ |
} |
} |
|
Res=map(vtol,Res)$ |
|
Res=vtol(Res)$ |
|
|
Res=getgcd(Res,Vars)$ |
Res=getgcd(Res,Vars)$ |
|
|
Line 501 def qcheck(PolyList,Vars,FLAG){ |
|
Line 497 def qcheck(PolyList,Vars,FLAG){ |
|
|
|
VarsList=[]$ |
VarsList=[]$ |
for(I=0;I<VarsNum;I++) |
for(I=0;I<VarsNum;I++) |
if(member(Vars[CHAGORD[I]],Rea)) |
if(member(TMP0=Vars[CHAGORD[I]],Rea)) |
VarsList=cons(Vars[CHAGORD[I]],VarsList)$ |
VarsList=cons(Vars[CHAGORD[I]],VarsList)$ |
|
|
Res=solve(reverse(SolveList),reverse(VarsList))$ |
Res=solve(reverse(SolveList),reverse(VarsList))$ |
Line 622 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
Line 618 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
RET0=value2(Vars,TMP)$ |
RET0=value2(Vars,TMP)$ |
if(RET0!=[]) |
if(RET0!=[]) |
RET0=wsort(RET0,Vars,RET0,1/10)$ |
RET0=wsort(RET0,Vars,RET0,ID+1/10)$ |
} |
} |
|
|
TMP=vtol(TMP1[1])$ |
TMP=vtol(TMP1[1])$ |
Line 633 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
Line 629 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
RET0=value2(Vars,TMP)$ |
RET0=value2(Vars,TMP)$ |
|
|
if(RET0!=[]) |
if(RET0!=[]) |
RET0=wsort(RET0,Vars,RET0,1/10)$ |
RET0=wsort(RET0,Vars,RET0,ID+1/10)$ |
} |
} |
|
|
RET=append(RET,RET0)$ |
RET=append(RET,RET0)$ |
Line 696 def unitweight(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
Line 692 def unitweight(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
|
|
if(jacobi(ExtMatColNum,NormMat1,WorkMat)){ |
if(jacobi(ExtMatColNum,NormMat1,WorkMat)){ |
|
|
Res=newvect(ExpMatColNum)$ |
Res=newvect(ExtMatColNum)$ |
for(I=0;I<ExpMatColNum;I++){ |
for(I=0;I<ExtMatColNum;I++){ |
Res[I]=newvect(2)$ |
Res[I]=newvect(2)$ |
Res[I][0]=Vars[I]$ |
Res[I][0]=ExtVars[I]$ |
Res[I][1]=WorkMat[ExtMatColNum-1][I]$ |
Res[I][1]=WorkMat[ExtMatColNum-1][I]$ |
} |
} |
|
|