| version 1.10, 2003/11/27 11:25:00 |
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 389 def qcheck(PolyList,Vars,FLAG){ |
|
| Line 390 def qcheck(PolyList,Vars,FLAG){ |
|
| return RET$ |
return RET$ |
| } |
} |
| else{ |
else{ |
| RET=append(RET,[[Vars,ResVars[1]]])$ |
RET=append(RET,[[Vars,vtol(ResVars[1])]])$ |
| return RET$ |
return RET$ |
| } |
} |
| } |
} |
| 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]*1.0)$ |
TMP=roundret(TMP1[1])$ |
| if(TMP!=[]) |
if(TMP!=[]) |
| RET=append(RET,wsort(TMP1[1],Vars,TMP,FLAG))$ |
RET=append(RET,wsort(TMP1[1],Vars,TMP,FLAG))$ |
| |
|
| Line 460 def leastsq(NormMat,ExpMat,Vars,FLAG){ |
|
| Line 463 def leastsq(NormMat,ExpMat,Vars,FLAG){ |
|
| return RET$ |
return RET$ |
| } |
} |
| else{ |
else{ |
| RET=append(RET,[[Vars,TMP1[1]*1.0]])$ |
RET=append(RET,[[Vars,vtol(TMP1[1]*1.0)]])$ |
| return RET$ |
return RET$ |
| } |
} |
| } |
} |
| 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]*1.0)$ |
TMP=roundret(TMP1[1])$ |
| if(TMP!=[]) |
if(TMP!=[]) |
| RET=append(RET,wsort(TMP1[1],Vars, |
RET=append(RET,wsort(TMP1[1],Vars, |
| TMP,FLAG))$ |
TMP,FLAG))$ |
| Line 575 def weightr(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
| Line 581 def weightr(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
| map(drint,TMP1[1]*1.0),FLAG))$ |
map(drint,TMP1[1]*1.0),FLAG))$ |
| } |
} |
| else{ |
else{ |
| RET=append(RET,[[Vars,TMP1[1]*1.0]])$ |
RET=append(RET,[[Vars,vtol(TMP1[1]*1.0)]])$ |
| } |
} |
| } |
} |
| |
|