version 1.39, 2004/05/18 14:11:09 |
version 1.40, 2004/05/23 02:48:47 |
Line 312 def makeret(Res,Vars,FLAG){ |
|
Line 312 def makeret(Res,Vars,FLAG){ |
|
|
|
if(FLAG){ |
if(FLAG){ |
if(type(ResVec[I])==1){ |
if(type(ResVec[I])==1){ |
if(M==0) |
if(M==0) |
M=ResVec[I]$ |
M=ResVec[I]$ |
else |
else |
if(ResVec[I]<M) |
if(ResVec[I]<M) |
Line 322 def makeret(Res,Vars,FLAG){ |
|
Line 322 def makeret(Res,Vars,FLAG){ |
|
M=-1$ |
M=-1$ |
} |
} |
} |
} |
} |
} |
|
|
if(M!=-1) |
if(M!=-1) |
ResVec=ResVec/M; |
ResVec=map(red,ResVec/M)$ |
|
|
RET=newvect(VarsNum,Vars)$ |
RET=newvect(VarsNum,Vars)$ |
|
|
Line 340 def makeret(Res,Vars,FLAG){ |
|
Line 340 def makeret(Res,Vars,FLAG){ |
|
|
|
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,vtol(RET)]$ |
|
|
return [0,RET]$ |
return [0,vtol(RET)]$ |
} |
} |
|
|
def roundret(V){ |
def roundret(V){ |
|
|
VN=size(V)[0]$ |
VN=length(V)$ |
|
|
K=1$ |
K=1$ |
RET0=V$ |
RET0=V$ |
Line 357 def roundret(V){ |
|
Line 357 def roundret(V){ |
|
S+=(RET0[J]-RET1[J])^2$ |
S+=(RET0[J]-RET1[J])^2$ |
|
|
for(I=2;I<10;I++){ |
for(I=2;I<10;I++){ |
RET0=I*V$ |
RET0=I*ltov(V)$ |
RET1=map(drint,RET0)$ |
RET1=map(drint,RET0)$ |
|
|
T=0$ |
T=0$ |
Line 370 def roundret(V){ |
|
Line 370 def roundret(V){ |
|
} |
} |
} |
} |
|
|
return map(drint,K*V)$ |
return map(drint,vtol(K*ltov(V)))$ |
} |
} |
|
|
def chkou(L,ExpMat,CHAGORD){ |
def chkou(L,ExpMat,CHAGORD){ |
Line 468 def value2(Vars,Ans,Ba,FLAG){ |
|
Line 468 def value2(Vars,Ans,Ba,FLAG){ |
|
|
|
Res=getgcd(Res,Vars)$ |
Res=getgcd(Res,Vars)$ |
|
|
if(nonposdegchk(Res)){ |
if(nonposdegchk(Res)) |
TMP1=makeret(Res,Vars,FLAG)$ |
return makeret(Res,Vars,FLAG)$ |
return vtol(TMP1[1])$ |
|
} |
|
else |
else |
return []$ |
return []$ |
} |
} |
Line 513 def qcheck(PolyList,Vars,FLAG){ |
|
Line 511 def qcheck(PolyList,Vars,FLAG){ |
|
|
|
if(FLAG==0){ |
if(FLAG==0){ |
|
|
if(TMP1[0]==0) |
if(TMP1[0]==0){ |
RET=append(RET,wsort(TMP1[1],Vars,TMP1[1],0))$ |
RET=append(RET,wsort(TMP1[1],Vars,TMP1[1],0))$ |
|
} |
else{ |
else{ |
|
|
TMP=vtol(TMP1[1])$ |
TMP=TMP1[1]$ |
RET0=[]$ |
RET1=[]$ |
if((TMP0=fixedpoint(TMP,0))!=[]){ |
if((TMP0=fixedpoint(TMP,0))!=[]){ |
|
|
for(I=0;I<length(TMP0);I++) |
for(I=0;I<length(TMP0);I++) |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
|
|
RET0=value2(Vars,TMP,1,0)$ |
RET0=value2(Vars,TMP,1,0)$ |
|
|
if(RET0!=[]) |
if(RET0!=[]) |
RET0=wsort(RET0,Vars,RET0,-1)$ |
RET1=wsort(RET0[1],Vars,RET0[1],-1)$ |
} |
} |
|
|
TMP=vtol(TMP1[1])$ |
TMP=TMP1[1]$ |
if(RET0==[] && (TMP0=fixedpoint(TMP,1))!=[]){ |
if(RET1==[] && (TMP0=fixedpoint(TMP,1))!=[]){ |
|
|
for(I=0;I<length(TMP0);I++) |
for(I=0;I<length(TMP0);I++) |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
|
|
RET0=value2(Vars,TMP,-1,0)$ |
RET0=value2(Vars,TMP,-1,0)$ |
|
|
if(RET0!=[]) |
if(RET0!=[]) |
RET0=wsort(RET0,Vars,RET0,-1)$ |
RET1=wsort(RET0[1],Vars,RET0[1],-1)$ |
} |
} |
RET=append(RET,RET0)$ |
|
|
if(RET1!=[]) |
|
RET=append(RET,RET1)$ |
|
|
} |
} |
|
|
} |
} |
else if(FLAG==1) |
else if(FLAG==1) |
RET=append(RET,[[0,Vars,vtol(TMP1[1])]])$ |
RET=append(RET,[[0,Vars,TMP1[1]]])$ |
} |
} |
} |
} |
|
|
return RET$ |
return RET$ |
} |
} |
|
|
def unitweight2(NormMat0,ExpMat,Vars,FLAG,ID){ |
|
|
|
RET=[]$ |
|
|
|
ExpMatRowNum=size(ExpMat)[0]$ |
|
ExpMatColNum=size(ExpMat[0])[0]$ |
|
ExtMatColNum=ExpMatColNum+1$ |
|
|
|
ExtVars=append(Vars,[uc()])$ |
|
|
|
if(NormMat==0){ |
|
|
|
NormMat0=newvect(ExtMatColNum)$ |
|
for(I=0;I<ExtMatColNum;I++) |
|
NormMat0[I]=newvect(ExtMatColNum)$ |
|
|
|
for(I=0;I<ExpMatColNum;I++) |
|
for(J=I;J<ExpMatColNum;J++) |
|
for(K=0;K<ExpMatRowNum;K++) |
|
NormMat0[I][J]+= |
|
ExpMat[K][I]* |
|
ExpMat[K][J]$ |
|
} |
|
|
|
for(I=0;I<ExpMatColNum;I++) |
|
for(K=0;K<ExpMatRowNum;K++) |
|
NormMat0[I][ExpMatColNum]-=ExpMat[K][I]$ |
|
|
|
NormMat0[ExpMatColNum][ExpMatColNum]=ExpMatRowNum$ |
|
|
|
WorkMat=newvect(ExtMatColNum)$ |
|
for(I=0;I<ExtMatColNum;I++) |
|
WorkMat[I]=newvect(ExtMatColNum)$ |
|
|
|
if(jacobi(ExtMatColNum,NormMat0,WorkMat)){ |
|
|
|
Res=newvect(ExtMatColNum)$ |
|
for(I=0;I<ExtMatColNum;I++){ |
|
Res[I]=newvect(2)$ |
|
Res[I][0]=ExtVars[I]$ |
|
Res[I][1]=WorkMat[ExtMatColNum-1][I]$ |
|
} |
|
|
|
if(nonposdegchk(Res)){ |
|
|
|
TMP1=makeret(Res,Vars,1)$ |
|
|
|
if(FLAG==0){ |
|
TMP=roundret(TMP1[1])$ |
|
|
|
RET=append(RET,wsort(TMP1[1],Vars,map(drint,TMP1[1]),ID))$ |
|
|
|
if(TMP!=[]) |
|
RET=append(RET,wsort(TMP1[1],Vars,TMP,ID+1))$ |
|
} |
|
else if(FLAG==1) |
|
RET=append(RET,[[ID,Vars,vtol(TMP1[1])]])$ |
|
} |
|
} |
|
|
|
return [NormMat0,RET]$ |
|
} |
|
|
|
def unitweight1(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
def unitweight1(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
|
RET=[]$ |
RET=[]$ |
Line 672 def unitweight1(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
Line 614 def unitweight1(ExpMat,Vars,PolyListNum,OneMat,FLAG){ |
|
TMP1=makeret(Res,Vars,1)$ |
TMP1=makeret(Res,Vars,1)$ |
|
|
if(FLAG==0){ |
if(FLAG==0){ |
TMP=roundret(TMP1[1])$ |
|
|
|
RET=append(RET,wsort(TMP1[1],Vars,map(drint,TMP1[1]),1))$ |
RET=append(RET,wsort(TMP1[1],Vars,map(drint,TMP1[1]),1))$ |
|
|
|
TMP=roundret(TMP1[1])$ |
if(TMP!=[]) |
if(TMP!=[]) |
RET=append(RET,wsort(TMP1[1],Vars,TMP,2))$ |
RET=append(RET,wsort(TMP1[1],Vars,TMP,2))$ |
|
|
} |
} |
else if(FLAG==1) |
else if(FLAG==1) |
RET=append(RET,[[1,Vars,vtol(TMP1[1])]])$ |
RET=append(RET,[[1,Vars,TMP1[1]]])$ |
} |
} |
} |
} |
|
|
Line 740 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
Line 682 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
if(FLAG==0){ |
if(FLAG==0){ |
|
|
if(TMP1[0]==0){ |
if(TMP1[0]==0){ |
|
RET=append(RET,wsort(TMP1[1],Vars,map(drint,TMP1[1]),ID))$ |
|
|
TMP=roundret(TMP1[1])$ |
TMP=roundret(TMP1[1])$ |
|
|
RET=append(RET,wsort(TMP1[1],Vars,map(drint,TMP1[1]),ID))$ |
|
|
|
if(TMP!=[]) |
if(TMP!=[]) |
RET=append(RET,wsort(TMP1[1],Vars,TMP,ID+1))$ |
RET=append(RET,wsort(TMP1[1],Vars,TMP,ID+1))$ |
} |
} |
else{ |
else{ |
|
|
TMP=vtol(TMP1[1])$ |
TMP=TMP1[1]$ |
RET0=[]$ |
RET1=[]$ |
if((TMP0=fixedpoint(TMP,0))!=[]){ |
if((TMP0=fixedpoint(TMP,0))!=[]){ |
|
|
for(I=0;I<length(TMP0);I++) |
for(I=0;I<length(TMP0);I++) |
Line 759 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
Line 700 def leastsq(NormMat,ExpMat,Vars,FLAG,ID){ |
|
RET0=value2(Vars,TMP,1,1)$ |
RET0=value2(Vars,TMP,1,1)$ |
|
|
if(RET0!=[]) |
if(RET0!=[]) |
RET0=wsort(RET0,Vars,map(drint,RET0),-ID)$ |
RET1=wsort(RET0[1],Vars,map(drint,RET0[1]),-ID)$ |
|
|
} |
} |
|
|
TMP=vtol(TMP1[1])$ |
TMP=TMP1[1]$ |
if(RET0==[] && (TMP0=fixedpoint(TMP,1))!=[]){ |
if(RET1==[] && (TMP0=fixedpoint(TMP,1))!=[]){ |
|
|
for(I=0;I<length(TMP0);I++) |
for(I=0;I<length(TMP0);I++) |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
TMP=map(subst,TMP,TMP0[I][0],TMP0[I][1])$ |
RET0=value2(Vars,TMP,-1,1)$ |
RET0=value2(Vars,TMP,-1,1)$ |
|
|
if(RET0!=[]) |
if(RET0!=[]) |
RET0=wsort(RET0,Vars,map(drint,RET0),-ID)$ |
RET1=wsort(RET0[1],Vars,map(drint,RET0[1]),-ID)$ |
} |
} |
|
|
RET=append(RET,RET0)$ |
if(RET1!=[]){ |
|
RET=append(RET,RET1)$ |
|
TMP=roundret(RET0[1])$ |
|
if(TMP!=[]) |
|
RET=append(RET,wsort(RET0[1],Vars,TMP,-(ID+1)))$ |
|
} |
|
|
} |
} |
|
|
} |
} |
else if(FLAG==1) |
else if(FLAG==1) |
RET=append(RET,[[ID,Vars,vtol(TMP1[1])]])$ |
RET=append(RET,[[ID,Vars,TMP1[1]]])$ |
} |
} |
|
|
return [NormMat0,RET]$ |
return [NormMat0,RET]$ |
Line 849 def weight(PolyList,Vars,FLAG){ |
|
Line 797 def weight(PolyList,Vars,FLAG){ |
|
TMP[I][0]=5$ |
TMP[I][0]=5$ |
else if(TMP[I][0]==4) |
else if(TMP[I][0]==4) |
TMP[I][0]=6$ |
TMP[I][0]=6$ |
|
else if(TMP[I][0]==-3) |
|
TMP[I][0]=-5$ |
|
else if(TMP[I][0]==-4) |
|
TMP[I][0]=-6$ |
|
|
} |
} |
|
|
TMP=map(vtol,TMP)$ |
TMP=map(vtol,TMP)$ |