=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/poly3.c,v retrieving revision 1.5 retrieving revision 1.8 diff -u -p -r1.5 -r1.8 --- OpenXM/src/kan96xx/Kan/poly3.c 2002/02/09 06:21:02 1.5 +++ OpenXM/src/kan96xx/Kan/poly3.c 2004/06/12 07:29:46 1.8 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/poly3.c,v 1.4 2002/02/04 07:58:28 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/poly3.c,v 1.7 2004/02/23 09:03:42 takayama Exp $ */ #include #include "datatype.h" #include "extern2.h" @@ -31,8 +31,8 @@ void initT(void) { DList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); MList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); */ - DList = (int *)malloc(sizeof(int)*Lsize*N0); - MList = (int *)malloc(sizeof(int)*Lsize*N0); + DList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); + MList = (int *)sGC_malloc(sizeof(int)*Lsize*N0); RList = (POLY *)sGC_malloc(sizeof(POLY)*Lsize); RListRoot = (POLY *)sGC_malloc(sizeof(POLY)*Lsize); @@ -98,7 +98,7 @@ void monomialMult_diff(e,f) /* (e) * f = [Plist] monomials */ { - int n,k,c,l,q,i,m; + int n,k,c,l,q,i,m, weightedHomogenization; struct coeff *a; struct monomial tmp; struct ring *ringp; @@ -106,6 +106,7 @@ void monomialMult_diff(e,f) tmp.ringp = ringp = f->m->ringp; n = ringp->n; c = ringp->c; l = ringp->l; m = ringp->m; + weightedHomogenization = ringp->weightedHomogenization; for (k=Plist-1; k>=0; k--) { /* coeff */ a = coeffCopy(CList[k]); @@ -115,10 +116,18 @@ void monomialMult_diff(e,f) for (i=0; im->e[i]; } - if (Homogenize) { - tmp.e[0].D += EList[k]; /* homogenization. - e[0].D will be added later. */ - } + if ((!weightedHomogenization) && Homogenize) { + if (Homogenize == 3) { + tmp.e[0].D += EList[k]/2; /* Double homogenization. */ + tmp.e[0].x += EList[k]/2; /* Dx x = x Dx + h H */ + }else{ + tmp.e[0].D += EList[k]; /* homogenization. + e[0].D will be added later. */ + } + }else if (weightedHomogenization && Homogenize) { + tmp.e[0].D += EList[k]/2 ; /* homogenization. Weight is (1,0) (special). + */ + } /* from m to n: Differential variables. */ for (i=0; i