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

Diff for /OpenXM_contrib2/asir2000/lib/primdec_mod between version 1.2 and 1.11

version 1.2, 2003/04/20 07:33:29 version 1.11, 2003/08/05 05:56:19
Line 1 
Line 1 
   /* $OpenXM: OpenXM_contrib2/asir2000/lib/primdec_mod,v 1.10 2003/05/07 06:26:51 noro Exp $ */
   
 extern Hom,GBTime$  extern Hom,GBTime$
 extern DIVLIST,INTIDEAL,ORIGINAL,ORIGINALDIMENSION,STOP,Trials,REM$  extern DIVLIST,INTIDEAL,ORIGINAL,ORIGINALDIMENSION,STOP,Trials,REM$
 extern T_GRF,T_INT,T_PD,T_MP$  extern T_GRF,T_INT,T_PD,T_MP$
 extern BuchbergerMinipoly,PartialDecompByLex,ParallelMinipoly$  extern BuchbergerMinipoly,PartialDecompByLex,ParallelMinipoly$
 extern B_Win,D_Win$  extern B_Win,D_Win$
 extern COMMONCHECK_SF,CID_SF$  extern COMMONCHECK_SF,CID_SF$
 extern FFF_LOADED_BY_PRIMDEC_MOD$  extern LIBRARY_GR_LOADED$
   extern LIBRARY_FFF_LOADED$
   
 if(FFF_LOADED_BY_PRIMDEC_MOD) load("fff"); else ;  if(!LIBRARY_FFF_LOADED) load("fff"); else ; LIBRARY_FFF_LOADED = 1$
 FFF_LOADED_BY_PRIMDEC_MOD = 1$  if(!LIBRARY_GR_LOADED) load("gr"); else ; LIBRARY_GR_LOADED = 1$
   
 /*==============================================*/  /*==============================================*/
 /*  prime decomposition of ideals over          */  /*  prime decomposition of ideals over          */
Line 133  def frobeniuskernel_main(P,VSet,WSet)
Line 136  def frobeniuskernel_main(P,VSet,WSet)
         XSet=append(VSet,WSet);          XSet=append(VSet,WSet);
         NewOrder=[[0,length(VSet)],[0,length(WSet)]];          NewOrder=[[0,length(VSet)],[0,length(WSet)]];
   
         Char=setmod_ff()[0];          Char=characteristic_ff();
   
         for (I=0;I<NV;I++)          for (I=0;I<NV;I++)
                 {                  {
Line 167  def frobeniuskernel_main2(P,VSet,WSet)
Line 170  def frobeniuskernel_main2(P,VSet,WSet)
         XSet=append(VSet,WSet);          XSet=append(VSet,WSet);
         NewOrder=[[0,NV],[0,NV]];          NewOrder=[[0,NV],[0,NV]];
   
         Char=setmod_ff()[0];          Char=characteristic_ff();
   
         for (I=0;I<NV;I++)          for (I=0;I<NV;I++)
                 {                  {
Line 215  def frobeniuskernel_main4(P,VSet,WSet)
Line 218  def frobeniuskernel_main4(P,VSet,WSet)
         XSet=append(VSet,WSet);          XSet=append(VSet,WSet);
         NewOrder=[[0,NV],[0,NV]];          NewOrder=[[0,NV],[0,NV]];
   
         Char=setmod_ff()[0];          Char=characteristic_ff();
   
         for (I=0;I<NV;I++)          for (I=0;I<NV;I++)
                 {                  {
Line 278  def frobeniuskernel_main3(P,VSet,WSet)
Line 281  def frobeniuskernel_main3(P,VSet,WSet)
   
         NewP=coefficientfrobeniuskernel(P);          NewP=coefficientfrobeniuskernel(P);
   
         Char=setmod_ff()[0];          Char=characteristic_ff();
   
         for (I=0;I<NV;I++)          for (I=0;I<NV;I++)
                 {                  {
Line 341  def coefficientfrobeniuskernel_main(Poly)
Line 344  def coefficientfrobeniuskernel_main(Poly)
         Vars=vars(Poly);          Vars=vars(Poly);
         QP=dp_ptod(Poly,Vars);          QP=dp_ptod(Poly,Vars);
         ANS=0;          ANS=0;
         FOrd=deg(setmod_ff()[1],x);          FOrd=extdeg_ff();
         Char=setmod_ff()[0];          Char=characteristic_ff();
         Pow=Char^(FOrd-1);          Pow=Char^(FOrd-1);
   
         while(QP !=0 )          while(QP !=0 )
Line 925  def primedec_sf(P,VSet,Ord,Strategy)
Line 928  def primedec_sf(P,VSet,Ord,Strategy)
                 REM[I]=[];                  REM[I]=[];
                 }                  }
   
         print("The dimension of the ideal is ",2);print(ORIGINALDIMENSION,2);          if ( dp_gr_print() ) {
         print(". ");                  print("The dimension of the ideal is ",2);print(ORIGINALDIMENSION,2);
                   print(". ");
           }
   
         if ( ORIGINALDIMENSION == 0 )          if ( ORIGINALDIMENSION == 0 )
                 {                  {
Line 936  def primedec_sf(P,VSet,Ord,Strategy)
Line 941  def primedec_sf(P,VSet,Ord,Strategy)
   
         ANS=gr_fctr_sf([ORIGINAL],VSet,Ord);          ANS=gr_fctr_sf([ORIGINAL],VSet,Ord);
         NANS=length(ANS);          NANS=length(ANS);
         print("There are ",2);print(NANS,2);print(" partial components. ");          if ( dp_gr_print() ) {
                   print("There are ",2);print(NANS,2);print(" partial components. ");
       }
         for (I=0;I<NANS;I++)          for (I=0;I<NANS;I++)
                 {                  {
                 TempI=ANS[I];                  TempI=ANS[I];
Line 962  def primedec_sf(P,VSet,Ord,Strategy)
Line 968  def primedec_sf(P,VSet,Ord,Strategy)
                         {                          {
                         DIVLIST = prime_irred_sf_by_first(DIVLIST,VSet,0);                          DIVLIST = prime_irred_sf_by_first(DIVLIST,VSet,0);
                         DIVLIST = monic_sf_first(DIVLIST,VSet);                          DIVLIST = monic_sf_first(DIVLIST,VSet);
                         print("We finish the computation. ");                          if ( dp_gr_print() ) {
                         T_TOTAL = time()[3]-T0[3];                                  print("We finish the computation. ");
                         print(["T_TOTAL",T_TOTAL,"T_GRF",T_GRF,"T_PD",T_PD,"T_MP",T_MP,"T_INT",T_INT,"B_Win",B_Win,"D_Win",D_Win]);                                  T_TOTAL = time()[3]-T0[3];
                                   print(["T_TOTAL",T_TOTAL,"T_GRF",T_GRF,"T_PD",T_PD,"T_MP",T_MP,"T_INT",T_INT,"B_Win",B_Win,"D_Win",D_Win]);
                           }
                         return 0;                          return 0;
                         }                          }
   
Line 974  def primedec_sf(P,VSet,Ord,Strategy)
Line 982  def primedec_sf(P,VSet,Ord,Strategy)
         DIVLIST = prime_irred_sf_by_first(DIVLIST,VSet,0);          DIVLIST = prime_irred_sf_by_first(DIVLIST,VSet,0);
         DIVLIST = monic_sf_first(DIVLIST,VSet);          DIVLIST = monic_sf_first(DIVLIST,VSet);
         T_TOTAL = time()[3]-T0[3];          T_TOTAL = time()[3]-T0[3];
         print(["T_TOTAL",T_TOTAL,"T_GRF",T_GRF,"T_PD",T_PD,"T_MP",T_MP,"T_INT",T_INT,"B_Win",B_Win,"D_Win",D_Win]);          if ( dp_gr_print() ) {
                   print(["T_TOTAL",T_TOTAL,"T_GRF",T_GRF,"T_PD",T_PD,"T_MP",T_MP,"T_INT",T_INT,"B_Win",B_Win,"D_Win",D_Win]);
           }
         return 0;          return 0;
         }          }
   
Line 1112  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
Line 1122  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
         Dimension=Dimeset[0];          Dimension=Dimeset[0];
         MSI=Dimeset[1];          MSI=Dimeset[1];
   
         print("The dimension of the ideal is ",2); print(Dimension,2);          if ( dp_gr_print() ) {
         print(".");                  print("The dimension of the ideal is ",2); print(Dimension,2);
                   print(".");
           }
         TargetVSet=setminus(VSet,MSI);          TargetVSet=setminus(VSet,MSI);
         NewGP=dp_gr_f_main(GP,TargetVSet,Hom,Ord);          NewGP=dp_gr_f_main(GP,TargetVSet,Hom,Ord);
   
Line 1125  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
Line 1136  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
   
         /* Then the ideal is 0-dimension in K[TargetVSet].      */          /* Then the ideal is 0-dimension in K[TargetVSet].      */
   
         print("We enter Zero-dimension Prime Decomposition. ",2);          if ( dp_gr_print() ) {
                   print("We enter Zero-dimension Prime Decomposition. ",2);
           }
   
         QP=zeroprimedecomposition(NewGP,TargetVSet,VSet);          QP=zeroprimedecomposition(NewGP,TargetVSet,VSet);
   
         ANS=[];          ANS=[];
         NQP=length(QP);          NQP=length(QP);
   
         print("The number of the newly found component is ",2);          if ( dp_gr_print() ) {
         print(NQP,2);print(". ",2);                  print("The number of the newly found component is ",2);
                   print(NQP,2);print(". ",2);
           }
         for (I=0;I<NQP;I++)          for (I=0;I<NQP;I++)
                 {                  {
                 ZPrimeideal=QP[I];                  ZPrimeideal=QP[I];
Line 1172  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
Line 1186  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
   
                 if (CHECK==1)                  if (CHECK==1)
                         {                          {
                         print("We already obtain all divisor. ");                          if ( dp_gr_print() ) {
                                   print("We already obtain all divisor. ");
                           }
                         STOP = 1;                          STOP = 1;
                         return 0;                          return 0;
                         }                          }
Line 1204  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
Line 1220  def primedecomposition(P,VSet,Ord,COUNTER,Strategy)
   
                         if ( CHECKADD != 0 )                          if ( CHECKADD != 0 )
                                 {                                  {
                                 print("Avoid unnecessary computation. ",2);                                  if ( dp_gr_print() ) {
                                           print("Avoid unnecessary computation. ",2);
                                   }
                                 continue;                                  continue;
                                 }                                  }
                         }                          }
Line 1295  def zeroprimedecomposition(P,TargetVSet,VSet)
Line 1313  def zeroprimedecomposition(P,TargetVSet,VSet)
   
                         ZDecomp=[PDiv];                          ZDecomp=[PDiv];
   
                         print("An intermediate ideal is of generic type. ");                          if ( dp_gr_print() ) {
                                   print("An intermediate ideal is of generic type. ");
                         }                          }
                           }
                 else                  else
                         {                          {
                         print("An intermediate ideal is not of generic type. ",2);                          if ( dp_gr_print() ) {
                                   print("An intermediate ideal is not of generic type. ",2);
                           }
   
                         /* We compute the separable closure of <P> by using minimal polynomails.*/                          /* We compute the separable closure of <P> by using minimal polynomails.*/
                         /* separableclosure outputs                                             */                          /* separableclosure outputs                                             */
Line 1315  def zeroprimedecomposition(P,TargetVSet,VSet)
Line 1337  def zeroprimedecomposition(P,TargetVSet,VSet)
   
                         if ( Sep[1] != 0 )                          if ( Sep[1] != 0 )
                                 {                                  {
                                 print("The ideal is inseparable. ",2);                                  if ( dp_gr_print() ) {
                                           print("The ideal is inseparable. ",2);
                                   }
                                 CHECK2=checkgeneric2(Sep[2]);                                  CHECK2=checkgeneric2(Sep[2]);
                                 }                                  }
                         else                          else
                                 {                                  {
                                 print("The ideal is already separable. ",2);                                  if ( dp_gr_print() ) {
                                           print("The ideal is already separable. ",2);
                                   }
                                 }                                  }
   
                         if ( Sep[1] !=0 && CHECK2 == 1 )                          if ( Sep[1] !=0 && CHECK2 == 1 )
                                 {                                  {
                                 print("The separable closure is of generic type. ",2);                                  if ( dp_gr_print() ) {
                                 print("So, the intermediate ideal is prime or primary. ",2);                                          print("The separable closure is of generic type. ",2);
                                           print("So, the intermediate ideal is prime or primary. ",2);
                                   }
                                 PDiv=convertdivisor(Sep[0],TargetVSet,VSet,Sep[1]);                                  PDiv=convertdivisor(Sep[0],TargetVSet,VSet,Sep[1]);
                                 if ( TargetVSet != VSet )                                  if ( TargetVSet != VSet )
                                         {                                          {
Line 1418  def zeroseparableprimedecomposition(P,TargetVSet,VSet)
Line 1445  def zeroseparableprimedecomposition(P,TargetVSet,VSet)
         /* Generic=[f, minimal polynomial of f in newt, newt],  */          /* Generic=[f, minimal polynomial of f in newt, newt],  */
         /* where newt (X) is a newly introduced variable.       */          /* where newt (X) is a newly introduced variable.       */
   
         print("We search for a linear sum of variables in generic position. ",2);          if ( dp_gr_print() ) {
                   print("We search for a linear sum of variables in generic position. ",2);
           }
         Generic=findgeneric(NewGP,TargetVSet,VSet);          Generic=findgeneric(NewGP,TargetVSet,VSet);
   
         X=Generic[2]; /* newly introduced variable              */          X=Generic[2]; /* newly introduced variable              */
Line 1600  def separableclosure(CP,TargetVSet,VSet)
Line 1628  def separableclosure(CP,TargetVSet,VSet)
   
         if ( CHECK == 1 )          if ( CHECK == 1 )
                 {                  {
                 print("This is already a separable ideal.", 2);                  if ( dp_gr_print() ) {
                           print("This is already a separable ideal.", 2);
                   }
                 return [CP[0],0];                  return [CP[0],0];
                 }                  }
   
         print("This is not a separable ideal, so we make its separable closure.", 2);          if ( dp_gr_print() ) {
                   print("This is not a separable ideal, so we make its separable closure.", 2);
           }
         WSet=makecounterpart(TargetVSet);          WSet=makecounterpart(TargetVSet);
         Char=setmod_ff()[0];          Char=characteristic_ff();
   
         NewP=CP[0];          NewP=CP[0];
         EXPVECTOR=newvect(NVSet);          EXPVECTOR=newvect(NVSet);
Line 1663  def convertdivisor(P,TargetVSet,VSet,ExVector)
Line 1694  def convertdivisor(P,TargetVSet,VSet,ExVector)
   
         NVSet=length(TargetVSet);          NVSet=length(TargetVSet);
         WSet=makecounterpart(TargetVSet);          WSet=makecounterpart(TargetVSet);
         Char=setmod_ff()[0];          Char=characteristic_ff();
         Ord=0;          Ord=0;
   
         NewP=P;          NewP=P;
Line 1766  def findgeneric(P,TargetVSet,VSet)
Line 1797  def findgeneric(P,TargetVSet,VSet)
                 }                  }
         }          }
 #endif  #endif
         print("Extend the ground field. ",2);          if ( dp_gr_print() ) {
                   print("Extend the ground field. ",2);
           }
         error();          error();
         }          }
   
Line 2003  def checkseparablepoly(P,V)
Line 2036  def checkseparablepoly(P,V)
   
 def pdivide(F,V)  def pdivide(F,V)
         {          {
         Char=setmod_ff()[0];          Char=characteristic_ff();
         TestP=P;          TestP=P;
   
         Deg=ideg(TestP,V);          Deg=ideg(TestP,V);
Line 2051  def convertsmallfield(PP,VSet,Ord)
Line 2084  def convertsmallfield(PP,VSet,Ord)
         {          {
         dp_ord(Ord);          dp_ord(Ord);
         NVSet=length(VSet);          NVSet=length(VSet);
         Char=setmod_ff()[0];          Char=characteristic_ff();
         ExtDeg=deg(setmod_ff()[1],x);          ExtDeg=extdeg_ff();
   
         NewV=pg;          NewV=pgpgpgpgpgpgpg;
         MPP=map(monic_hc,PP,VSet);          MPP=map(monic_hc,PP,VSet);
         MPP=map(sfptopsfp,MPP,NewV);          MPP=map(sfptopsfp,MPP,NewV);
   
         MinPoly=subst(setmod_ff()[1],x,NewV);          DefPoly=setmod_ff()[1];
           /* GF(p) case */
           if ( !DefPoly )
                   return MPP;
   
           MinPoly=subst(DefPoly,var(DefPoly),NewV);
         XSet=cons(NewV,VSet);          XSet=cons(NewV,VSet);
   
         Ord1=[[0,1],[Ord,NVSet]];          Ord1=[[0,1],[Ord,NVSet]];
Line 2078  def checkgaloisorbit(PP,VSet,Ord,Flag)
Line 2116  def checkgaloisorbit(PP,VSet,Ord,Flag)
         {          {
         NPP=length(PP);          NPP=length(PP);
         TmpPP=PP;          TmpPP=PP;
         ExtDeg=deg(setmod_ff()[1],x);          ExtDeg=extdeg_ff();
   
         ANS=[];          ANS=[];
         BNS=[];          BNS=[];
Line 2166  def partial_decomp(B,V)
Line 2204  def partial_decomp(B,V)
                 map(ox_cmo_rpc,ParallelMinipoly,"setmod_ff",characteristic_ff(),extdeg_ff());                  map(ox_cmo_rpc,ParallelMinipoly,"setmod_ff",characteristic_ff(),extdeg_ff());
                 map(ox_pop_cmo,ParallelMinipoly);                  map(ox_pop_cmo,ParallelMinipoly);
         }          }
         B = map(ptosfp,B);          B = map(simp_ff,B);
         B = dp_gr_f_main(B,V,0,0);          B = dp_gr_f_main(B,V,0,0);
         R = partial_decomp0(B,V,length(V)-1);          R = partial_decomp0(B,V,length(V)-1);
         if ( PartialDecompByLex ) {          if ( PartialDecompByLex ) {
Line 2339  def minipoly_sf_by_buchberger(G,V,O,F,V0,Server)
Line 2377  def minipoly_sf_by_buchberger(G,V,O,F,V0,Server)
         if ( Server )          if ( Server )
                 ox_sync(0);                  ox_sync(0);
         Vc = cons(V0,setminus(vars(G),V));          Vc = cons(V0,setminus(vars(G),V));
         Gf = cons(ptosfp(V0-F),G);          Gf = cons(simp_ff(V0-F),G);
         Vf = append(V,Vc);          Vf = append(V,Vc);
         Gelim = dp_gr_f_main(Gf,Vf,1,[[0,length(V)],[0,length(Vc)]]);          Gelim = dp_gr_f_main(Gf,Vf,1,[[0,length(V)],[0,length(Vc)]]);
         for ( Gc = [], T = Gelim; T != []; T = cdr(T) ) {          for ( Gc = [], T = Gelim; T != []; T = cdr(T) ) {
Line 2374  def minipoly_sf_0dim(G,V,O,F,V0,Server)
Line 2412  def minipoly_sf_0dim(G,V,O,F,V0,Server)
         for ( I = Len - 1, GI = []; I >= 0; I-- )          for ( I = Len - 1, GI = []; I >= 0; I-- )
                 GI = cons(I,GI);                  GI = cons(I,GI);
         MB = dp_mbase(HL); DIM = length(MB); UT = newvect(DIM);          MB = dp_mbase(HL); DIM = length(MB); UT = newvect(DIM);
         U = dp_ptod(ptosfp(F),V);          U = dp_ptod(simp_ff(F),V);
         U = dp_nf_f(GI,U,PS,1);          U = dp_nf_f(GI,U,PS,1);
         for ( I = 0; I < DIM; I++ )          for ( I = 0; I < DIM; I++ )
                 UT[I] = [MB[I],dp_nf_f(GI,U*MB[I],PS,1)];                  UT[I] = [MB[I],dp_nf_f(GI,U*MB[I],PS,1)];
   
         T = dp_ptod(ptosfp(1),[V0]);          T = dp_ptod(simp_ff(1),[V0]);
         TT = dp_ptod(ptosfp(1),V);          TT = dp_ptod(simp_ff(1),V);
         G = H = [[TT,T]];          G = H = [[TT,T]];
   
         for ( I = 1; ; I++ ) {          for ( I = 1; ; I++ ) {
                 if ( dp_gr_print() )                  if ( dp_gr_print() )
                         print(".",2);                          print(".",2);
                 T = dp_ptod(ptosfp(V0^I),[V0]);                  T = dp_ptod(simp_ff(V0^I),[V0]);
                 TT = dp_nf_tab_f(H[0][0],UT);                  TT = dp_nf_tab_f(H[0][0],UT);
                 H = cons([TT,T],H);                  H = cons([TT,T],H);
                 L = dp_lnf_f([TT,T],G);                  L = dp_lnf_f([TT,T],G);
Line 2405  def minipoly_sf_rat(G,V,F,V0)
Line 2443  def minipoly_sf_rat(G,V,F,V0)
         Vc = setminus(vars(G),V);          Vc = setminus(vars(G),V);
         Gf = cons(V0-F,G);          Gf = cons(V0-F,G);
         Vf = append(V,[V0]);          Vf = append(V,[V0]);
         G3 = dp_gr_f_main(map(ptosfp,Gf),Vf,0,3);          G3 = dp_gr_f_main(map(simp_ff,Gf),Vf,0,3);
         for ( T = G3; T != []; T = cdr(T) ) {          for ( T = G3; T != []; T = cdr(T) ) {
                 Vt = setminus(vars(car(T)),Vc);                  Vt = setminus(vars(car(T)),Vc);
                 if ( Vt == [V0] )                  if ( Vt == [V0] )
Line 2788  def henleq_gsl_sfrat(L,B,Vc,Eval)
Line 2826  def henleq_gsl_sfrat(L,B,Vc,Eval)
                         X = map(subst,X,V0,V0-E0);                          X = map(subst,X,V0,V0-E0);
                         if ( zerovector(RESTA*X+RESTB) ) {                          if ( zerovector(RESTA*X+RESTB) ) {
                                 if ( dp_gr_print() ) print("end",0);                                  if ( dp_gr_print() ) print("end",0);
                                 return [X,ptosfp(1)];                                  return [X,simp_ff(1)];
                         } else                          } else
                                 return 0;                                  return 0;
                 } else if ( COUNT == CCC ) {                  } else if ( COUNT == CCC ) {
Line 2851  def henleq_gsl_sfrat_higher(L,B,Vc,Eval)
Line 2889  def henleq_gsl_sfrat_higher(L,B,Vc,Eval)
                         X = map(mshift,X,Vc,E,-1);                          X = map(mshift,X,Vc,E,-1);
                         if ( zerovector(RESTA*X+RESTB) ) {                          if ( zerovector(RESTA*X+RESTB) ) {
                                 if ( dp_gr_print() ) print("end",0);                                  if ( dp_gr_print() ) print("end",0);
                                 return [X,ptosfp(1)];                                  return [X,simp_ff(1)];
                         } else                          } else
                                 return 0;                                  return 0;
                 } else if ( COUNT == CCC ) {                  } else if ( COUNT == CCC ) {
Line 2961  def polyvtoratv_higher(Vect,Vc,K)
Line 2999  def polyvtoratv_higher(Vect,Vc,K)
 def polytorat_gcd(F,V,K)  def polytorat_gcd(F,V,K)
 {  {
         if ( deg(F,V) < K )          if ( deg(F,V) < K )
                 return [F,ptosfp(1)];                  return [F,simp_ff(1)];
         F1 = Mod^(K*2); F2 = F;          F1 = Mod^(K*2); F2 = F;
         B1 = 0; B2 = 1;          B1 = 0; B2 = 1;
         while ( 1 ) {          while ( 1 ) {
Line 2993  def polytorat_gcd(F,V,K)
Line 3031  def polytorat_gcd(F,V,K)
 def polytorat(F,V,Mat,K)  def polytorat(F,V,Mat,K)
 {  {
         if ( deg(F,V) < K )          if ( deg(F,V) < K )
                 return [F,ptosfp(1)];                  return [F,simp_ff(1)];
         for ( I = 0; I < K; I++ )          for ( I = 0; I < K; I++ )
                 for ( J = 0; J < K; J++ )                  for ( J = 0; J < K; J++ )
                         Mat[I][J] = coef(F,I+K-J);                          Mat[I][J] = coef(F,I+K-J);
Line 3015  def polytorat_higher(F,V,K)
Line 3053  def polytorat_higher(F,V,K)
 {  {
         if ( K < 2 ) return 0;          if ( K < 2 ) return 0;
         if ( homogeneous_deg(F) < K )          if ( homogeneous_deg(F) < K )
                 return [F,ptosfp(1)];                  return [F,simp_ff(1)];
         D = create_icpoly(V,K);          D = create_icpoly(V,K);
         C = extract_coef(D*F,V,K,2*K);          C = extract_coef(D*F,V,K,2*K);
         Vc = vars(C);          Vc = vars(C);
Line 3120  def ideal_uniq(L) /* sub procedure of welldec and norm
Line 3158  def ideal_uniq(L) /* sub procedure of welldec and norm
                         R = append(R,[L[I]]);                          R = append(R,[L[I]]);
                 else {                  else {
                         for (J = 0; J < length(R); J++)                          for (J = 0; J < length(R); J++)
                                 if ( gb_comp(L[I],R[J]) )                                  if ( gb_comp_old(L[I],R[J]) )
                                         break;                                          break;
                         if ( J == length(R) )                          if ( J == length(R) )
                                 R = append(R,[L[I]]);                                  R = append(R,[L[I]]);
Line 3136  def ideal_uniq_by_first(L) /* sub procedure of welldec
Line 3174  def ideal_uniq_by_first(L) /* sub procedure of welldec
                         R = append(R,[L[I]]);                          R = append(R,[L[I]]);
                 else {                  else {
                         for (J = 0; J < length(R); J++)                          for (J = 0; J < length(R); J++)
                                 if ( gb_comp(L[I][0],R[J][0]) )                                  if ( gb_comp_old(L[I][0],R[J][0]) )
                                         break;                                          break;
                         if ( J == length(R) )                          if ( J == length(R) )
                                 R = append(R,[L[I]]);                                  R = append(R,[L[I]]);
Line 3197  def gr_fctr_sf(FL,VL,Ord)
Line 3235  def gr_fctr_sf(FL,VL,Ord)
         for (TP = [],I = 0; I<length(FL); I++ ) {          for (TP = [],I = 0; I<length(FL); I++ ) {
                 F = FL[I];                  F = FL[I];
                 SF = idealsqfr_sf(F);                  SF = idealsqfr_sf(F);
                 if ( !gb_comp(F,SF) )                  if ( !gb_comp_old(F,SF) )
                         F = dp_gr_f_main(SF,VL,0,Ord);                          F = dp_gr_f_main(SF,VL,0,Ord);
                 CID_SF=[1];                  CID_SF=[1];
                 SP = gr_fctr_sub_sf(F,VL,Ord);                  SP = gr_fctr_sub_sf(F,VL,Ord);
Line 3221  def gr_fctr_sub_sf(G,VL,Ord)
Line 3259  def gr_fctr_sub_sf(G,VL,Ord)
                                 W = cons(FL[J][0],G);                                  W = cons(FL[J][0],G);
                                 NG = dp_gr_f_main(W,VL,0,Ord);                                  NG = dp_gr_f_main(W,VL,0,Ord);
                                 TNG = idealsqfr_sf(NG);                                  TNG = idealsqfr_sf(NG);
                                 if ( !gb_comp(NG,TNG) )                                  if ( !gb_comp_old(NG,TNG) )
                                         NG = dp_gr_f_main(TNG,VL,0,Ord);                                          NG = dp_gr_f_main(TNG,VL,0,Ord);
                                 if ( !inclusion_test(CID_SF,NG,VL,Ord) ) {                                  if ( !inclusion_test(CID_SF,NG,VL,Ord) ) {
                                         DG = gr_fctr_sub_sf(NG,VL,Ord);                                          DG = gr_fctr_sub_sf(NG,VL,Ord);
Line 3239  def gr_fctr_sub_sf(G,VL,Ord)
Line 3277  def gr_fctr_sub_sf(G,VL,Ord)
         if (I == length(G))          if (I == length(G))
                 RL = append([G],RL);                  RL = append([G],RL);
         return RL;          return RL;
   }
   
   def gb_comp_old(A,B)
   {
           LA = length(A);
           LB = length(B);
           if ( LA != LB )
                   return 0;
           A = newvect(LA,A);
           B = newvect(LB,B);
           A1 = qsort(A);
           B1 = qsort(B);
           for ( I = 0; I < LA; I++ )
                   if ( A1[I] != B1[I] && A1[I] != -B1[I] )
                           break;
           return I == LA ? 1 : 0;
 }  }
 end$  end$

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.11

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