version 1.5, 2003/07/30 09:00:52 |
version 1.6, 2003/08/19 08:02:09 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/gradedset.c,v 1.4 2003/07/17 07:33:03 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/gradedset.c,v 1.5 2003/07/30 09:00:52 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "extern2.h" |
#include "extern2.h" |
Line 15 struct polySet *newPolySet(n) |
|
Line 15 struct polySet *newPolySet(n) |
|
g = (struct polySet *)sGC_malloc(sizeof(struct polySet)); |
g = (struct polySet *)sGC_malloc(sizeof(struct polySet)); |
g->g = (POLY *)sGC_malloc(sizeof(POLY)*(n+1)); |
g->g = (POLY *)sGC_malloc(sizeof(POLY)*(n+1)); |
g->gh = (POLY *)sGC_malloc(sizeof(POLY)*(n+1)); |
g->gh = (POLY *)sGC_malloc(sizeof(POLY)*(n+1)); |
|
g->gmod = (POLY *)sGC_malloc(sizeof(POLY)*(n+1)); |
g->gen = (int *)sGC_malloc(sizeof(int)*(n+1)); |
g->gen = (int *)sGC_malloc(sizeof(int)*(n+1)); |
g->del = (int *)sGC_malloc(sizeof(int)*(n+1)); |
g->del = (int *)sGC_malloc(sizeof(int)*(n+1)); |
g->syz = (struct syz0 **)sGC_malloc(sizeof(struct syz0 *)*(n+1)); |
g->syz = (struct syz0 **)sGC_malloc(sizeof(struct syz0 *)*(n+1)); |
Line 22 struct polySet *newPolySet(n) |
|
Line 23 struct polySet *newPolySet(n) |
|
g->serial = (int *)sGC_malloc(sizeof(int)*(n+1)); |
g->serial = (int *)sGC_malloc(sizeof(int)*(n+1)); |
if (g->g == (POLY *)NULL || g->del == (int *)NULL || |
if (g->g == (POLY *)NULL || g->del == (int *)NULL || |
g->gh == (POLY *)NULL || g->gen == (int *)NULL || |
g->gh == (POLY *)NULL || g->gen == (int *)NULL || |
|
g->gmod == (POLY *)NULL || |
g->syz == (struct syz0 **)NULL || g->mark == (int *)NULL || |
g->syz == (struct syz0 **)NULL || g->mark == (int *)NULL || |
g->serial == (int *)NULL) { |
g->serial == (int *)NULL) { |
errorGradedSet("No more memory."); |
errorGradedSet("No more memory."); |
Line 259 struct gradedPolySet *putPolyInG(g,fi,grade,index,syz, |
|
Line 261 struct gradedPolySet *putPolyInG(g,fi,grade,index,syz, |
|
for (i=0; i<g->polys[grade]->lim; i++) { |
for (i=0; i<g->polys[grade]->lim; i++) { |
polysNew->g[i] = g->polys[grade]->g[i]; |
polysNew->g[i] = g->polys[grade]->g[i]; |
polysNew->gh[i] = g->polys[grade]->gh[i]; |
polysNew->gh[i] = g->polys[grade]->gh[i]; |
|
polysNew->gmod[i] = g->polys[grade]->gmod[i]; |
polysNew->gen[i] = g->polys[grade]->gen[i]; |
polysNew->gen[i] = g->polys[grade]->gen[i]; |
polysNew->del[i] = g->polys[grade]->del[i]; |
polysNew->del[i] = g->polys[grade]->del[i]; |
polysNew->syz[i] = g->polys[grade]->syz[i]; |
polysNew->syz[i] = g->polys[grade]->syz[i]; |
Line 272 struct gradedPolySet *putPolyInG(g,fi,grade,index,syz, |
|
Line 275 struct gradedPolySet *putPolyInG(g,fi,grade,index,syz, |
|
g->polys[grade]->size = index+1; |
g->polys[grade]->size = index+1; |
g->polys[grade]->g[index] = fi; |
g->polys[grade]->g[index] = fi; |
g->polys[grade]->gh[index] = POLYNULL; |
g->polys[grade]->gh[index] = POLYNULL; |
|
g->polys[grade]->gmod[index] = POLYNULL; |
g->polys[grade]->gen[index] = 0; |
g->polys[grade]->gen[index] = 0; |
g->polys[grade]->del[index] = 0; |
g->polys[grade]->del[index] = 0; |
g->polys[grade]->syz[index] = syz; |
g->polys[grade]->syz[index] = syz; |
Line 525 int markGeneratorInG(struct gradedPolySet *g,int grade |
|
Line 529 int markGeneratorInG(struct gradedPolySet *g,int grade |
|
{ |
{ |
g->polys[grade]->gen[index] = 1; |
g->polys[grade]->gen[index] = 1; |
return 1; |
return 1; |
|
} |
|
|
|
int clearGmod(struct gradedPolySet *gset) { |
|
int grd,i; |
|
struct polySet *set; |
|
for (grd=0; grd < gset->maxGrade; grd++) { |
|
set = gset->polys[grd]; |
|
for (i = 0; i<set->size; i++) { |
|
set->gmod[i] = POLYNULL; |
|
} |
|
} |
} |
} |