version 1.14, 2001/11/19 01:40:05 |
version 1.16, 2002/09/03 08:12:25 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/lib/gr,v 1.13 2001/11/19 00:57:13 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/lib/gr,v 1.15 2002/06/12 08:19:04 noro Exp $ |
*/ |
*/ |
extern INIT_COUNT,ITOR_FAIL$ |
extern INIT_COUNT,ITOR_FAIL$ |
extern REMOTE_MATRIX,REMOTE_NF,REMOTE_VARS$ |
extern REMOTE_MATRIX,REMOTE_NF,REMOTE_VARS$ |
Line 128 def tolex(G0,V,O,W) |
|
Line 128 def tolex(G0,V,O,W) |
|
{ |
{ |
TM = TE = TNF = 0; |
TM = TE = TNF = 0; |
N = length(V); HM = hmlist(G0,V,O); ZD = zero_dim(HM,V,O); |
N = length(V); HM = hmlist(G0,V,O); ZD = zero_dim(HM,V,O); |
if ( !ZD ) |
if ( ZD ) |
error("tolex : ideal is not zero-dimensional!"); |
MB = dp_mbase(map(dp_ptod,HM,V)); |
MB = dp_mbase(map(dp_ptod,HM,V)); |
else |
|
MB = 0; |
for ( J = 0; ; J++ ) { |
for ( J = 0; ; J++ ) { |
M = lprime(J); |
M = lprime(J); |
if ( !valid_modulus(HM,M) ) |
if ( !valid_modulus(HM,M) ) |
continue; |
continue; |
T0 = time()[0]; GM = tolexm(G0,V,O,W,M); TM += time()[0] - T0; |
T0 = time()[0]; |
dp_ord(2); |
if ( ZD ) { |
DL = map(dp_etov,map(dp_ht,map(dp_ptod,GM,W))); |
GM = tolexm(G0,V,O,W,M); |
D = newvect(N); TL = []; |
dp_ord(2); |
do |
DL = map(dp_etov,map(dp_ht,map(dp_ptod,GM,W))); |
TL = cons(dp_dtop(dp_vtoe(D),W),TL); |
D = newvect(N); TL = []; |
while ( nextm(D,DL,N) ); |
do |
L = npos_check(DL); NPOSV = L[0]; DIM = L[1]; |
TL = cons(dp_dtop(dp_vtoe(D),W),TL); |
T0 = time()[0]; NF = gennf(G0,TL,V,O,W[N-1],1)[0]; |
while ( nextm(D,DL,N) ); |
|
} else { |
|
GM = dp_gr_mod_main(G0,W,0,M,2); |
|
dp_ord(2); |
|
for ( T = GM, S = 0; T != []; T = cdr(T) ) |
|
for ( D = dp_ptod(car(T),V); D; D = dp_rest(D) ) |
|
S += dp_ht(D); |
|
TL = dp_terms(S,V); |
|
} |
|
TM += time()[0] - T0; |
|
T0 = time()[0]; NF = gennf(G0,TL,V,O,W[N-1],ZD)[0]; |
TNF += time()[0] - T0; |
TNF += time()[0] - T0; |
T0 = time()[0]; |
T0 = time()[0]; |
R = tolex_main(V,O,NF,GM,M,MB); |
R = tolex_main(V,O,NF,GM,M,MB); |
Line 316 def dptov(P,W,MB) |
|
Line 327 def dptov(P,W,MB) |
|
|
|
def tolex_main(V,O,NF,GM,M,MB) |
def tolex_main(V,O,NF,GM,M,MB) |
{ |
{ |
DIM = length(MB); |
if ( MB ) { |
DV = newvect(DIM); |
PosDim = 0; |
|
DIM = length(MB); |
|
DV = newvect(DIM); |
|
} else |
|
PosDim = 1; |
for ( T = GM, SL = [], LCM = 1; T != []; T = cdr(T) ) { |
for ( T = GM, SL = [], LCM = 1; T != []; T = cdr(T) ) { |
S = p_terms(car(T),V,2); |
S = p_terms(car(T),V,2); |
|
if ( PosDim ) { |
|
MB = gather_nf_terms(S,NF,V,O); |
|
DV = newvect(length(MB)); |
|
} |
dp_ord(O); RHS = termstomat(NF,map(dp_ptod,cdr(S),V),MB,M); |
dp_ord(O); RHS = termstomat(NF,map(dp_ptod,cdr(S),V),MB,M); |
dp_ord(0); NHT = nf_tab_gsl(dp_ptod(LCM*car(S),V),NF); |
dp_ord(O); NHT = nf_tab_gsl(dp_ptod(LCM*car(S),V),NF); |
dptov(NHT[0],DV,MB); |
dptov(NHT[0],DV,MB); |
dp_ord(O); B = hen_ttob_gsl([DV,NHT[1]],RHS,cdr(S),M); |
dp_ord(O); B = hen_ttob_gsl([DV,NHT[1]],RHS,cdr(S),M); |
if ( !B ) |
if ( !B ) |
Line 338 def tolex_main(V,O,NF,GM,M,MB) |
|
Line 357 def tolex_main(V,O,NF,GM,M,MB) |
|
return SL; |
return SL; |
} |
} |
|
|
|
/* |
|
* NF = [Pairs,DN] |
|
* Pairs = [[NF1,T1],[NF2,T2],...] |
|
*/ |
|
|
|
def gather_nf_terms(S,NF,V,O) |
|
{ |
|
R = 0; |
|
for ( T = S; T != []; T = cdr(T) ) { |
|
DT = dp_ptod(car(T),V); |
|
for ( U = NF[0]; U != []; U = cdr(U) ) |
|
if ( car(U)[1] == DT ) { |
|
R += tpoly(dp_terms(car(U)[0],V)); |
|
break; |
|
} |
|
} |
|
return map(dp_ptod,p_terms(R,V,O),V); |
|
} |
|
|
def reduce_dn(L) |
def reduce_dn(L) |
{ |
{ |
NM = L[0]; DN = L[1]; V = vars(NM); |
NM = L[0]; DN = L[1]; V = vars(NM); |
Line 352 def minipoly(G0,V,O,P,V0) |
|
Line 390 def minipoly(G0,V,O,P,V0) |
|
if ( !zero_dim(hmlist(G0,V,O),V,O) ) |
if ( !zero_dim(hmlist(G0,V,O),V,O) ) |
error("tolex : ideal is not zero-dimensional!"); |
error("tolex : ideal is not zero-dimensional!"); |
|
|
|
Pin = P; |
|
P = ptozp(P); |
|
CP = sdiv(P,Pin); |
G1 = cons(V0-P,G0); |
G1 = cons(V0-P,G0); |
O1 = [[0,1],[O,length(V)]]; |
O1 = [[0,1],[O,length(V)]]; |
V1 = cons(V0,V); |
V1 = cons(V0,V); |
Line 372 def minipoly(G0,V,O,P,V0) |
|
Line 413 def minipoly(G0,V,O,P,V0) |
|
TL = cons(V0^J,TL); |
TL = cons(V0^J,TL); |
NF = gennf(G1,TL,V1,O1,V0,1)[0]; |
NF = gennf(G1,TL,V1,O1,V0,1)[0]; |
R = tolex_main(V1,O1,NF,[MP],M,MB); |
R = tolex_main(V1,O1,NF,[MP],M,MB); |
return R[0]; |
return ptozp(subst(R[0],V0,CP*V0)); |
} |
} |
} |
} |
|
|
Line 461 def vtop(S,L,GSL) |
|
Line 502 def vtop(S,L,GSL) |
|
return ptozp(A); |
return ptozp(A); |
} |
} |
} |
} |
|
|
|
/* broken */ |
|
|
def leq_nf(TL,NF,LHS,V) |
def leq_nf(TL,NF,LHS,V) |
{ |
{ |