version 1.44, 2002/12/27 07:37:57 |
version 1.50, 2003/07/01 08:12:38 |
|
|
* 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/builtin/gr.c,v 1.43 2002/07/18 02:23:53 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/gr.c,v 1.49 2003/06/21 02:09:15 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
|
|
int PCoeffs; |
int PCoeffs; |
int DP_Print = 0; |
int DP_Print = 0; |
|
int DP_PrintShort = 0; |
int DP_Multiple = 0; |
int DP_Multiple = 0; |
int DP_NFStat = 0; |
int DP_NFStat = 0; |
LIST Dist = 0; |
LIST Dist = 0; |
Line 101 static int NoCriB = 0; |
|
Line 102 static int NoCriB = 0; |
|
static int NoGC = 0; |
static int NoGC = 0; |
static int NoMC = 0; |
static int NoMC = 0; |
static int NoRA = 0; |
static int NoRA = 0; |
static int DP_PrintShort = 0; |
|
static int ShowMag = 0; |
static int ShowMag = 0; |
static int Stat = 0; |
static int Stat = 0; |
static int Denominator = 1; |
static int Denominator = 1; |
Line 619 NODE gb_f4_mod(NODE f,int m) |
|
Line 619 NODE gb_f4_mod(NODE f,int m) |
|
int *indred,*isred; |
int *indred,*isred; |
CDP ri; |
CDP ri; |
int pscalen; |
int pscalen; |
struct oEGT tmp0,tmp1,eg_split_symb,eg_split_elim1,eg_split_elim2; |
struct oEGT tmp0,tmp1,eg_split_symb,eg_split_conv,eg_split_elim1,eg_split_elim2; |
extern struct oEGT eg_symb,eg_elim1,eg_elim2; |
extern struct oEGT eg_symb,eg_conv,eg_elim1,eg_elim2; |
|
|
/* initialize coeffcient array list of ps[] */ |
/* initialize coeffcient array list of ps[] */ |
pscalen = pslen; |
pscalen = pslen; |
psca = (unsigned int **)MALLOC(pscalen*sizeof(unsigned int *)); |
psca = (unsigned int **)MALLOC(pscalen*sizeof(unsigned int *)); |
|
|
init_eg(&eg_symb); init_eg(&eg_elim1); init_eg(&eg_elim2); |
init_eg(&eg_symb); init_eg(&eg_conv); init_eg(&eg_elim1); init_eg(&eg_elim2); |
for ( gall = g = 0, d = 0, r = f; r; r = NEXT(r) ) { |
for ( gall = g = 0, d = 0, r = f; r; r = NEXT(r) ) { |
i = (int)BDY(r); |
i = (int)BDY(r); |
d = updpairs(d,g,i); |
d = updpairs(d,g,i); |
Line 668 NODE gb_f4_mod(NODE f,int m) |
|
Line 668 NODE gb_f4_mod(NODE f,int m) |
|
bt1 = mknode(2,BDY(sd)->dl,BDY(r)); |
bt1 = mknode(2,BDY(sd)->dl,BDY(r)); |
MKNODE(bt,bt1,blist); blist = bt; |
MKNODE(bt,bt1,blist); blist = bt; |
symb_merge(s,dt,nv); |
symb_merge(s,dt,nv); |
/* fprintf(stderr,"%d-",length(s)); */ |
/* fprintf(stderr,"%d-",length(s0)); */ |
nred++; |
nred++; |
} |
} |
} |
} |
/* fprintf(stderr,"\n"); */ |
/* fprintf(stderr,"\n"); */ |
|
get_eg(&tmp1); add_eg(&eg_symb,&tmp0,&tmp1); |
|
init_eg(&eg_split_symb); add_eg(&eg_split_symb,&tmp0,&tmp1); |
|
|
if ( DP_Print ) |
if ( DP_Print ) |
fprintf(asir_out,"number of reducers : %d\n",nred); |
fprintf(asir_out,"number of reducers : %d\n",nred); |
|
|
|
get_eg(&tmp0); |
/* the first nred polys in blist are reducers */ |
/* the first nred polys in blist are reducers */ |
/* row = the number of all the polys */ |
/* row = the number of all the polys */ |
for ( r = blist, row = 0; r; r = NEXT(r), row++ ); |
for ( r = blist, row = 0; r; r = NEXT(r), row++ ); |
Line 714 NODE gb_f4_mod(NODE f,int m) |
|
Line 718 NODE gb_f4_mod(NODE f,int m) |
|
for ( j = 0, k = 0; j < col; j++ ) |
for ( j = 0, k = 0; j < col; j++ ) |
if ( !isred[j] ) |
if ( !isred[j] ) |
st[k++] = at[j]; |
st[k++] = at[j]; |
get_eg(&tmp1); add_eg(&eg_symb,&tmp0,&tmp1); |
get_eg(&tmp1); add_eg(&eg_conv,&tmp0,&tmp1); |
init_eg(&eg_split_symb); add_eg(&eg_split_symb,&tmp0,&tmp1); |
init_eg(&eg_split_conv); add_eg(&eg_split_conv,&tmp0,&tmp1); |
|
|
get_eg(&tmp1); |
get_eg(&tmp1); |
/* spoly matrix; stored in reduced form; terms in ht[] are omitted */ |
/* spoly matrix; stored in reduced form; terms in ht[] are omitted */ |
Line 772 NODE gb_f4_mod(NODE f,int m) |
|
Line 776 NODE gb_f4_mod(NODE f,int m) |
|
if ( DP_Print ) { |
if ( DP_Print ) { |
fprintf(asir_out,"done rank = %d\n",rank,row,col); |
fprintf(asir_out,"done rank = %d\n",rank,row,col); |
print_eg("Symb",&eg_split_symb); |
print_eg("Symb",&eg_split_symb); |
|
print_eg("Conv",&eg_split_conv); |
print_eg("Elim1",&eg_split_elim1); |
print_eg("Elim1",&eg_split_elim1); |
print_eg("Elim2",&eg_split_elim2); |
print_eg("Elim2",&eg_split_elim2); |
fprintf(asir_out,"\n"); |
fprintf(asir_out,"\n"); |
Line 814 NODE gb_f4_mod(NODE f,int m) |
|
Line 819 NODE gb_f4_mod(NODE f,int m) |
|
} |
} |
if ( DP_Print ) { |
if ( DP_Print ) { |
print_eg("Symb",&eg_symb); |
print_eg("Symb",&eg_symb); |
|
print_eg("Conv",&eg_conv); |
print_eg("Elim1",&eg_elim1); |
print_eg("Elim1",&eg_elim1); |
print_eg("Elim2",&eg_elim2); |
print_eg("Elim2",&eg_elim2); |
fflush(asir_out); |
fflush(asir_out); |
Line 1159 void prim_part(DP f,int m,DP *r) |
|
Line 1165 void prim_part(DP f,int m,DP *r) |
|
if ( PCoeffs ) |
if ( PCoeffs ) |
dp_prim_mod(f,m,r); |
dp_prim_mod(f,m,r); |
else |
else |
*r = f; |
_dp_monic(f,m,r); |
} else { |
} else { |
if ( dp_fcoeffs || PCoeffs ) |
if ( dp_fcoeffs || PCoeffs ) |
dp_prim(f,r); |
dp_prim(f,r); |
Line 1602 NODE gb(NODE f,int m,NODE subst) |
|
Line 1608 NODE gb(NODE f,int m,NODE subst) |
|
_dp_nf(gall,h,ps,!Top,&nf); |
_dp_nf(gall,h,ps,!Top,&nf); |
else |
else |
_dp_nf_z(gall,h,ps,!Top,DP_Multiple,&nf); |
_dp_nf_z(gall,h,ps,!Top,DP_Multiple,&nf); |
if ( DP_Print ) |
if ( DP_Print && nf ) |
fprintf(asir_out,"(%.3g)",get_rtime()-t_0); |
fprintf(asir_out,"(%.3g)",get_rtime()-t_0); |
get_eg(&tnf1); add_eg(&eg_nf,&tnf0,&tnf1); |
get_eg(&tnf1); add_eg(&eg_nf,&tnf0,&tnf1); |
} else |
} else |
Line 2195 void dp_load(int index,DP *p) |
|
Line 2201 void dp_load(int index,DP *p) |
|
sprintf(path,"%s%c%d",Demand,DELIM,index); |
sprintf(path,"%s%c%d",Demand,DELIM,index); |
if ( !(fp = fopen(path,"rb") ) ) |
if ( !(fp = fopen(path,"rb") ) ) |
error("dp_load : cannot open a file"); |
error("dp_load : cannot open a file"); |
skipvl(fp); loadobj(fp,(Obj *)p); fclose(fp); |
if ( PCoeffs ) |
|
loadvl(fp); |
|
else |
|
skipvl(fp); |
|
loadobj(fp,(Obj *)p); fclose(fp); |
} |
} |
} |
} |
|
|
Line 2208 int dp_load_t(int index,DP *p) |
|
Line 2218 int dp_load_t(int index,DP *p) |
|
if ( !(fp = fopen(path,"rb") ) ) |
if ( !(fp = fopen(path,"rb") ) ) |
return 0; |
return 0; |
else { |
else { |
skipvl(fp); loadobj(fp,(Obj *)p); fclose(fp); return 1; |
if ( PCoeffs ) |
|
loadvl(fp); |
|
else |
|
skipvl(fp); |
|
loadobj(fp,(Obj *)p); fclose(fp); return 1; |
} |
} |
} |
} |
|
|