version 1.7, 2003/08/21 04:45:40 |
version 1.10, 2005/06/09 04:09:22 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/red.c,v 1.6 2003/08/21 02:30:23 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/red.c,v 1.9 2004/09/13 11:24:11 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "extern2.h" |
#include "extern2.h" |
Line 10 int DebugReductionRed = 0; |
|
Line 10 int DebugReductionRed = 0; |
|
int DebugContentReduction = 0; |
int DebugContentReduction = 0; |
extern int Sugar; |
extern int Sugar; |
|
|
|
struct spValue spZero(void) { |
|
struct spValue r; |
|
r.a = ZERO; |
|
r.b = ZERO; |
|
return r; |
|
} |
struct spValue sp_gen(f,g) |
struct spValue sp_gen(f,g) |
POLY f; |
POLY f; |
POLY g; |
POLY g; |
Line 152 POLY reduction1_gen_debug(f,g,needSyz,c,h) |
|
Line 158 POLY reduction1_gen_debug(f,g,needSyz,c,h) |
|
getchar(); |
getchar(); |
getchar(); |
getchar(); |
} |
} |
if (DebugReductionRed) { |
if (DebugReductionRed & 1) { |
printf("%s --> %s\n",POLYToString(f,'*',1),POLYToString(f2,'*',1)); |
printf("%s --> %s\n",POLYToString(f,'*',1),POLYToString(f2,'*',1)); |
|
}else if (DebugReductionRed & 2) { |
|
printf("(head) %s --> %s\n",POLYToString(head(f),'*',1),POLYToString(head(f2),'*',1)); |
} |
} |
|
|
f = f2; |
f = f2; |
if (needSyz) { |
if (needSyz) { |
*c = ppMult(sv.a,*c); |
*c = ppMult(sv.a,*c); |
Line 164 POLY reduction1_gen_debug(f,g,needSyz,c,h) |
|
Line 173 POLY reduction1_gen_debug(f,g,needSyz,c,h) |
|
while ((*isReducible)(f,g)) { |
while ((*isReducible)(f,g)) { |
sv = (*sp)(f,g); |
sv = (*sp)(f,g); |
f2 = ppAddv(cpMult((sv.a)->coeffp,f),ppMult(sv.b,g)); |
f2 = ppAddv(cpMult((sv.a)->coeffp,f),ppMult(sv.b,g)); |
if (DebugReductionRed) { |
if (DebugReductionRed & 1) { |
printf("%s --> %s\n",POLYToString(f,'*',1),POLYToString(f2,'*',1)); |
printf("%s --> %s\n",POLYToString(f,'*',1),POLYToString(f2,'*',1)); |
|
}else if (DebugReductionRed & 2) { |
|
printf("(head) %s --> %s\n",POLYToString(head(f),'*',1),POLYToString(head(f2),'*',1)); |
} |
} |
if (showLength) {printf(" [%d] ",pLength(f)); fflush(stdout);} |
if (showLength) {printf(" [%d] ",pLength(f)); fflush(stdout);} |
if (!isOrdered(f2) || !isOrdered(f)) { |
if (!isOrdered(f2) || !isOrdered(f)) { |
Line 194 POLY reduction1_gen_debug(f,g,needSyz,c,h) |
|
Line 205 POLY reduction1_gen_debug(f,g,needSyz,c,h) |
|
*h = ppAdd(ppMult(sv.a,*h),sv.b); |
*h = ppAdd(ppMult(sv.a,*h),sv.b); |
} |
} |
} |
} |
|
if (DebugReductionRed & 2) printf("----------- end of reduction_gen_debug\n"); |
return(f); |
return(f); |
} |
} |
|
|
Line 655 void initSyzRingp() { |
|
Line 667 void initSyzRingp() { |
|
if (ringName == NULL) errorGradedSet("No more memory."); |
if (ringName == NULL) errorGradedSet("No more memory."); |
sprintf(ringName,"syzring%05d",ringSerial); |
sprintf(ringName,"syzring%05d",ringSerial); |
SyzRingp->name = ringName; |
SyzRingp->name = ringName; |
|
SyzRingp->partialEcart = 0; |
} |
} |
|
|
POLY reductionCdr_except_grd_i(POLY f,struct gradedPolySet *gset, |
POLY reductionCdr_except_grd_i(POLY f,struct gradedPolySet *gset, |