=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/gr.c,v retrieving revision 1.25 retrieving revision 1.29 diff -u -p -r1.25 -r1.29 --- OpenXM_contrib2/asir2000/builtin/gr.c 2001/09/10 05:55:14 1.25 +++ OpenXM_contrib2/asir2000/builtin/gr.c 2001/09/13 03:19:56 1.29 @@ -45,13 +45,21 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/gr.c,v 1.24 2001/09/07 08:54:57 noro Exp $ + * $OpenXM$ */ #include "ca.h" #include "parse.h" #include "base.h" #include "ox.h" +#if defined(__GNUC__) +#define INLINE inline +#elif defined(VISUAL) +#define INLINE __inline +#else +#define INLINE +#endif + #define ITOS(p) (((unsigned int)(p))&0x7fffffff) #define STOI(i) ((P)((unsigned int)(i)|0x80000000)) @@ -182,7 +190,7 @@ int doing_f4; NODE TraceList; NODE AllTraceList; -int eqdl(nv,dl1,dl2) +INLINE int eqdl(nv,dl1,dl2) int nv; DL dl1,dl2; { @@ -232,7 +240,7 @@ CDP *b; for ( m = BDY(f), len = 0; m; m = NEXT(m), len++ ); r = (CDP)MALLOC(sizeof(struct oCDP)); r->len = len; - r->body = (CMP)MALLOC(sizeof(struct oCMP)*len); + r->body = (CM)MALLOC(sizeof(struct oCM)*len); for ( m = BDY(f), i = j = 0; m; m = NEXT(m), j++ ) { for ( ; !eqdl(nv,m->dl,at[i]); i++ ); @@ -255,7 +263,7 @@ CDP *rp; if ( a[i] ) nz++; *rp = r = (CDP)MALLOC(sizeof(struct oCDP)); r->len = nz; - r->body = (CMP)MALLOC(sizeof(struct oCMP)*nz); + r->body = (CM)MALLOC(sizeof(struct oCM)*nz); for ( i = 0, j = 0; i < n; i++ ) { if ( a[i] ) { r->body[j].index = i; @@ -486,7 +494,7 @@ LIST f,v; struct order_spec *ord; LIST *rp; { - int i,mindex,m,nochk; + int i,mindex,m,nochk,homogen; struct order_spec ord1; VL fv,vv,vc; NODE fd,fd0,fi,fi0,r,r0,t,subst,x,s,xx; @@ -498,13 +506,17 @@ LIST *rp; if ( ord->id && NVars != ord->nv ) error("dp_f4_main : invalid order specification"); initd(ord); - for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) { + for ( fd0 = 0, t = BDY(f), homogen = 1; t; t = NEXT(t) ) { NEXTNODE(fd0,fd); ptod(CO,vv,(P)BDY(t),(DP *)&BDY(fd)); + if ( homogen ) + homogen = dp_homogeneous(BDY(fd)); } if ( fd0 ) NEXT(fd) = 0; setup_arrays(fd0,0,&s); x = gb_f4(s); - reduceall(x,&xx); x = xx; + if ( !homogen ) { + reduceall(x,&xx); x = xx; + } for ( r0 = 0; x; x = NEXT(x) ) { NEXTNODE(r0,r); dp_load((int)BDY(x),&ps[(int)BDY(x)]); dtop(CO,vv,ps[(int)BDY(x)],(P *)&BDY(r)); @@ -519,7 +531,7 @@ int m; struct order_spec *ord; LIST *rp; { - int i; + int i,homogen; struct order_spec ord1; VL fv,vv,vc; DP b,c,c1; @@ -532,8 +544,10 @@ LIST *rp; if ( ord->id && NVars != ord->nv ) error("dp_f4_mod_main : invalid order specification"); initd(ord); - for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) { + for ( fd0 = 0, t = BDY(f), homogen = 1; t; t = NEXT(t) ) { ptod(CO,vv,(P)BDY(t),&b); + if ( homogen ) + homogen = dp_homogeneous(b); _dp_mod(b,m,0,&c); _dp_monic(c,m,&c1); if ( c ) { @@ -543,7 +557,9 @@ LIST *rp; if ( fd0 ) NEXT(fd) = 0; setup_arrays(fd0,m,&s); x = gb_f4_mod(s,m); - reduceall_mod(x,m,&xx); x = xx; + if ( !homogen ) { + reduceall_mod(x,m,&xx); x = xx; + } for ( r0 = 0; x; x = NEXT(x) ) { NEXTNODE(r0,r); _dtop_mod(CO,vv,ps[(int)BDY(x)],(P *)&BDY(r)); } @@ -752,8 +768,6 @@ int m; } } #endif - fprintf(stderr,"\n"); - get_eg(&tmp1); add_eg(&eg_symb,&tmp0,&tmp1); init_eg(&eg_split_symb); add_eg(&eg_split_symb,&tmp0,&tmp1);