| version 1.8, 2003/11/20 10:41:12 |
version 1.9, 2003/11/21 08:07:16 |
|
|
| load("solve")$ |
load("solve")$ |
| load("gr")$ |
load("gr")$ |
| |
|
| def junban(A,B){ |
def nonzerovec(A){ |
| |
|
| |
for(I=0;I<size(A)[0];I++) |
| |
if(A[I]!=0) |
| |
return 1$ |
| |
|
| |
return 0$ |
| |
} |
| |
|
| |
def junban(A,B){ |
| return (A<B ? 1:(A>B ? -1:0))$ |
return (A<B ? 1:(A>B ? -1:0))$ |
| } |
} |
| |
|
| def worder(A,B){ |
def worder(A,B){ |
| |
|
| return (A[0]<B[0] ? 1:(A[0]>B[0] ? -1:0))$ |
return (A[0]<B[0] ? 1:(A[0]>B[0] ? -1:0))$ |
| } |
} |
| |
|
| Line 458 def weightr(ExpMat,Vars,PolyListNum,OneMat){ |
|
| Line 465 def weightr(ExpMat,Vars,PolyListNum,OneMat){ |
|
| Res=solve(SolveList,SolVars)$ |
Res=solve(SolveList,SolVars)$ |
| Res=cons([ExtVars[F],1],Res)$ |
Res=cons([ExtVars[F],1],Res)$ |
| |
|
| Rea=cons(ExtVars[F],Rea)$ |
TMP=[]$ |
| Res=getgcd(Res,Rea)$ |
for(I=0;I<length(Rea);I++) |
| |
if(member(Rea[I],Vars)) |
| |
TMP=cons(Rea[I],TMP)$ |
| |
|
| |
TMP=cons(ExtVars[F],TMP)$ |
| |
Res=getgcd(Res,TMP)$ |
| |
|
| if(nonposdegchk(Res)){ |
if(nonposdegchk(Res)){ |
| |
|
| TMP1=makeret(Res,Vars)$ |
TMP1=makeret(Res,Vars)$ |
| Line 494 def weight(PolyList,Vars,FLAG){ |
|
| Line 506 def weight(PolyList,Vars,FLAG){ |
|
| |
|
| RET=[]$ |
RET=[]$ |
| |
|
| /* first */ |
|
| |
|
| TMP=qcheck(PolyList,Vars)$ |
TMP=qcheck(PolyList,Vars)$ |
| |
|
| if(TMP!=[]){ |
if(TMP!=[]){ |
| Line 507 def weight(PolyList,Vars,FLAG){ |
|
| Line 517 def weight(PolyList,Vars,FLAG){ |
|
| |
|
| PolyListNum=length(PolyList)$ |
PolyListNum=length(PolyList)$ |
| |
|
| OneMat=newvect(PolyListNum+1,[0])$ |
if(FLAG){ |
| ExpMat=[]$ |
|
| for(I=0;I<PolyListNum;I++){ |
OneMat=newvect(PolyListNum+1,[0])$ |
| for(Poly=dp_ptod(PolyList[I],Vars); |
ExpMat=[]$ |
| Poly!=0;Poly=dp_rest(Poly)){ |
for(I=0;I<PolyListNum;I++){ |
| ExpMat=cons(dp_etov(dp_ht(Poly)),ExpMat)$ |
for(Poly=dp_ptod(PolyList[I],Vars); |
| |
Poly!=0;Poly=dp_rest(Poly)){ |
| |
ExpMat=cons(dp_etov(dp_ht(Poly)),ExpMat)$ |
| |
} |
| |
OneMat[I+1]=length(ExpMat)$ |
| } |
} |
| OneMat[I+1]=length(ExpMat)$ |
|
| } |
|
| |
|
| ExpMat=reverse(ExpMat)$ |
ExpMat=reverse(ExpMat)$ |
| ExpMat=newvect(length(ExpMat),ExpMat)$ |
ExpMat=newvect(length(ExpMat),ExpMat)$ |
| |
|
| /* second */ |
|
| |
|
| if(FLAG){ |
|
| TMP=weightr(ExpMat,Vars,PolyListNum,OneMat)$ |
TMP=weightr(ExpMat,Vars,PolyListNum,OneMat)$ |
| RET=append(RET,TMP[1])$ |
RET=append(RET,TMP[1])$ |
| |
RET=append(RET,leastsq(TMP[0],ExpMat,Vars))$ |
| } |
} |
| |
else{ |
| |
ExpMat=[]$ |
| |
for(I=0;I<PolyListNum;I++){ |
| |
for(Poly=dp_ptod(PolyList[I],Vars); |
| |
Poly!=0;Poly=dp_rest(Poly)){ |
| |
if(nonzerovec(TMP=dp_etov(dp_ht(Poly)))) |
| |
ExpMat=cons(TMP,ExpMat)$ |
| |
} |
| |
} |
| |
|
| /* third */ |
ExpMat=reverse(ExpMat)$ |
| |
ExpMat=newvect(length(ExpMat),ExpMat)$ |
| |
|
| if(FLAG) |
|
| RET=append(RET,leastsq(TMP[0],ExpMat,Vars))$ |
|
| else |
|
| RET=append(RET,leastsq(0,ExpMat,Vars))$ |
RET=append(RET,leastsq(0,ExpMat,Vars))$ |
| |
} |
| /* forth */ |
|
| |
|
| ExpMat=qsort(ExpMat,junban)$ |
ExpMat=qsort(ExpMat,junban)$ |
| |
|