| version 1.9, 2005/06/09 04:09:22 |
version 1.10, 2005/06/16 06:54:55 |
|
|
| /* $OpenXM: OpenXM/src/kan96xx/Kan/gb.c,v 1.8 2003/08/19 08:02:09 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/gb.c,v 1.9 2005/06/09 04:09:22 takayama Exp $ */ |
| /* untabify on May 4, 2001 */ |
/* untabify on May 4, 2001 */ |
| #include <stdio.h> |
#include <stdio.h> |
| #include "datatype.h" |
#include "datatype.h" |
| Line 162 struct gradedPairs *updatePairs(grD,gt,gtGrade,t,grG) |
|
| Line 162 struct gradedPairs *updatePairs(grD,gt,gtGrade,t,grG) |
|
| return(grD); |
return(grD); |
| } |
} |
| |
|
| struct gradedPolySet *groebner_gen(f,needBack,needSyz,grP,countDown,forceReduction,reduceOnly) |
struct gradedPolySet *groebner_gen(f,needBack,needSyz,grP,countDown,forceReduction,reduceOnly,gbCheck) |
| struct arrayOfPOLY *f; |
struct arrayOfPOLY *f; |
| int needBack; |
int needBack; |
| int needSyz; |
int needSyz; |
| Line 170 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| Line 170 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| int countDown; |
int countDown; |
| int forceReduction; |
int forceReduction; |
| int reduceOnly; |
int reduceOnly; |
| |
int gbCheck; |
| { |
{ |
| int r; |
int r; |
| struct gradedPolySet *g; |
struct gradedPolySet *g; |
| Line 215 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| Line 216 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| |
|
| Spairs = Criterion1 = Criterion2B = Criterion2F = Criterion2M = 0; |
Spairs = Criterion1 = Criterion2B = Criterion2F = Criterion2M = 0; |
| |
|
| g = newGradedPolySet(INITGRADE); |
g = newGradedPolySet(INITGRADE); g->gb = 1; |
| d = newGradedPairs(INITGRADE*2); |
d = newGradedPairs(INITGRADE*2); |
| for (i=0; i<g->lim; i++) { |
for (i=0; i<g->lim; i++) { |
| g->polys[i] = newPolySet(INITSIZE); |
g->polys[i] = newPolySet(INITSIZE); |
| Line 317 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| Line 318 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| } |
} |
| |
|
| if (!(rd ISZERO)) { |
if (!(rd ISZERO)) { |
| |
if (gbCheck) { |
| |
/* Abort the calculation. */ |
| |
g->gb = 0; |
| |
if (KanGBmessage) { |
| |
printf("gbCheck failed. \n"); |
| |
printf("Note that the result is NOT groebner basis.\n"); |
| |
} |
| |
break; |
| |
} |
| if (needBack || needSyz) { |
if (needBack || needSyz) { |
| syzp = newSyz0(); |
syzp = newSyz0(); |
| syzp->cf = syzCf; /* no meaning */ |
syzp->cf = syzCf; /* no meaning */ |
| Line 356 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| Line 366 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| if (countDown == 0) { |
if (countDown == 0) { |
| printf("\nThe computation of the Groebner basis is suspended because of countDown==0.\n"); |
printf("\nThe computation of the Groebner basis is suspended because of countDown==0.\n"); |
| printf("Note that the result is NOT groebner basis.\n"); |
printf("Note that the result is NOT groebner basis.\n"); |
| |
g->gb = 0; |
| break; |
break; |
| } |
} |
| } |
} |
| Line 377 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| Line 388 struct gradedPolySet *groebner_gen(f,needBack,needSyz, |
|
| printf("Computation of the Groebner basis is suspended bacause of StopDegree < computing grade.\n"); |
printf("Computation of the Groebner basis is suspended bacause of StopDegree < computing grade.\n"); |
| printf("Note that the result is NOT groebner basis.\n"); |
printf("Note that the result is NOT groebner basis.\n"); |
| } |
} |
| |
g->gb = 0; |
| break; |
break; |
| } |
} |
| } |
} |
| Line 509 void toReducedBasis(struct gradedPolySet *grP,int need |
|
| Line 521 void toReducedBasis(struct gradedPolySet *grP,int need |
|
| if (KanGBmessage) { |
if (KanGBmessage) { |
| printf("Done(reduced basis)\n"); |
printf("Done(reduced basis)\n"); |
| } |
} |
| |
grP->reduced = 1; |
| } |
} |
| |
|
| |
|