version 1.14, 2003/12/11 15:12:35 |
version 1.17, 2004/01/06 17:23:23 |
Line 163 def getgcd(A,B){ |
|
Line 163 def getgcd(A,B){ |
|
for(I=0;I<VarsNumA;I++){ |
for(I=0;I<VarsNumA;I++){ |
|
|
for(J=0;J<VarsNumB;J++) |
for(J=0;J<VarsNumB;J++) |
if(C[J]==A[I][0]) |
if(B[J]==A[I][0]) |
break$ |
break$ |
|
|
if(J<VarsNumB) |
if(J<VarsNumB) |
Line 204 def makeret(Res,Vars,FLAG){ |
|
Line 204 def makeret(Res,Vars,FLAG){ |
|
VarsNum=length(Vars)$ |
VarsNum=length(Vars)$ |
|
|
ResVec=newvect(ResNum)$ |
ResVec=newvect(ResNum)$ |
for(M=0,I=0;I<ResNum;I++){ |
|
if(member(Res[I][0],Vars)){ |
|
ResVec[I]=Res[I][1]$ |
|
|
|
if(FLAG && type(ResVec[I])==1){ |
for(M=0,I=0;I<ResNum;I++){ |
if(M==0) |
if(member(Res[I][0],Vars)){ |
M=ResVec[I]$ |
ResVec[I]=Res[I][1]$ |
else |
|
if(ResVec[I]<M) |
if(FLAG && type(ResVec[I])==1){ |
M=ResVec[I]$ |
if(M==0) |
} |
M=ResVec[I]$ |
} |
else |
} |
if(ResVec[I]<M) |
|
M=ResVec[I]$ |
|
} |
|
} |
|
} |
|
|
if(M!=0) |
if(M!=0) |
ResVec=ResVec/M; |
ResVec=ResVec/M; |
|
|
RET=newvect(VarsNum,Vars)$ |
RET=newvect(VarsNum,Vars)$ |
|
|
for(I=0;I<ResNum;I++){ |
for(I=0;I<ResNum;I++){ |
for(J=0;J<VarsNum;J++) |
for(J=0;J<VarsNum;J++) |
Line 448 def leastsq(NormMat,ExpMat,Vars,FLAG){ |
|
Line 449 def leastsq(NormMat,ExpMat,Vars,FLAG){ |
|
Res=getgcd(Res,Rea)$ |
Res=getgcd(Res,Rea)$ |
|
|
if(nonposdegchk(Res)){ |
if(nonposdegchk(Res)){ |
|
|
TMP1=makeret(Res,Vars,1)$ |
TMP1=makeret(Res,Vars,1)$ |
|
|
if(TMP1[0]==0){ |
if(TMP1[0]==0){ |
TMP=roundret(TMP1[1])$ |
TMP=roundret(TMP1[1])$ |
if(TMP!=[]) |
if(TMP!=[]) |
Line 559 def weightr(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
Line 562 def weightr(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
if(member(Rea[I],Vars)) |
if(member(Rea[I],Vars)) |
TMP=cons(Rea[I],TMP)$ |
TMP=cons(Rea[I],TMP)$ |
|
|
TMP=cons(ExtVars[F],TMP)$ |
if(member(ExtVars[F],Vars)) |
|
TMP=cons(ExtVars[F],TMP)$ |
|
|
Res=getgcd(Res,TMP)$ |
Res=getgcd(Res,TMP)$ |
|
|
if(nonposdegchk(Res)){ |
if(nonposdegchk(Res)){ |
|
|
TMP1=makeret(Res,Vars,1)$ |
TMP1=makeret(Res,Vars,1)$ |
|
|
if(TMP1[0]==0){ |
if(TMP1[0]==0){ |
TMP=roundret(TMP1[1])$ |
TMP=roundret(TMP1[1])$ |
if(TMP!=[]) |
if(TMP!=[]) |