56{
58
62
63
64
65 int n = rVar(r);
68 rGraded->block0 = (
int*)
omAlloc0(3*
sizeof(
int));
69 rGraded->block1 = (
int*)
omAlloc0(3*
sizeof(
int));
70 rGraded->wvhdl = (
int**)
omAlloc0(3*
sizeof(
int**));
72 rGraded->block0[0] = 1;
73 rGraded->block1[0] = n;
74 bool overflow;
79
80
82 nMapFunc identity = n_SetMap(r->cf,rGraded->cf);
84 for (
int i=0;
i<
k;
i++)
86
87
88
92 for (
int i=0;
i<
k;
i++)
93 {
96 {
97 poly monomial =
p_One(r);
98 for (
int j=1;
j<=rVar(r);
j++)
99 p_SetExp(monomial,
j,p_GetExp(
g,
j,rGraded),r);
100 p_Setm(monomial,r);
101
106 return monomial;
107 }
108 }
109
110
111 int* cycleAllVariables = (
int*)
omAlloc0((n+1)*
sizeof(
int));
112 for (
int i=1;
i<n;
i++)
113 cycleAllVariables[
i]=
i+1;
114 cycleAllVariables[n]=1;
115
116 int* maxPowers = (
int*)
omAlloc0((n+1)*
sizeof(
int));
117
118 for(int currentSaturationVariable=n-1; currentSaturationVariable>0; currentSaturationVariable--)
119 {
120
121
122 for (
int i=0;
i<
k;
i++)
123 {
125 int d = p_GetExp(
g,n,rGraded);
126 if (d>0)
127 {
129 {
130 p_SubExp(
g,n,d,rGraded);
132 }
133 if (d>maxPowers[currentSaturationVariable+1])
134 maxPowers[currentSaturationVariable+1]=d;
135 }
136 }
137
138
139
140 gfan::Integer cache =
w[n-1];
141 for (
int i=n-1;
i>0;
i--)
144
147 rGradedNew->block0 = (
int*)
omAlloc0(3*
sizeof(
int));
148 rGradedNew->block1 = (
int*)
omAlloc0(3*
sizeof(
int));
149 rGradedNew->wvhdl = (
int**)
omAlloc0(3*
sizeof(
int**));
151 rGradedNew->block0[0] = 1;
152 rGradedNew->block1[0] = n;
153 bool overflow;
158
159 identity = n_SetMap(rGraded->cf,rGradedNew->cf);
161 for (
int i=0;
i<
k;
i++)
162 Jold->m[
i] =
p_PermPoly(Jnew->m[
i],cycleAllVariables,rGraded,rGradedNew,identity,
NULL,0);
165
166 rGraded = rGradedNew;
168
169
170
171
172
175
177 for (
int i=0;
i<
k;
i++)
178 {
181 {
182 poly monomial =
p_One(r);
183 for (
int j=1;
j<=rVar(r);
j++)
184 {
185 int jDeshifted = (
j-currentSaturationVariable)%n;
186 if (jDeshifted<=0) jDeshifted = jDeshifted+n;
187 p_SetExp(monomial,
j,p_GetExp(
g,jDeshifted,rGraded)+maxPowers[
j],r);
188 }
189 p_Setm(monomial,r);
190
193 omFree(cycleAllVariables);
197 return monomial;
198 }
199 }
200 }
201
204
207 omFree(cycleAllVariables);
210}
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
number(*) nMapFunc(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
ideal gfanlib_monomialabortStd_wrapper(ideal I, ring r, tHomog h=testHomog)