=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/lib/primdec_mod,v retrieving revision 1.2 retrieving revision 1.11 diff -u -p -r1.2 -r1.11 --- OpenXM_contrib2/asir2000/lib/primdec_mod 2003/04/20 07:33:29 1.2 +++ OpenXM_contrib2/asir2000/lib/primdec_mod 2003/08/05 05:56:19 1.11 @@ -1,13 +1,16 @@ +/* $OpenXM: OpenXM_contrib2/asir2000/lib/primdec_mod,v 1.10 2003/05/07 06:26:51 noro Exp $ */ + extern Hom,GBTime$ extern DIVLIST,INTIDEAL,ORIGINAL,ORIGINALDIMENSION,STOP,Trials,REM$ extern T_GRF,T_INT,T_PD,T_MP$ extern BuchbergerMinipoly,PartialDecompByLex,ParallelMinipoly$ extern B_Win,D_Win$ 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 ; -FFF_LOADED_BY_PRIMDEC_MOD = 1$ +if(!LIBRARY_FFF_LOADED) load("fff"); else ; LIBRARY_FFF_LOADED = 1$ +if(!LIBRARY_GR_LOADED) load("gr"); else ; LIBRARY_GR_LOADED = 1$ /*==============================================*/ /* prime decomposition of ideals over */ @@ -133,7 +136,7 @@ def frobeniuskernel_main(P,VSet,WSet) XSet=append(VSet,WSet); NewOrder=[[0,length(VSet)],[0,length(WSet)]]; - Char=setmod_ff()[0]; + Char=characteristic_ff(); for (I=0;I by using minimal polynomails.*/ /* separableclosure outputs */ @@ -1315,19 +1337,24 @@ def zeroprimedecomposition(P,TargetVSet,VSet) if ( Sep[1] != 0 ) { - print("The ideal is inseparable. ",2); + if ( dp_gr_print() ) { + print("The ideal is inseparable. ",2); + } CHECK2=checkgeneric2(Sep[2]); } 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 ) { - print("The separable closure is of generic type. ",2); - print("So, the intermediate ideal is prime or primary. ",2); - + if ( dp_gr_print() ) { + 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]); if ( TargetVSet != VSet ) { @@ -1418,8 +1445,9 @@ def zeroseparableprimedecomposition(P,TargetVSet,VSet) /* Generic=[f, minimal polynomial of f in newt, newt], */ /* 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); X=Generic[2]; /* newly introduced variable */ @@ -1600,14 +1628,17 @@ def separableclosure(CP,TargetVSet,VSet) 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]; } - 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); - Char=setmod_ff()[0]; + Char=characteristic_ff(); NewP=CP[0]; EXPVECTOR=newvect(NVSet); @@ -1663,7 +1694,7 @@ def convertdivisor(P,TargetVSet,VSet,ExVector) NVSet=length(TargetVSet); WSet=makecounterpart(TargetVSet); - Char=setmod_ff()[0]; + Char=characteristic_ff(); Ord=0; NewP=P; @@ -1766,7 +1797,9 @@ def findgeneric(P,TargetVSet,VSet) } } #endif - print("Extend the ground field. ",2); + if ( dp_gr_print() ) { + print("Extend the ground field. ",2); + } error(); } @@ -2003,7 +2036,7 @@ def checkseparablepoly(P,V) def pdivide(F,V) { - Char=setmod_ff()[0]; + Char=characteristic_ff(); TestP=P; Deg=ideg(TestP,V); @@ -2051,14 +2084,19 @@ def convertsmallfield(PP,VSet,Ord) { dp_ord(Ord); NVSet=length(VSet); - Char=setmod_ff()[0]; - ExtDeg=deg(setmod_ff()[1],x); + Char=characteristic_ff(); + ExtDeg=extdeg_ff(); - NewV=pg; + NewV=pgpgpgpgpgpgpg; MPP=map(monic_hc,PP,VSet); 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); Ord1=[[0,1],[Ord,NVSet]]; @@ -2078,7 +2116,7 @@ def checkgaloisorbit(PP,VSet,Ord,Flag) { NPP=length(PP); TmpPP=PP; - ExtDeg=deg(setmod_ff()[1],x); + ExtDeg=extdeg_ff(); ANS=[]; BNS=[]; @@ -2166,7 +2204,7 @@ def partial_decomp(B,V) map(ox_cmo_rpc,ParallelMinipoly,"setmod_ff",characteristic_ff(),extdeg_ff()); map(ox_pop_cmo,ParallelMinipoly); } - B = map(ptosfp,B); + B = map(simp_ff,B); B = dp_gr_f_main(B,V,0,0); R = partial_decomp0(B,V,length(V)-1); if ( PartialDecompByLex ) { @@ -2339,7 +2377,7 @@ def minipoly_sf_by_buchberger(G,V,O,F,V0,Server) if ( Server ) ox_sync(0); Vc = cons(V0,setminus(vars(G),V)); - Gf = cons(ptosfp(V0-F),G); + Gf = cons(simp_ff(V0-F),G); Vf = append(V,Vc); Gelim = dp_gr_f_main(Gf,Vf,1,[[0,length(V)],[0,length(Vc)]]); for ( Gc = [], T = Gelim; T != []; T = cdr(T) ) { @@ -2374,19 +2412,19 @@ def minipoly_sf_0dim(G,V,O,F,V0,Server) for ( I = Len - 1, GI = []; I >= 0; I-- ) GI = cons(I,GI); 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); for ( I = 0; I < DIM; I++ ) UT[I] = [MB[I],dp_nf_f(GI,U*MB[I],PS,1)]; - T = dp_ptod(ptosfp(1),[V0]); - TT = dp_ptod(ptosfp(1),V); + T = dp_ptod(simp_ff(1),[V0]); + TT = dp_ptod(simp_ff(1),V); G = H = [[TT,T]]; for ( I = 1; ; I++ ) { if ( dp_gr_print() ) 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); H = cons([TT,T],H); L = dp_lnf_f([TT,T],G); @@ -2405,7 +2443,7 @@ def minipoly_sf_rat(G,V,F,V0) Vc = setminus(vars(G),V); Gf = cons(V0-F,G); 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) ) { Vt = setminus(vars(car(T)),Vc); if ( Vt == [V0] ) @@ -2788,7 +2826,7 @@ def henleq_gsl_sfrat(L,B,Vc,Eval) X = map(subst,X,V0,V0-E0); if ( zerovector(RESTA*X+RESTB) ) { if ( dp_gr_print() ) print("end",0); - return [X,ptosfp(1)]; + return [X,simp_ff(1)]; } else return 0; } else if ( COUNT == CCC ) { @@ -2851,7 +2889,7 @@ def henleq_gsl_sfrat_higher(L,B,Vc,Eval) X = map(mshift,X,Vc,E,-1); if ( zerovector(RESTA*X+RESTB) ) { if ( dp_gr_print() ) print("end",0); - return [X,ptosfp(1)]; + return [X,simp_ff(1)]; } else return 0; } else if ( COUNT == CCC ) { @@ -2961,7 +2999,7 @@ def polyvtoratv_higher(Vect,Vc,K) def polytorat_gcd(F,V,K) { if ( deg(F,V) < K ) - return [F,ptosfp(1)]; + return [F,simp_ff(1)]; F1 = Mod^(K*2); F2 = F; B1 = 0; B2 = 1; while ( 1 ) { @@ -2993,7 +3031,7 @@ def polytorat_gcd(F,V,K) def polytorat(F,V,Mat,K) { if ( deg(F,V) < K ) - return [F,ptosfp(1)]; + return [F,simp_ff(1)]; for ( I = 0; I < K; I++ ) for ( J = 0; J < K; J++ ) Mat[I][J] = coef(F,I+K-J); @@ -3015,7 +3053,7 @@ def polytorat_higher(F,V,K) { if ( K < 2 ) return 0; if ( homogeneous_deg(F) < K ) - return [F,ptosfp(1)]; + return [F,simp_ff(1)]; D = create_icpoly(V,K); C = extract_coef(D*F,V,K,2*K); Vc = vars(C); @@ -3120,7 +3158,7 @@ def ideal_uniq(L) /* sub procedure of welldec and norm R = append(R,[L[I]]); else { for (J = 0; J < length(R); J++) - if ( gb_comp(L[I],R[J]) ) + if ( gb_comp_old(L[I],R[J]) ) break; if ( J == length(R) ) R = append(R,[L[I]]); @@ -3136,7 +3174,7 @@ def ideal_uniq_by_first(L) /* sub procedure of welldec R = append(R,[L[I]]); else { 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; if ( J == length(R) ) R = append(R,[L[I]]); @@ -3197,7 +3235,7 @@ def gr_fctr_sf(FL,VL,Ord) for (TP = [],I = 0; I