168{
169 if (strat->
tl<0)
return 1;
172 poly h_p;
173 int i,
j,pass,ei, ii, h_d,ci;
174 unsigned long not_sev;
175 long reddeg,d;
176 #define START_REDUCE 512
178 number *
A=(number*)
omAlloc0(red_size*
sizeof(number));
179 poly *C=(poly*)
omAlloc0(red_size*
sizeof(poly));
180 poly *
T=(poly*)
omAlloc0(red_size*
sizeof(poly));
181 const ring tailRing=strat->
tailRing;
182
184 d = reddeg =
h->GetpFDeg() +
h->ecart;
185 h->SetShortExpVector();
186 int li;
187 h_p =
h->GetLmTailRing();
188 not_sev = ~ h->sev;
189
190
192
194
195
196
197
198
199
202 {
205 {
206
213 return 1;
214 }
215
216 ei = strat->
T[
j].ecart;
217 li = strat->
T[
j].pLength;
220
221
222
223
226 {
227 if (li<=0) li=strat->
T[
j].GetpLength();
228 if (li>1)
230 {
231
234 break;
235
236
237 if ((((strat->
T[
i].ecart < ei) && (ei>
h->ecart))
238 || ((strat->
T[
i].ecart <=
h->ecart)
239 && (strat->
T[
i].pLength <= li)
241 &&
243 h_p, not_sev, tailRing))
244 {
245
246
247
248 ei = strat->
T[
i].ecart;
249 li = strat->
T[
i].pLength;
250 if (li<=0) li=strat->
T[
i].GetpLength();
252 if (li==1) break;
253 }
254 }
255 }
256
257
258
259
260#ifdef KDEBUG
262 {
265 Print(
"\nwith T[%d]:",ii);
267 }
268#endif
270
271
272
273
274 int l_orig=strat->
T[ii].pLength;
275
279
281 strat->
T[ii].pLength=l_orig;
282
284
285#ifdef KDEBUG
287 {
291 }
292#endif
294 {
295
296 for(
int i=0;
i<=pass;
i++)
297 {
300 }
307 return 0;
308 }
309 h->SetShortExpVector();
310 not_sev = ~ h->sev;
312
313 if (ei <= h->ecart)
315 else
316 h->ecart = d-h_d+ei-
h->ecart;
317
318
319
320
321
322
323
324 pass++;
327
328 if (pass>=red_size-1)
329 {
330 A=(number*)
omRealloc0Size(
A,red_size*
sizeof(number),2*red_size*
sizeof(number));
331 C=(poly*)
omRealloc0Size(C,red_size*
sizeof(poly),2*red_size*
sizeof(poly));
334 red_size*=2;
335 }
336 }
337}
static poly lazyComp(number *A, poly *M, poly *T, int index, poly s, int *l, const ring tailR)
static void kAppend(poly t, TObject *h)
static poly kSplitAt(int k, TObject *h, kStrategy strat)
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
static void kDeleteLcm(LObject *P)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define omFreeSize(addr, size)
#define omRealloc0Size(addr, o_size, size)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
void PrintS(const char *s)