| version 1.1, 1999/10/08 02:12:02 |
version 1.5, 2000/07/26 02:21:30 |
|
|
| |
/* $OpenXM: OpenXM/src/kan96xx/Kan/resol.c,v 1.4 2000/06/26 11:15:04 takayama Exp $ */ |
| /* resol.c */ |
/* resol.c */ |
| #include <stdio.h> |
#include <stdio.h> |
| #include "datatype.h" |
#include "datatype.h" |
| Line 11 static struct arrayOfMonomialSyz schreyerSkelton0(stru |
|
| Line 12 static struct arrayOfMonomialSyz schreyerSkelton0(stru |
|
| static struct arrayOfMonomialSyz putMonomialSyz(struct arrayOfMonomialSyz a, |
static struct arrayOfMonomialSyz putMonomialSyz(struct arrayOfMonomialSyz a, |
| struct monomialSyz *s); |
struct monomialSyz *s); |
| |
|
| |
static int RemoveRedundantInSchreyerSkelton = 1; |
| |
|
| struct monomialSyz *newMonomialSyz(void) |
struct monomialSyz *newMonomialSyz(void) |
| { |
{ |
| struct monomialSyz *s; |
struct monomialSyz *s; |
| Line 43 struct arrayOfMonomialSyz enlargeArrayOfMonomialSyz(st |
|
| Line 46 struct arrayOfMonomialSyz enlargeArrayOfMonomialSyz(st |
|
| static struct arrayOfMonomialSyz schreyerSkelton0(struct arrayOfPOLY g,int i) |
static struct arrayOfMonomialSyz schreyerSkelton0(struct arrayOfPOLY g,int i) |
| /* return value will be changed by the next call of this function. */ |
/* return value will be changed by the next call of this function. */ |
| { |
{ |
| int m,j,k; |
int m,j,k,flag; |
| static int s_ij_size = 0; |
static int s_ij_size = 0; |
| static struct monomialSyz **s_ij = NULL; |
static struct monomialSyz **s_ij = NULL; |
| struct monomialSyz *s; |
struct monomialSyz *s; |
| struct spValue sv; |
struct spValue sv; |
| struct arrayOfMonomialSyz ans; |
struct arrayOfMonomialSyz ans; |
| |
extern int RemoveRedundantInSchreyerSkelton; |
| |
/* It was 1. */ |
| |
|
| m = g.n; |
m = g.n; |
| if (m > s_ij_size) { |
if (m > s_ij_size) { |
| Line 69 static struct arrayOfMonomialSyz schreyerSkelton0(stru |
|
| Line 74 static struct arrayOfMonomialSyz schreyerSkelton0(stru |
|
| } |
} |
| } |
} |
| shellForMonomialSyz(s_ij,m-i-1); |
shellForMonomialSyz(s_ij,m-i-1); |
| for (j=0; j<m-i-1;j++) { |
if (RemoveRedundantInSchreyerSkelton) { |
| s = s_ij[j]; |
do { |
| if (s->deleted != 1) { |
flag = 0; |
| for (k=j+1; k<m-i-1; k++) { |
for (j=0; j<m-i-1;j++) { |
| if (s_ij[k]->deleted != 1) { |
if (s_ij[j]->deleted != 1) { |
| if ((*isReducible)(s_ij[k]->a,s->a)) s_ij[k]->deleted = 1; |
for (k=0; k<m-i-1;k++) { |
| } |
if ((j != k) && (s_ij[k]->deleted != 1)) { |
| } |
if ((*isReducible)(s_ij[k]->a,s_ij[j]->a)) { |
| } |
s_ij[k]->deleted = 1; |
| |
flag = 1; |
| |
} |
| |
} |
| |
} |
| |
} |
| |
} |
| |
}while (flag); |
| } |
} |
| ans.size = m-i-1; |
ans.size = m-i-1; |
| ans.limit = s_ij_size; |
ans.limit = s_ij_size; |
| Line 112 struct arrayOfMonomialSyz schreyerSkelton(struct array |
|
| Line 124 struct arrayOfMonomialSyz schreyerSkelton(struct array |
|
| ipart = schreyerSkelton0(g,i); |
ipart = schreyerSkelton0(g,i); |
| for (k=0; k< ipart.size; k++) { |
for (k=0; k< ipart.size; k++) { |
| if ((ipart.p)[k]->deleted != 1) { |
if ((ipart.p)[k]->deleted != 1) { |
| ans = putMonomialSyz(ans,(ipart.p)[k]); |
ans = putMonomialSyz(ans,(ipart.p)[k]); |
| } |
} |
| } |
} |
| } |
} |