=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/kanExport1.c,v retrieving revision 1.16 retrieving revision 1.19 diff -u -p -r1.16 -r1.19 --- OpenXM/src/kan96xx/Kan/kanExport1.c 2004/09/05 07:42:43 1.16 +++ OpenXM/src/kan96xx/Kan/kanExport1.c 2005/06/16 06:54:55 1.19 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.15 2004/08/31 05:30:20 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.18 2005/06/16 05:07:23 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; 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; @@ -130,6 +134,10 @@ struct object Kgroebner(ob) needSyz = needBack = 1; }else if (strcmp(ob2c.lc.str,"forceReduction")==0) { forceReduction = 1; + }else if (strcmp(ob2c.lc.str,"reduceOnly")==0) { + reduceOnly = 1; + }else if (strcmp(ob2c.lc.str,"gbCheck")==0) { + gbCheck = 1; }else if (strcmp(ob2c.lc.str,"countDown")==0) { countDown = 1; cdflag = 1; if (needSyz) { @@ -251,7 +259,7 @@ struct object Kgroebner(ob) } a = arrayToArrayOfPOLY(ob2); - grG = (*groebner)(a,needBack,needSyz,&grP,countDown,forceReduction); + grG = (*groebner)(a,needBack,needSyz,&grP,countDown,forceReduction,reduceOnly,gbCheck); if (strcmp(F_groebner,"gm") == 0 && (needBack || needSyz)) { warningKan("The options needBack and needSyz are ignored."); @@ -297,11 +305,13 @@ struct object Kgroebner(ob) /* To handle zero entries in the input. */ if (noZeroEntry) { + rob=KsetAttribute(rob,KpoString("gb"),KpoInteger(grG->gb)); return(rob); } method = getoaSize(rob); switch(method) { case 1: + rob=KsetAttribute(rob,KpoString("gb"),KpoInteger(grG->gb)); return(rob); break; case 2: @@ -313,6 +323,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 +344,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 +354,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 +469,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 +509,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 +539,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 +570,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 +619,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 +679,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 +746,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 +802,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 +981,7 @@ struct object oPrincipalPart(ob) struct object ob; { POLY f; - struct object rob; + struct object rob = OINIT; switch(ob.tag) { case Spoly: @@ -982,12 +998,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 +1117,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 +1153,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 +1268,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 +1300,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 +1349,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 +1391,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;