version 1.13, 2010/06/16 08:57:40 |
version 1.20, 2014/09/05 11:55:19 |
|
|
|
/* $OpenXM: OpenXM/src/asir-contrib/testing/noro/ndbf.rr,v 1.19 2011/03/30 05:07:01 noro Exp $ */ |
/* requires 'primdec' */ |
/* requires 'primdec' */ |
|
|
#define TMP_H hhhhhhhh |
#define TMP_H hhhhhhhh |
#define TMP_S ssssssss |
#define TMP_S ssssssss |
#define TMP_DS dssssssss |
#define TMP_DS dssssssss |
#define TMP_T t |
#define TMP_T tttttttt |
#define TMP_DT dt |
#define TMP_DT dtttttttt |
#define TMP_Y1 yyyyyyyy1 |
#define TMP_Y1 yyyyyyyy1 |
#define TMP_DY1 dyyyyyyyy1 |
#define TMP_DY1 dyyyyyyyy1 |
#define TMP_Y2 yyyyyyyy2 |
#define TMP_Y2 yyyyyyyy2 |
Line 30 localf weyl_nf_quo, weyl_nf_mod, b_subst, v_factorial, |
|
Line 31 localf weyl_nf_quo, weyl_nf_mod, b_subst, v_factorial, |
|
localf replace_vars_f, replace_vars_v, replace_var$ |
localf replace_vars_f, replace_vars_v, replace_var$ |
localf action_on_gfs, action_on_gfs_1$ |
localf action_on_gfs, action_on_gfs_1$ |
localf nd_gb_candidate$ |
localf nd_gb_candidate$ |
localf in_gb_oaku$ |
localf in_gb_oaku, homogenize_oaku$ |
|
|
/* stratification */ |
/* stratification */ |
|
|
Line 44 localf ideal_intersection$ |
|
Line 45 localf ideal_intersection$ |
|
|
|
def bfunction(F) |
def bfunction(F) |
{ |
{ |
|
if ( member(s,vars(F)) ) |
|
error("ann : the variable 's' is reserved."); |
/* F -> F/Fcont */ |
/* F -> F/Fcont */ |
F1 = ptozp(F); Fcont = sdiv(F,F1); F = F1; |
F1 = ptozp(F); Fcont = sdiv(F,F1); F = F1; |
|
|
|
|
if ( type(Vord) != 4 ) { |
if ( type(Vord) != 4 ) { |
for ( I = 0; I < N; I++ ) |
for ( I = 0; I < N; I++ ) |
D[I] = [deg(F,V[I]),V[I]]; |
D[I] = [deg(F,V[I]),V[I]]; |
qsort(D,compare_first); |
qsort(D,ndbf.compare_first); |
for ( V = [], I = 0; I < N; I++ ) |
for ( V = [], I = 0; I < N; I++ ) |
V = cons(D[I][1],V); |
V = cons(D[I][1],V); |
V = reverse(V); |
V = reverse(V); |
|
|
} |
} |
for ( I = 0; I < N; I++ ) |
for ( I = 0; I < N; I++ ) |
D[I] = [deg(F1,V[I]),V[I]]; |
D[I] = [deg(F1,V[I]),V[I]]; |
qsort(D,compare_first); |
qsort(D,ndbf.compare_first); |
for ( V = [], I = 0; I < N; I++ ) |
for ( V = [], I = 0; I < N; I++ ) |
V = cons(D[I][1],V); |
V = cons(D[I][1],V); |
V = reverse(V); |
V = reverse(V); |
|
|
{ |
{ |
if ( member(s,vars(F)) ) |
if ( member(s,vars(F)) ) |
error("ann : the variable 's' is reserved."); |
error("ann : the variable 's' is reserved."); |
|
if ( type(Vord=getopt(vord)) == -1 ) Vord = 0; |
F = ptozp(F); |
F = ptozp(F); |
V = vars(F); |
V = vars(F); |
|
if ( Vord ) { |
|
Param = setminus(V,Vord); |
|
V = Vord; |
|
} |
N = length(V); |
N = length(V); |
D = newvect(N); |
D = newvect(N); |
if ( type(Wt=getopt(weight)) == -1 ) |
if ( type(Wt=getopt(weight)) == -1 ) |
|
|
F1 = subst(F1,VI,VI^WI); |
F1 = subst(F1,VI,VI^WI); |
} |
} |
for ( I = 0; I < N; I++ ) D[I] = [deg(F1,V[I]),V[I]]; |
for ( I = 0; I < N; I++ ) D[I] = [deg(F1,V[I]),V[I]]; |
qsort(D,compare_first); |
qsort(D,ndbf.compare_first); |
for ( V = [], I = 0; I < N; I++ ) V = cons(D[I][1],V); |
for ( V = [], I = 0; I < N; I++ ) V = cons(D[I][1],V); |
V = reverse(V); |
V = reverse(V); |
for ( I = 0; I < N; I++ ) { |
for ( I = 0; I < N; I++ ) { |
Line 380 def in_gb_oaku(F) |
|
Line 388 def in_gb_oaku(F) |
|
F1 = subst(F1,VI,VI^WI); |
F1 = subst(F1,VI,VI^WI); |
} |
} |
for ( I = 0; I < N; I++ ) D[I] = [deg(F1,V[I]),V[I]]; |
for ( I = 0; I < N; I++ ) D[I] = [deg(F1,V[I]),V[I]]; |
qsort(D,compare_first); |
qsort(D,ndbf.compare_first); |
for ( V = [], I = 0; I < N; I++ ) V = cons(D[I][1],V); |
for ( V = [], I = 0; I < N; I++ ) V = cons(D[I][1],V); |
V = reverse(V); |
V = reverse(V); |
for ( I = 0; I < N; I++ ) { |
for ( I = 0; I < N; I++ ) { |
Line 422 def in_gb_oaku(F) |
|
Line 430 def in_gb_oaku(F) |
|
return [G1,append(V,DV)]; |
return [G1,append(V,DV)]; |
} |
} |
|
|
|
/* homogenization w.r.t. (-W,W)-weight */ |
|
/* VDV = [x1,...,xn,dx1,...,dxn] */ |
|
/* homogenize F w.r.t. (W,-W,1) for (x,dx,y) */ |
|
|
|
def homogenize_oaku(F,VDV,W,Y) |
|
{ |
|
N = length(VDV); |
|
if ( N%2 ) error("invalid variable list"); |
|
N2 = N/2; |
|
if ( length(W) != N2 ) error("inconsistent weight vector"); |
|
W0 = dp_set_weight(); |
|
Wt = append(W,append(vtol(-ltov(W)),[1])); |
|
dp_set_weight(Wt); |
|
H = homogenize(F,VDV,Y); |
|
dp_set_weight(W0); |
|
if ( type(Vars=getopt(vars)) != -1 && Vars ) { |
|
DY = strtov("d"+rtostr(Y)); |
|
for ( I = 0, T = VDV, V = []; I < N2; I++, T = cdr(T) ) |
|
V = cons(car(T),V); |
|
T = cons(Y,append(T,[DY])); |
|
for ( ; V != []; V = cdr(V) ) T = cons(car(V),T); |
|
return [H,T]; |
|
} else return H; |
|
} |
|
|
/* F = [F0,F1,...] */ |
/* F = [F0,F1,...] */ |
|
|
def ann_n(F) |
def ann_n(F) |
|
|
|
|
for ( I = 0; I < N; I++ ) |
for ( I = 0; I < N; I++ ) |
D[I] = [deg(F,V[I]),V[I]]; |
D[I] = [deg(F,V[I]),V[I]]; |
qsort(D,compare_first); |
qsort(D,ndbf.compare_first); |
for ( V = [], I = 0; I < N; I++ ) |
for ( V = [], I = 0; I < N; I++ ) |
V = cons(D[I][1],V); |
V = cons(D[I][1],V); |
for ( I = N-1, DV = []; I >= 0; I-- ) |
for ( I = N-1, DV = []; I >= 0; I-- ) |
Line 808 def bfct_via_gbfct(F) |
|
Line 841 def bfct_via_gbfct(F) |
|
|
|
for ( I = 0; I < N; I++ ) |
for ( I = 0; I < N; I++ ) |
D[I] = [deg(F,V[I]),V[I]]; |
D[I] = [deg(F,V[I]),V[I]]; |
qsort(D,compare_first); |
qsort(D,ndbf.compare_first); |
for ( V = [], I = 0; I < N; I++ ) |
for ( V = [], I = 0; I < N; I++ ) |
V = cons(D[I][1],V); |
V = cons(D[I][1],V); |
V = reverse(V); |
V = reverse(V); |
Line 1260 def replace_var(V,X,Y) |
|
Line 1293 def replace_var(V,X,Y) |
|
|
|
def action_on_gfs(P,V,GFS) |
def action_on_gfs(P,V,GFS) |
{ |
{ |
|
for ( T = V, DV = []; T != []; T = cdr(T) ) |
|
DV = cons(strtov("d"+rtostr(car(T))),DV); |
|
V = append(append(V,[s]),reverse(cons(ds,DV))); |
DP = dp_ptod(P,V); |
DP = dp_ptod(P,V); |
N = length(V)/2; |
N = length(V)/2; |
for ( I = N-1, V0 = []; I >= 0; I-- ) |
for ( I = N-1, V0 = []; I >= 0; I-- ) |
Line 1406 def weyl_ideal_quotient(B,F,VDV) |
|
Line 1442 def weyl_ideal_quotient(B,F,VDV) |
|
|
|
def bf_strat(F) |
def bf_strat(F) |
{ |
{ |
|
if ( member(s,vars(F)) ) |
|
error("ann : the variable 's' is reserved."); |
dp_ord(0); |
dp_ord(0); |
T0 = time(); |
T0 = time(); |
if ( type(Heu=getopt(heuristic)) == -1 ) Heu = 0; |
if ( type(Heu=getopt(heuristic)) == -1 ) Heu = 0; |
if ( type(Vord=getopt(vord)) == -1 || type(Vord) != 4 ) Vord = 0; |
if ( type(Vord=getopt(vord)) == -1 || type(Vord) != 4 ) Vord = 0; |
if ( type(Wt=getopt(weight)) == -1 ) Wt = 0; |
if ( type(Wt=getopt(weight)) == -1 ) Wt = 0; |
|
if ( type(ElimIdeal=getopt(elimideal)) == -1 ) ElimIdeal = 0; |
L = in_ww(F|weight=Wt,heuristic=Heu,vord=Vord); |
L = in_ww(F|weight=Wt,heuristic=Heu,vord=Vord); |
T1 = time(); |
T1 = time(); |
print(["in_ww",(T1[0]+T1[1])-(T0[0]+T0[1])]); |
print(["in_ww",(T1[0]+T1[1])-(T0[0]+T0[1])]); |
Line 1449 def bf_strat(F) |
|
Line 1488 def bf_strat(F) |
|
} |
} |
|
|
L2 = bf_strat_stage2(L); |
L2 = bf_strat_stage2(L); |
|
if ( ElimIdeal ) return L2; |
S = bf_strat_stage3(L2); |
S = bf_strat_stage3(L2); |
R = []; |
R = []; |
for ( T = S; T != []; T = cdr(T) ) { |
for ( T = S; T != []; T = cdr(T) ) { |
Line 1559 def bf_strat_stage3(L) |
|
Line 1599 def bf_strat_stage3(L) |
|
|
|
def bf_local(F,P) |
def bf_local(F,P) |
{ |
{ |
|
if ( member(s,vars(F)) ) |
|
error("ann : the variable 's' is reserved."); |
/* F -> F/Fcont */ |
/* F -> F/Fcont */ |
F1 = ptozp(F); Fcont = sdiv(F,F1); F = F1; |
F1 = ptozp(F); Fcont = sdiv(F,F1); F = F1; |
if ( type(Heu=getopt(heuristic)) == -1 ) Heu = 0; |
if ( type(Heu=getopt(heuristic)) == -1 ) Heu = 0; |