version 1.2, 2003/04/20 07:33:29 |
version 1.9, 2003/04/24 07:54:15 |
|
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/lib/primdec_mod,v 1.8 2003/04/21 02:02:16 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=[]; |