| version 1.14, 2003/12/11 15:12:35 |
version 1.16, 2004/01/06 09:26:11 |
| 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 203 def makeret(Res,Vars,FLAG){ |
|
| Line 203 def makeret(Res,Vars,FLAG){ |
|
| ResNum=length(Res)$ |
ResNum=length(Res)$ |
| VarsNum=length(Vars)$ |
VarsNum=length(Vars)$ |
| |
|
| ResVec=newvect(ResNum)$ |
ResVec=newvect(VarsNum,Vars)$ |
| 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){ |
M=0$ |
| |
for(I=0;I<ResNum;I++){ |
| |
|
| |
for(J=0;J<VarsNum;J++) |
| |
if(Vars[J]==Res[I][0]) |
| |
break; |
| |
|
| |
if(J<VarsNum){ |
| |
ResVec[J]=TMP=Res[I][1]$ |
| |
|
| |
if(FLAG && type(TMP)==1){ |
| if(M==0) |
if(M==0) |
| M=ResVec[I]$ |
M=TMP$ |
| else |
else |
| if(ResVec[I]<M) |
if(TMP<M) |
| M=ResVec[I]$ |
M=TMP$ |
| } |
} |
| } |
} |
| } |
} |
| Line 448 def leastsq(NormMat,ExpMat,Vars,FLAG){ |
|
| Line 455 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 568 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!=[]) |