| version 1.18, 2005/06/16 05:07:23 |
version 1.22, 2020/10/06 11:33:46 |
|
|
| /* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.17 2005/06/09 04:09:22 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.21 2005/07/03 11:08:53 ohara Exp $ */ |
| #include <stdio.h> |
#include <stdio.h> |
| |
#include <string.h> |
| #include "datatype.h" |
#include "datatype.h" |
| #include "stackm.h" |
#include "stackm.h" |
| #include "extern.h" |
#include "extern.h" |
| Line 19 struct object DegreeShiftD = OINIT; |
|
| Line 20 struct object DegreeShiftD = OINIT; |
|
| int DegreeShiftD_size = 0; |
int DegreeShiftD_size = 0; |
| int *DegreeShiftD_vec = NULL; |
int *DegreeShiftD_vec = NULL; |
| |
|
| |
static struct object paddingVector(struct object ob, int table[], int m); |
| |
static struct object unitVector(int pos, int size,struct ring *r); |
| |
|
| /** :kan, :ring */ |
/** :kan, :ring */ |
| struct object Kreduction(f,set) |
struct object Kreduction(f,set) |
| struct object f; |
struct object f; |
| Line 88 struct object Kgroebner(ob) |
|
| Line 92 struct object Kgroebner(ob) |
|
| int sdflag = 0; |
int sdflag = 0; |
| int forceReduction = 0; |
int forceReduction = 0; |
| int reduceOnly = 0; |
int reduceOnly = 0; |
| |
int gbCheck = 0; /* see @s/2005/06/16-note.pdf */ |
| |
|
| int ob1Size, ob2Size, noZeroEntry; |
int ob1Size, ob2Size, noZeroEntry; |
| int *ob1ToOb2; |
int *ob1ToOb2; |
| Line 103 struct object Kgroebner(ob) |
|
| Line 108 struct object Kgroebner(ob) |
|
| struct object newB = OINIT; |
struct object newB = OINIT; |
| struct object orgC = OINIT; |
struct object orgC = OINIT; |
| struct object newC = OINIT; |
struct object newC = OINIT; |
| static struct object paddingVector(struct object ob, int table[], int m); |
struct object paddingVector(struct object ob, int table[], int m); |
| static struct object unitVector(int pos, int size,struct ring *r); |
struct object unitVector(int pos, int size,struct ring *r); |
| extern struct ring *CurrentRingp; |
extern struct ring *CurrentRingp; |
| |
|
| StopDegree = 0x7fff; |
StopDegree = 0x7fff; |
| Line 121 struct object Kgroebner(ob) |
|
| Line 126 struct object Kgroebner(ob) |
|
| if (ob2.tag != Sarray) { |
if (ob2.tag != Sarray) { |
| errorKan1("%s\n","Kgroebner(): The options must be given by an array."); |
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; i<getoaSize(ob2); i++) { |
for (i=0; i<getoaSize(ob2); i++) { |
| ob2c = getoa(ob2,i); |
ob2c = getoa(ob2,i); |
| if (ob2c.tag == Sdollar) { |
if (ob2c.tag == Sdollar) { |
| Line 135 struct object Kgroebner(ob) |
|
| Line 141 struct object Kgroebner(ob) |
|
| forceReduction = 1; |
forceReduction = 1; |
| }else if (strcmp(ob2c.lc.str,"reduceOnly")==0) { |
}else if (strcmp(ob2c.lc.str,"reduceOnly")==0) { |
| reduceOnly = 1; |
reduceOnly = 1; |
| |
}else if (strcmp(ob2c.lc.str,"gbCheck")==0) { |
| |
gbCheck = 1; |
| }else if (strcmp(ob2c.lc.str,"countDown")==0) { |
}else if (strcmp(ob2c.lc.str,"countDown")==0) { |
| countDown = 1; cdflag = 1; |
countDown = 1; cdflag = 1; |
| if (needSyz) { |
if (needSyz) { |
| Line 256 struct object Kgroebner(ob) |
|
| Line 264 struct object Kgroebner(ob) |
|
| } |
} |
| |
|
| a = arrayToArrayOfPOLY(ob2); |
a = arrayToArrayOfPOLY(ob2); |
| grG = (*groebner)(a,needBack,needSyz,&grP,countDown,forceReduction,reduceOnly); |
grG = (*groebner)(a,needBack,needSyz,&grP,countDown,forceReduction,reduceOnly,gbCheck); |
| |
|
| if (strcmp(F_groebner,"gm") == 0 && (needBack || needSyz)) { |
if (strcmp(F_groebner,"gm") == 0 && (needBack || needSyz)) { |
| warningKan("The options needBack and needSyz are ignored."); |
warningKan("The options needBack and needSyz are ignored."); |
| Line 301 struct object Kgroebner(ob) |
|
| Line 309 struct object Kgroebner(ob) |
|
| } |
} |
| |
|
| /* To handle zero entries in the input. */ |
/* To handle zero entries in the input. */ |
| |
rob=KsetAttribute(rob,KpoString("gb"),KpoInteger(grG->gb)); |
| |
putoa(rob,0,KsetAttribute(getoa(rob,0),KpoString("gb"),KpoInteger(grG->gb))); |
| if (noZeroEntry) { |
if (noZeroEntry) { |
| return(rob); |
return(rob); |
| } |
} |
| Line 318 struct object Kgroebner(ob) |
|
| Line 328 struct object Kgroebner(ob) |
|
| rob2 = newObjectArray(2); |
rob2 = newObjectArray(2); |
| putoa(rob2,0,getoa(rob,0)); |
putoa(rob2,0,getoa(rob,0)); |
| putoa(rob2,1,newB); |
putoa(rob2,1,newB); |
| |
rob2=KsetAttribute(rob2,KpoString("gb"),KpoInteger(grG->gb)); |
| return(rob2); |
return(rob2); |
| break; |
break; |
| case 3: |
case 3: |
| Line 338 struct object Kgroebner(ob) |
|
| Line 349 struct object Kgroebner(ob) |
|
| putoa(rob2,0,getoa(rob,0)); |
putoa(rob2,0,getoa(rob,0)); |
| putoa(rob2,1,newB); |
putoa(rob2,1,newB); |
| putoa(rob2,2,newC); |
putoa(rob2,2,newC); |
| |
rob2=KsetAttribute(rob2,KpoString("gb"),KpoInteger(grG->gb)); |
| return(rob2); |
return(rob2); |
| break; |
break; |
| default: |
default: |