=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/kanExport1.c,v retrieving revision 1.15 retrieving revision 1.20 diff -u -p -r1.15 -r1.20 --- OpenXM/src/kan96xx/Kan/kanExport1.c 2004/08/31 05:30:20 1.15 +++ OpenXM/src/kan96xx/Kan/kanExport1.c 2005/06/16 08:40:04 1.20 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.14 2004/08/31 04:45:42 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.19 2005/06/16 06:54:55 takayama Exp $ */ #include #include "datatype.h" #include "stackm.h" @@ -12,10 +12,10 @@ static int Message = 1; extern int KanGBmessage; -struct object DegreeShifto; +struct object DegreeShifto = OINIT; int DegreeShifto_size = 0; int *DegreeShifto_vec = NULL; -struct object DegreeShiftD; +struct object DegreeShiftD = OINIT; int DegreeShiftD_size = 0; int *DegreeShiftD_vec = NULL; @@ -27,7 +27,7 @@ struct object Kreduction(f,set) POLY r; struct gradedPolySet *grG; struct syz0 syz; - struct object rob; + struct object rob = OINIT; int flag; extern int ReduceLowerTerms; @@ -70,36 +70,40 @@ struct object Kgroebner(ob) int needInput = 0; int countDown = 0; int cdflag = 0; - struct object ob1,ob2,ob2c; + struct object ob1 = OINIT; + struct object ob2 = OINIT; + struct object ob2c = OINIT; int i; struct gradedPolySet *grG; struct pair *grP; struct arrayOfPOLY *a; - struct object rob; + struct object rob = OINIT; struct gradedPolySet *grBases; struct matrixOfPOLY *mp; struct matrixOfPOLY *backwardMat; - struct object ob1New; + struct object ob1New = OINIT; extern char *F_groebner; extern int CheckHomogenization; extern int StopDegree; int sdflag = 0; int forceReduction = 0; + int reduceOnly = 0; + int gbCheck = 0; /* see @s/2005/06/16-note.pdf */ int ob1Size, ob2Size, noZeroEntry; int *ob1ToOb2; int *ob1ZeroPos; int method; int j,k; - struct object rob2; - struct object rob3; - struct object rob4; + struct object rob2 = OINIT; + struct object rob3 = OINIT; + struct object rob4 = OINIT; struct ring *myring; POLY f; - struct object orgB; - struct object newB; - struct object orgC; - struct object newC; + struct object orgB = OINIT; + struct object newB = OINIT; + struct object orgC = OINIT; + struct object newC = OINIT; static struct object paddingVector(struct object ob, int table[], int m); static struct object unitVector(int pos, int size,struct ring *r); extern struct ring *CurrentRingp; @@ -118,6 +122,7 @@ struct object Kgroebner(ob) if (ob2.tag != Sarray) { errorKan1("%s\n","Kgroebner(): The options must be given by an array."); } + /* Note: If you add a new option, change /configureGroebnerOption, too */ for (i=0; igb)); + putoa(rob,0,KsetAttribute(getoa(rob,0),KpoString("gb"),KpoInteger(grG->gb))); if (noZeroEntry) { return(rob); } @@ -313,6 +324,7 @@ struct object Kgroebner(ob) rob2 = newObjectArray(2); putoa(rob2,0,getoa(rob,0)); putoa(rob2,1,newB); + rob2=KsetAttribute(rob2,KpoString("gb"),KpoInteger(grG->gb)); return(rob2); break; case 3: @@ -333,6 +345,7 @@ struct object Kgroebner(ob) putoa(rob2,0,getoa(rob,0)); putoa(rob2,1,newB); putoa(rob2,2,newC); + rob2=KsetAttribute(rob2,KpoString("gb"),KpoInteger(grG->gb)); return(rob2); break; default: @@ -342,7 +355,7 @@ struct object Kgroebner(ob) static struct object paddingVector(struct object ob, int table[], int m) { - struct object rob; + struct object rob = OINIT; int i; rob = newObjectArray(m); for (i=0; imaxGrade +1); @@ -456,7 +470,8 @@ struct object gradedPolySetToArray(gps,keepRedundant) struct gradedPolySet *gps; int keepRedundant; { - struct object ob,vec; + struct object ob = OINIT; + struct object vec = OINIT; struct polySet *ps; int k; int i,j; @@ -495,7 +510,7 @@ struct object syzPolyToArray(size,f,grG) POLY f; struct gradedPolySet *grG; { - struct object ob; + struct object ob = OINIT; int i,g0,i0,serial; ob = newObjectArray(size); @@ -525,7 +540,7 @@ struct object getBackwardArray(grG) /* use serial, del. cf. getBackwardTransformation(). */ int inputSize,outputSize; int i,j,k; - struct object ob; + struct object ob = OINIT; struct polySet *ps; inputSize = 0; outputSize = 0; @@ -556,7 +571,7 @@ POLY arrayToPOLY(ob) struct object ob; { int size,i; - struct object f; + struct object f = OINIT; POLY r; static int nn,mm,ll,cc,n,m,l,c; static struct ring *cr = (struct ring *)NULL; @@ -605,7 +620,7 @@ struct object POLYToArray(ff) int k,i,matn,size; struct matrixOfPOLY *mat; POLY ex,sizep; - struct object ob; + struct object ob = OINIT; if (ff != ZERO) { tf = ff->m; @@ -665,7 +680,8 @@ struct object homogenizeObject(ob,gradep) struct object ob; int *gradep; { - struct object rob,ob1; + struct object rob = OINIT; + struct object ob1 = OINIT; int maxg; int gr,flag,i,d,size; struct ring *rp; @@ -731,7 +747,8 @@ struct object homogenizeObject_vec(ob,gradep) struct object ob; int *gradep; { - struct object rob,ob1; + struct object rob = OINIT; + struct object ob1 = OINIT; int maxg; int gr,i,size; POLY f; @@ -786,12 +803,12 @@ void KresetDegreeShift() { struct object homogenizeObject_go(struct object ob,int *gradep) { int size,i,dssize,j; - struct object ob0; - struct object ob1; - struct object ob2; - struct object rob; - struct object tob; - struct object ob1t; + struct object ob0 = OINIT; + struct object ob1 = OINIT; + struct object ob2 = OINIT; + struct object rob = OINIT; + struct object tob = OINIT; + struct object ob1t = OINIT; int *ds; POLY f; int onlyS; @@ -965,7 +982,7 @@ struct object oPrincipalPart(ob) struct object ob; { POLY f; - struct object rob; + struct object rob = OINIT; switch(ob.tag) { case Spoly: @@ -982,12 +999,12 @@ struct object oInitW(ob,oWeight) struct object oWeight; { POLY f; - struct object rob; + struct object rob = OINIT; int w[2*N0]; int n,i; - struct object ow; + struct object ow = OINIT; int shiftvec; - struct object oShift; + struct object oShift = OINIT; int *s; int ssize,m; @@ -1101,7 +1118,7 @@ POLY objArrayToPOLY(struct object ob) { } struct object POLYtoObjArray(POLY f,int size) { - struct object rob; + struct object rob = OINIT; POLY *pa; int d,n,i; POLY t; @@ -1137,12 +1154,12 @@ struct object KordWsAll(ob,oWeight) struct object oWeight; { POLY f; - struct object rob; + struct object rob = OINIT; int w[2*N0]; int n,i; - struct object ow; + struct object ow = OINIT; int shiftvec; - struct object oShift; + struct object oShift = OINIT; int *s; int ssize,m; @@ -1252,8 +1269,8 @@ int validOutputOrder(int ord[],int n) { struct object KsetOutputOrder(struct object ob, struct ring *rp) { int n,i; - struct object ox; - struct object otmp; + struct object ox = OINIT; + struct object otmp = OINIT; int *xxx; int *ddd; if (ob.tag != Sarray) { @@ -1284,10 +1301,10 @@ struct object KsetOutputOrder(struct object ob, struct struct object KschreyerSkelton(struct object g) { - struct object rob; - struct object ij; - struct object ab; - struct object tt; + struct object rob = OINIT; + struct object ij = OINIT; + struct object ab = OINIT; + struct object tt = OINIT; struct arrayOfPOLY *ap; struct arrayOfMonomialSyz ans; int k; @@ -1333,7 +1350,7 @@ struct object KvectorToSchreyer_es(struct object obarr int nn; POLY f; POLY g; - struct object ob; + struct object ob = OINIT; struct ring *rp; if (obarray.tag != Sarray) { errorKan1("%s\n","KvectorToSchreyer_es(): argument must be an array of polynomials."); @@ -1375,8 +1392,8 @@ struct object KgetExponents(struct object obPoly,struc POLY f; POLY ff; MONOMIAL tf; - struct object rob; - struct object tob; + struct object rob = OINIT; + struct object tob = OINIT; static int nn,mm,ll,cc,n,m,l,c; static struct ring *cr = (struct ring *)NULL; extern struct ring *CurrentRingp; @@ -1405,7 +1422,7 @@ struct object KgetExponents(struct object obPoly,struc } /* type == 0 x,y,Dx,Dy (no commutative, no vector) - type == 1 x,y,h,Dx,Dy,H (commutative & no vector) + type == 1 x,y,Dx,Dy,h,H (commutative & no vector) type == 2 x,y,Dx,Dy,h (commutative & no vector) */ if (f ISZERO) { @@ -1444,7 +1461,11 @@ struct object KgetExponents(struct object obPoly,struc }else{ errorKan1("%s\n","KgetExponent, unknown type."); } - hsize = size/2; + if (type == 1 || type == 2) { + hsize = (size-cc)/2; + }else{ + hsize = size/2; + } if (f ISZERO) { tob = newObjectArray(size); for (i=0; i=0; i--) { + putoa(tob,hsize+r,KpoInteger(tf->e[i].D)); + r++; putoa(tob,hsize+r,KpoInteger(tf->e[i].x)); - putoa(tob,r,KpoInteger(tf->e[i].D)); r++; } }else if (type == 2) {