[BACK]Return to gb.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Annotation of OpenXM/src/kan96xx/Kan/gb.c, Revision 1.12

1.12    ! takayama    1: /* $OpenXM: OpenXM/src/kan96xx/Kan/gb.c,v 1.11 2005/06/16 08:40:04 takayama Exp $ */
1.5       takayama    2: /*  untabify on May 4, 2001 */
1.1       maekawa     3: #include <stdio.h>
                      4: #include "datatype.h"
                      5: #include "extern2.h"
                      6: #include "matrix.h"
                      7: #include "gradedset.h"
                      8:
                      9: #define INITGRADE 4
                     10: #define INITSIZE 2
1.6       takayama   11: #define DMAX 100
1.1       maekawa    12:
                     13: int KanGBmessage = 1;
                     14:
                     15: static int Debug = 0;
                     16: static int sugarGrade(struct pair *inode,struct gradedPolySet *grG,
1.5       takayama   17:                       POLY gt,int gtSugarGrade);
1.1       maekawa    18: extern int Sugar;
                     19: extern int Statistics;
                     20: extern int Criterion1;
                     21: extern int UseCriterion1;
                     22: extern int UseCriterion2B;
                     23: extern int Spairs;
                     24: extern int Criterion2B, Criterion2F, Criterion2M;
1.3       takayama   25: extern int AutoReduce;
1.8       takayama   26: extern int TraceLift;
                     27: extern struct ring *TraceLift_ringmod;
1.6       takayama   28: static int MaxLength[DMAX];
                     29: static int SpNumber[DMAX];
1.1       maekawa    30:
                     31: struct gradedPairs *updatePairs(grD,gt,gtGrade,t,grG)
1.5       takayama   32:      struct gradedPairs *grD;  /* set of pairs */
                     33:      POLY gt;                 /* new polynomial */
                     34:      int gtGrade;
                     35:      int t;
                     36:      struct gradedPolySet *grG; /* (f,gt), f \in grG, should be added to grD. */
1.1       maekawa    37: {
                     38:   int gmax,newGrade;
                     39:   struct pair *node,*new,*inode,*jnode;
                     40:   int i,k;
                     41:   struct polySet *g;
                     42:   POLY lcmp;
                     43:   POLY it,jt;
                     44:   extern int Verbose;
                     45:
                     46:
                     47:   if (Verbose) {
                     48:     printf("\nupdatePairs(): ");
                     49:   }
                     50:
                     51:   gmax = grG->maxGrade;
                     52:   node = new = newPair((struct pair *)NULL);
                     53:   /* (f,gt) are stored in new as a list. */
                     54:   for (k=0; k<gmax; k++) {
                     55:     g = grG->polys[k];
                     56:     for (i=0; i<g->size; i++) {
                     57:       if (g->del[i] == 0 && (gtGrade != k || t != i)) {
1.5       takayama   58:         lcmp = (*lcm)(g->g[i],gt);
                     59:         if (lcmp == ZERO) {
1.1       maekawa    60:
1.5       takayama   61:         }else {
                     62:           new->del = 0;
                     63:           new->next = newPair(new);
                     64:           new = new->next;
                     65:           new->lcm = lcmp;
                     66:           new->ig = k; new->ii = i;  /* g->g[i] */
                     67:           new->jg = gtGrade; new->ji = t; /* gt */
                     68:           new->grade = -1; /* one do not need to set grade here. */
                     69:         }
1.1       maekawa    70:       }
                     71:     }
                     72:   }
                     73:
                     74:
                     75:   /* Check the criterion */
                     76:   /*  See Gebauer and Mora, 1988, Journal of Symbolic Computation
                     77:       279.  We must not use the test T(i)T(j) = T(i,j) because it
                     78:       does not hold in the ring of diff op.
1.5       takayama   79:   */
1.1       maekawa    80:
                     81:   inode = node->next;
                     82:   while (inode != (struct pair *)NULL) {
                     83:     jnode = inode->next;
                     84:     while (jnode != (struct pair *)NULL) {
                     85:       it = inode->lcm;
                     86:       jt = jnode->lcm;
                     87:       if ((*mmLarger)(it,jt) == 2) {
1.5       takayama   88:         /* F(j,t), i<j */
                     89:         jnode->del = 1;
                     90:         if (Verbose) printf("F[%d,%d]([%d,%d],[%d,%d]) ",
                     91:                             inode->ig,inode->ii,
                     92:                             jnode->ig,jnode->ii,
                     93:                             gtGrade,t);
                     94:         Criterion2F++;
1.1       maekawa    95:       }else {
1.5       takayama   96:         /* g[i] > g[j] ?, M(i,t) */
                     97:         if ((*isReducible)(it,jt)) {
                     98:           inode->del = 1;
                     99:           if (Verbose) printf("M[%d,%d]([%d,%d],[%d,%d]) ",
                    100:                               jnode->ig,jnode->ii,
                    101:                               inode->ig,inode->ii,
                    102:                               gtGrade,t);
                    103:           Criterion2M++;
                    104:         }
1.1       maekawa   105:         /* M(j,t) */
1.5       takayama  106:         if ((*isReducible)(jt,it)) {
                    107:           jnode->del = 1;
                    108:           if (Verbose) printf("M[%d,%d]([%d,%d],[%d,%d]) ",
                    109:                               inode->ig,inode->ii,
                    110:                               jnode->ig,jnode->ii,
                    111:                               gtGrade,t);
                    112:           Criterion2M++;
                    113:         }
1.1       maekawa   114:       }
                    115:       jnode = jnode->next;
                    116:     }
                    117:     inode = inode->next;
                    118:   }
1.5       takayama  119:
1.1       maekawa   120:   if (UseCriterion1) {
                    121:     inode = node->next;
                    122:     while (inode != NULL) {
                    123:       if (inode->del == 0) {
1.5       takayama  124:         if (criterion1(gt,grG->polys[inode->ig]->g[inode->ii],inode->lcm)) {
                    125:           inode->del = 1;
                    126:           if (Verbose) printf("Criterion1([%d,%d],[%d,%d]) ",
                    127:                               inode->ig,inode->ii,
                    128:                               gtGrade,t);
                    129:           Criterion1++;
                    130:         }
1.1       maekawa   131:       }
                    132:       inode = inode->next;
                    133:     }
                    134:   }
                    135:
                    136:   if (UseCriterion2B) {
                    137:     Criterion2B += deletePairByCriterion2B(grD,gt,grG);
                    138:   }
                    139:
                    140:   /* Merge to grD */
                    141:   inode = node->next;
                    142:   if (Debug) outputNode(inode);
                    143:   while (inode != (struct pair *)NULL) {
                    144:     if (inode->del == 0) {
                    145:       if (Sugar) {
1.5       takayama  146:         inode->grade = sugarGrade(inode,grG,gt,gtGrade);
1.1       maekawa   147:       }else{
1.5       takayama  148:         inode->grade = (*grade)(inode->lcm);
1.1       maekawa   149:       }
                    150:       if (grD->lim <= inode->grade) {
1.5       takayama  151:         grD = enlargeGradedPairs(2*(inode->grade)+1,grD);
1.1       maekawa   152:       }
                    153:       insertPair(inode,grD->pairs[inode->grade]);
                    154:       grD->maxGrade = max(grD->maxGrade,inode->grade+1); /* don't forget */
                    155:     }
                    156:     inode = inode->next;
                    157:   }
                    158:   if (Debug) printf("OK.\n");
                    159:   if (Verbose) {
                    160:     printf(" Remaining pairs are %d. maxGrade=%d\n",countPairs(grD),grD->maxGrade);
                    161:   }
                    162:   return(grD);
                    163: }
                    164:
1.10      takayama  165: struct gradedPolySet *groebner_gen(f,needBack,needSyz,grP,countDown,forceReduction,reduceOnly,gbCheck)
1.5       takayama  166:      struct arrayOfPOLY *f;
                    167:      int needBack;
                    168:      int needSyz;
                    169:      struct pair **grP;  /* if (needSyz), it is set. */
                    170:      int countDown;
                    171:      int forceReduction;
1.9       takayama  172:      int reduceOnly;
1.10      takayama  173:      int gbCheck;
1.1       maekawa   174: {
                    175:   int r;
                    176:   struct gradedPolySet *g;
                    177:   struct gradedPairs *d;
                    178:   int i;
                    179:   int grade,indx;
                    180:   POLY gt;
                    181:   struct pair *top;
                    182:   int ig,ii,jg,ji;
                    183:   POLY gi,gj;
                    184:   struct spValue h;
                    185:   struct syz0 syz;
                    186:   int pgrade = 0;
                    187:   POLY rd;
                    188:   POLY syzPoly;
                    189:   POLY syzCf;
                    190:   struct syz0 *syzp;
                    191:   int serial;
                    192:   struct pair *listP;
                    193:   extern int Verbose;
                    194:   extern int ReduceLowerTerms;
                    195:   extern int StopDegree;
                    196:   extern struct ring *CurrentRingp;
                    197:   extern char *F_mpMult;
                    198:   struct ring *rp;
1.8       takayama  199:   int first;
1.6       takayama  200:   int statisticsPL, statisticsCount;
1.1       maekawa   201:
1.12    ! takayama  202:   if (KanGBmessage) {
        !           203:        printf("countDown=%d, forceReduction=%d, reduceOnly=%d, gbCheck=%d\n",
        !           204:                   countDown, forceReduction, reduceOnly, gbCheck);
        !           205:   }
1.6       takayama  206:   if (Statistics) {
                    207:     for (i=0; i<DMAX; i++) MaxLength[i] = SpNumber[i] = 0;
                    208:   }
1.1       maekawa   209:   r = f->n;
                    210:   if (r<=0) return((struct gradedPolySet *)NULL);
                    211:   if (UseCriterion1) {
                    212:     if (needSyz) {
                    213:       warningGradedSet("You cannot use both the options needSyz and UseCriterion1.\nInput [(UseCriterion1) 0] system_variable to turn off the use of the Criterion 1.");
                    214:     }
                    215:     if (strcmp(F_mpMult,"poly")!=0) {
                    216:       warningGradedSet("You can use the option UseCriterion1 only for the computation in the ring of polynomials.\nInput [(UseCriterion1) 0] system_variable to turn off the use of the Criterion 1.");
                    217:     }
                    218:   }
                    219:
                    220:   Spairs = Criterion1 = Criterion2B = Criterion2F = Criterion2M = 0;
                    221:
1.10      takayama  222:   g = newGradedPolySet(INITGRADE); g->gb = 1;
1.11      takayama  223:   if (reduceOnly) g->gb = 2; /* unknown */
1.1       maekawa   224:   d = newGradedPairs(INITGRADE*2);
                    225:   for (i=0; i<g->lim; i++) {
                    226:     g->polys[i] = newPolySet(INITSIZE);
                    227:   }
                    228:
1.8       takayama  229:   first = 1;
1.1       maekawa   230:   for (i=0; i<r; i++) {
                    231:     gt = getArrayOfPOLY(f,i);
                    232:     if (gt ISZERO) { rp = CurrentRingp; } else { rp = gt->m->ringp; }
1.8       takayama  233:        if (TraceLift && (!(gt ISZERO)) && first) {
                    234:          TraceLift_ringmod = newRingOverFp(rp,getPrime(TraceLift)); first = 0;
                    235:          if (KanGBmessage) printf("Prime number for the trace lift is %d.\n",
                    236:                                                           TraceLift_ringmod->p);
                    237:        }
1.1       maekawa   238:     grade = -1; whereInG(g,gt,&grade,&indx,Sugar);
                    239:     if (KanGBmessage == 2) {
                    240:       printf("init=%s, ",POLYToString(head(gt),'*',1));
                    241:       printf("(gr,indx)=(%d,%d).\n",grade,indx);
                    242:     }
                    243:     d = updatePairs(d,gt,grade,indx,g);
                    244:     serial = i;
                    245:     if (!needBack) {
                    246:       g = putPolyInG(g,gt,grade,indx,
1.5       takayama  247:                      (struct syz0 *)NULL,1,serial);
1.1       maekawa   248:     }else {
                    249:       syzp = newSyz0();
                    250:       syzp->cf = cxx(1,0,0,rp);
                    251:       syzp->syz = toSyzPoly(cxx(1,0,0,rp),grade,indx);
                    252:       g = putPolyInG(g,gt,grade,indx,syzp,1,serial);
                    253:     }
                    254:
1.7       takayama  255:     /* markRedundant0(g,grade,indx); ?*/
                    256:        markGeneratorInG(g,grade,indx);  /*?*/
1.1       maekawa   257:     if (Debug) {
                    258:       outputGradedPairs(d); outputGradedPolySet(g,needSyz);
                    259:     }
                    260:   }
                    261:   if (needSyz) {
                    262:     *grP = newPair((struct pair *)NULL);
                    263:     listP = *grP;
                    264:   }
                    265:
                    266:   while ((top = getPair(d)) != (struct pair *)NULL) {
                    267:     ig = top->ig; ii = top->ii; /* [ig,ii] */
                    268:     jg = top->jg; ji = top->ji; /* [jg,ji] */
1.7       takayama  269:        /*
                    270:     if (g->polys[ig]->del[ii] || g->polys[jg]->del[ji]) {
                    271:       if (KanGBmessage) printf("p");
                    272:       continue;
                    273:     }  Don't do this.
                    274:        */
1.1       maekawa   275:     gi = g->polys[ig]->g[ii];
                    276:     gj = g->polys[jg]->g[ji];
                    277:
                    278:     Spairs++;
1.9       takayama  279:        if (reduceOnly && (!needSyz) && (!needBack)) h = spZero(); /* rd = 0 */
                    280:        else h = (*sp)(gi,gj);
1.1       maekawa   281:     rd = ppAddv(ppMult(h.a,gi),ppMult(h.b,gj));
1.6       takayama  282:
                    283:     if (Statistics) {
                    284:       if (top->grade >=0 && top->grade < DMAX) {
                    285:         statisticsPL = pLength(rd);
                    286:                SpNumber[top->grade]++;
                    287:         if (MaxLength[top->grade] < statisticsPL) {
                    288:           MaxLength[top->grade] = statisticsPL;
                    289:         }
                    290:       }
                    291:     }
                    292:
1.1       maekawa   293:     if (!Sugar || forceReduction) {
                    294:       rd = (*reduction)(rd,g,needBack,&syz);
                    295:     }else{
                    296:       rd = reduction_sugar(rd,g,needBack,&syz,top->grade);
                    297:     }
                    298:     syzPoly = syz.syz;
                    299:     syzCf = syz.cf;
                    300:
                    301:     if (KanGBmessage) {
                    302:       if (KanGBmessage == 2) {
1.5       takayama  303:         printf("sp([%d,%d],[%d,%d]), ",ig,ii,jg,ji);
                    304:         if (rd ISZERO) {
                    305:           printf(" 0 \n");
                    306:         } else{
                    307:           printf(" terms=%d, grade=%d, ",pLength(rd),top->grade);
                    308:           printf(" init=%s, ",POLYToString(head(rd),'*',1));
                    309:         }
1.1       maekawa   310:       }else{
1.5       takayama  311:         if (pgrade != top->grade) {
                    312:           pgrade = top->grade;
                    313:           printf(" %d",pgrade);
                    314:           fflush(stdout);
                    315:         }
                    316:         if (rd ISZERO) {
                    317:           printf("o"); fflush(stdout);
                    318:         }else{
                    319:           printf("."); fflush(stdout);
                    320:         }
1.1       maekawa   321:       }
                    322:     }
                    323:
                    324:     if (!(rd ISZERO)) {
1.10      takayama  325:       if (gbCheck) {
                    326:                /* Abort the calculation. */
                    327:                g->gb = 0;
                    328:                if (KanGBmessage) {
                    329:                  printf("gbCheck failed. \n");
                    330:                  printf("Note that the result is NOT groebner basis.\n");
                    331:                }
                    332:                break;
                    333:       }
1.1       maekawa   334:       if (needBack || needSyz) {
1.5       takayama  335:         syzp = newSyz0();
                    336:         syzp->cf = syzCf; /* no meaning */
                    337:         syzp->syz = ppAdd(toSyzPoly(h.a,ig,ii),toSyzPoly(h.b,jg,ji));
                    338:         syzp->syz = cpMult(toSyzCoeff(syzCf),syzp->syz);
                    339:         syzp->syz = ppAdd(syzp->syz,syzPoly);
1.1       maekawa   340:       }
                    341:
                    342:       if (ReduceLowerTerms && !(Sugar)) {
1.5       takayama  343:         rd = (*reductionCdr)(rd,g,needBack,&syz);
                    344:         if (needBack || needSyz) {
                    345:           /* syzp->cf = ppMult(syz.cf,syzp->cf); no meaning */
                    346:           syzp->syz = ppAdd(syz.syz,
                    347:                             cpMult(toSyzCoeff(syz.cf),syzp->syz));
                    348:         }
1.1       maekawa   349:       }
                    350:
                    351:       if(Sugar && (!forceReduction)){grade=top->grade;}else{grade=-1;}whereInG(g,rd,&grade,&indx,Sugar);
                    352:       if (KanGBmessage == 2) {
1.5       takayama  353:         printf("(gr,indx)=(%d,%d).\n",grade,indx);
                    354:         /*
                    355:           printf("sp(%s,%s)-->%s\n",POLYToString(gi,' ',1),
                    356:           POLYToString(gj,' ',1),
                    357:           POLYToString(rd,' ',1));
                    358:         */
1.1       maekawa   359:       }
1.5       takayama  360:
1.1       maekawa   361:       d = updatePairs(d,rd,grade,indx,g);
                    362:       g = putPolyInG(g,rd,grade,indx,syzp,0,-1);
                    363:       if (Sugar) { markRedundant0(g,grade,indx);}
                    364:       else {markRedundant(g,rd,grade,indx,Sugar);}
                    365:
                    366:       if (countDown) {
1.5       takayama  367:         if (eliminated(rd) == 1) {
                    368:           --countDown;
                    369:           printf("x"); fflush(stdout);
                    370:           if (countDown == 0) {
                    371:             printf("\nThe computation of the Groebner basis is suspended because of countDown==0.\n");
                    372:             printf("Note that the result is NOT groebner basis.\n");
1.10      takayama  373:             g->gb = 0;
1.5       takayama  374:             break;
                    375:           }
                    376:         }
1.1       maekawa   377:       }
                    378:       if (Debug) {
1.5       takayama  379:         outputGradedPairs(d); outputGradedPolySet(g,needSyz);
1.1       maekawa   380:       }
                    381:     }else{
                    382:       if (needSyz) {
1.5       takayama  383:         top->syz = ppAdd(toSyzPoly(h.a,ig,ii),toSyzPoly(h.b,jg,ji));
                    384:         top->syz = cpMult(toSyzCoeff(syzCf),top->syz);
                    385:         top->syz = ppAdd(top->syz,syzPoly);
                    386:         listP->next = top; top->prev = listP; listP = listP->next;
                    387:       }
                    388:     }
                    389:     if (StopDegree < pgrade) {
                    390:       fprintf(stderr,"Obtained a partial GB (StopDegree=%d)\n",StopDegree);
                    391:       if (KanGBmessage) {
                    392:         printf("Computation of the Groebner basis is suspended bacause of StopDegree < computing grade.\n");
                    393:         printf("Note that the result is NOT groebner basis.\n");
1.1       maekawa   394:       }
1.10      takayama  395:       g->gb = 0;
1.5       takayama  396:       break;
1.1       maekawa   397:     }
                    398:   }
                    399:
                    400:   if (KanGBmessage == 2) {
                    401:     outputGradedPolySet(g,needSyz);
                    402:   }
                    403:   if (KanGBmessage) {
                    404:     if (Sugar) {
                    405:       printf("\nCompleted (GB with sugar).\n");
                    406:     }else{
                    407:       printf("\nCompleted.\n");
                    408:     }
                    409:   }
                    410:
                    411:   if (Statistics) {
                    412:     printf("\nThe number of s-pairs is %d.\n",Spairs);
                    413:     printf("Criterion1 is applied %d times.\n",Criterion1);
                    414:     printf("Criterions M,F and B are applied M=%d, F=%d, B=%d times.\n",Criterion2M,Criterion2F,Criterion2B);
                    415:     Spairs = Criterion1 = Criterion2M = Criterion2F = Criterion2B = 0;
1.6       takayama  416:
                    417:     printf("degree(number of spolys): maximal polynomial size\n");
                    418:     statisticsCount = 0;
                    419:     for (i=0; i<DMAX; i++) {
                    420:       if (SpNumber[i] > 0) {
                    421:         printf("%3d(%3d): %5d, ",i,SpNumber[i],MaxLength[i]);
                    422:                if (statisticsCount % 4 == 3) {
                    423:                  printf("\n");
                    424:                  statisticsCount = 0;
                    425:                }else{ statisticsCount++; }
                    426:       }
                    427:     }
                    428:     printf("\n");
1.1       maekawa   429:   }
                    430:
1.9       takayama  431:   if (AutoReduce || reduceOnly) {
1.3       takayama  432:     toReducedBasis(g,needBack,needSyz);
                    433:   }
1.1       maekawa   434:
                    435:   return(g);
                    436: }
                    437:
                    438:
                    439: static int sugarGrade(struct pair *inode,struct gradedPolySet *grG,
1.5       takayama  440:                       POLY gt,int gtSugarGrade)
1.1       maekawa   441: {
                    442:   int a,b,ans;
                    443:   int debug = 0;
                    444:   a = grade_gen(inode->lcm)-grade_gen(grG->polys[inode->ig]->g[inode->ii]);
                    445:   b = grade_gen(inode->lcm)-grade_gen(gt);
                    446:   /* inode = lcm(f_i, gt) = p f_i = q gt  modulo lower order terms.
                    447:      a = tdeg(p), b = tdeg(gt);
1.5       takayama  448:   */
1.1       maekawa   449:   if (debug) {
                    450:     printf("Sugar grade of sp([%d,%d],[%d,%d]) ",inode->ig,inode->ii,
1.5       takayama  451:            inode->jg,inode->ji);
1.1       maekawa   452:     printf("is max(%d+%d,%d+%d)\n",a,inode->ig,b,gtSugarGrade);
                    453:   }
                    454:   a = a+(inode->ig); /* new sugar degree of p f_i. */
                    455:   b = b + gtSugarGrade;  /* new sugar degree of q gt */
                    456:   return( a > b ? a : b);
                    457: }
                    458:
1.3       takayama  459: void toReducedBasis(struct gradedPolySet *grP,int needBack, int needSyz)
                    460: {
                    461:   int changed, grd, i, reduced, grade,indx;
                    462:   struct syz0 syz;
                    463:   struct syz0 *syzp;
                    464:   POLY f;
                    465:   POLY rd;
                    466:   struct polySet *set;
                    467:
                    468:   /* KanGBmessage=1; */
                    469:   do {
                    470:     if (KanGBmessage) {
                    471:       printf("s"); fflush(stdout);
                    472:     }
                    473:     changed = 0;
                    474:     grd = 0;
                    475:     while (grd < grP->maxGrade) {
                    476:       set = grP->polys[grd];
                    477:       for (i=0; i<set->size; i++) {
1.5       takayama  478:         if (set->del[i] == 0) {
                    479:           f = set->g[i];
                    480:           if (KanGBmessage) {
                    481:             /* printf("(%d,%d)",grd,i);  */
                    482:             fflush(stdout);
                    483:           }
                    484:           rd = reductionCdr_except_grd_i(f,grP,needBack,&syz,grd,i,&reduced);
                    485:           if (KanGBmessage) {
                    486:             if (reduced) {
                    487:               printf(".");
                    488:             }else{
                    489:               printf("o");
                    490:             }
                    491:             fflush(stdout);
                    492:           }
                    493:           if (reduced) {
                    494:             changed = 1;
                    495:             set->del[i] = 1;
                    496:             if (rd != ZERO) {
                    497:               if (needSyz) {
                    498:                 syzp = newSyz0();
                    499:                 syzp->cf = syz.cf; /* no meaning */
                    500:                 syzp->syz = toSyzPoly(cxx(1,0,0,rd->m->ringp),grd,i);
                    501:                 syzp->syz = cpMult(toSyzCoeff(syz.cf),syzp->syz);
                    502:                 syzp->syz = ppAdd(syzp->syz,syz.syz);
                    503:                 /* rd = c*f + \sum c_{d,i} g_{d,i}
                    504:                    c : syz.cf,  \sum c_{d,j} g_{d,j} : syz.syz.
                    505:                    c*grade^grd*index^i + \sum c_{d,j} grade^d*index^j
                    506:                    grP is a set of polynomials. Polynomials are indexed by
                    507:                    grade and index.
                    508:                 */
                    509:                 /* printf("%s, ",POLYToString(syzp->cf,' ',1));
                    510:                    printf("%s\n",POLYToString(syzp->syz,' ',1)); */
                    511:               }else{
                    512:                 syzp = NULL;
                    513:               }
                    514:               grade = -1; whereInG(grP,rd,&grade,&indx,Sugar);
                    515:               /* Do not forget to set grade to -1 */
                    516:               /* printf("grade=%d, indx=%d, ",grade,indx); */
                    517:               putPolyInG(grP,rd,grade,indx,syzp,0,-1);
                    518:             }
                    519:           }
                    520:         }
1.3       takayama  521:       }
                    522:       grd++;
                    523:     }
                    524:   } while(changed);
                    525:   if (KanGBmessage) {
                    526:     printf("Done(reduced basis)\n");
                    527:   }
1.10      takayama  528:   grP->reduced = 1;
1.3       takayama  529: }
1.1       maekawa   530:
                    531:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>