[BACK]Return to weight CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / lib

Diff for /OpenXM_contrib2/asir2000/lib/weight between version 1.12 and 1.17

version 1.12, 2003/12/08 07:18:14 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 249  def roundret(V){
Line 250  def roundret(V){
         VN=size(V)[0]$          VN=size(V)[0]$
   
         RET0=V$          RET0=V$
         for(I=2;I<1000;I++){          for(I=1;I<1000;I++){
                 RET1=I*RET0$                  RET1=I*RET0$
                 for(J=0;J<VN;J++){                  for(J=0;J<VN;J++){
                         X=drint(RET1[J])$                          X=drint(RET1[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]*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 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))$

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.17

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>