gr_kstd2.cc
Go to the documentation of this file.
1 /****************************************
2 * Computer Algebra System SINGULAR *
3 ****************************************/
4 /*
5 * ABSTRACT - Kernel: noncomm. alg. of Buchberger
6 */
7 #define PLURAL_INTERNAL_DECLARATIONS
8 
9 
10 
11 
12 #include <kernel/mod2.h>
13 
14 #ifdef HAVE_PLURAL
15 
16 
17 #include <omalloc/omalloc.h>
18 #include <misc/options.h>
19 #include <misc/intvec.h>
20 
21 #include <polys/weight.h>
22 #include <kernel/polys.h>
23 #include <polys/monomials/ring.h>
24 
25 #include <polys/nc/gb_hack.h>
26 #include <polys/nc/nc.h>
27 #include <polys/nc/sca.h>
28 
29 
30 #include <kernel/ideals.h>
31 #include <kernel/GBEngine/kstd1.h>
32 #include <kernel/GBEngine/khstd.h>
33 //#include "spolys.h"
34 //#include "cntrlc.h"
36 #include <kernel/GBEngine/kutil.h>
37 
38 #include <kernel/GBEngine/nc.h>
39 
40 #if 0
41 /*3
42 * reduction of p2 with p1
43 * do not destroy p1 and p2
44 * p1 divides p2 -> for use in NF algorithm
45 */
46 poly gnc_ReduceSpolyNew(const poly p1, poly p2/*,poly spNoether*/, const ring r)
47 {
48  return(nc_ReduceSPoly(p1,p_Copy(p2,r)/*,spNoether*/,r));
49 }
50 #endif
51 
52 /*2
53 *reduces h with elements from T choosing the first possible
54 * element in t with respect to the given pDivisibleBy
55 */
57 {
58  int at,reddeg,d,i;
59  int pass = 0;
60  int j = 0;
61 
62  d = currRing->pFDeg((*h).p,currRing)+(*h).ecart;
63  reddeg = strat->LazyDegree+d;
64  loop
65  {
66  if (j > strat->sl)
67  {
68 #ifdef KDEBUG
69  if (TEST_OPT_DEBUG) PrintLn();
70 #endif
71  return 0;
72  }
73 #ifdef KDEBUG
74  if (TEST_OPT_DEBUG) Print("%d",j);
75 #endif
76  if (pDivisibleBy(strat->S[j],(*h).p))
77  {
78 #ifdef KDEBUG
79  if (TEST_OPT_DEBUG) PrintS("+\n");
80 #endif
81  /*
82  * the polynomial to reduce with is;
83  * T[j].p
84  */
86  pNorm(strat->S[j]);
87 #ifdef KDEBUG
88  if (TEST_OPT_DEBUG)
89  {
90  wrp(h->p);
91  PrintS(" with ");
92  wrp(strat->S[j]);
93  }
94 #endif
95  (*h).p = nc_ReduceSpoly(strat->S[j],(*h).p, currRing);
96  //spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether);
97 
98 #ifdef KDEBUG
99  if (TEST_OPT_DEBUG)
100  {
101  PrintS(" to ");
102  wrp(h->p);
103  }
104 #endif
105  if ((*h).p == NULL)
106  {
107  if (h->lcm!=NULL) p_LmFree((*h).lcm, currRing);
108  return 0;
109  }
111  {
113  else h->pCleardenom();// also does a p_Content
114  }
115  /*computes the ecart*/
116  d = currRing->pLDeg((*h).p,&((*h).length),currRing);
117  (*h).FDeg=currRing->pFDeg((*h).p,currRing);
118  (*h).ecart = d-(*h).FDeg; /*pFDeg((*h).p);*/
119  if ((strat->syzComp!=0) && !strat->honey)
120  {
121  if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
122  {
123 #ifdef KDEBUG
124  if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
125 #endif
126  return 0;
127  }
128  }
129  /*- try to reduce the s-polynomial -*/
130  pass++;
131  /*
132  *test whether the polynomial should go to the lazyset L
133  *-if the degree jumps
134  *-if the number of pre-defined reductions jumps
135  */
136  if ((strat->Ll >= 0)
137  && ((d >= reddeg) || (pass > strat->LazyPass))
138  && !strat->homog)
139  {
140  at = strat->posInL(strat->L,strat->Ll,h,strat);
141  if (at <= strat->Ll)
142  {
143  i=strat->sl+1;
144  do
145  {
146  i--;
147  if (i<0) return 0;
148  } while (!pDivisibleBy(strat->S[i],(*h).p));
149  enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
150 #ifdef KDEBUG
151  if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
152 #endif
153  (*h).p = NULL;
154  return 0;
155  }
156  }
157  if ((TEST_OPT_PROT) && (strat->Ll < 0) && (d >= reddeg))
158  {
159  reddeg = d+1;
160  Print(".%d",d);mflush();
161  }
162  j = 0;
163 #ifdef KDEBUG
164  if TEST_OPT_DEBUG PrintLn();
165 #endif
166  }
167  else
168  {
169 #ifdef KDEBUG
170  if (TEST_OPT_DEBUG) PrintS("-");
171 #endif
172  j++;
173  }
174  }
175 }
177 {
178  /* extracts monomial content from localized expression */
179  /* searches for an m (monomial in var 1.. real_var_start-1)
180  * such that m divides p and divides p by this m if it exist*/
181  if (p==NULL) return;
182  poly root=p;
184  poly f=pHead(p);
185  int i;
186  for (i=currRing->real_var_start;i<=currRing->real_var_end;i++)
187  {
188  pSetExp(f,i,0);
189  }
190  loop
191  {
192  pIter(p);
193  if (p==NULL) { pSetm(f); break;}
194  for (i=1;i<=rVar(currRing);i++)
195  {
196  pSetExp(f,i,si_min(pGetExp(f,i),pGetExp(p,i)));
197  }
198  }
199  if (!pIsConstant(f))
200  {
201 #ifdef KDEBUG
202  if (TEST_OPT_DEBUG)
203  {
204  PrintS("divide out:");p_wrp(f,currRing);
205  PrintS(" from ");pWrite(root);
206  }
207 #endif
208  p=root;
209  loop
210  {
211  if (p==NULL) break;
212  for (i=1;i<=rVar(currRing);i++)
213  {
214  pSetExp(p,i,pGetExp(p,i)-pGetExp(f,i));
215  }
216  pSetm(p);
217  pIter(p);
218  }
219  }
220  pDelete(&f);
221 }
222 
223 #ifdef HAVE_RATGRING
224 /*2
225 *reduces h with elements from T choosing the first possible
226 * element in t with respect to the given pDivisibleBy
227 * for use in ratGB
228 */
230 {
231  int at,reddeg,d,i;
232  int pass = 0;
233  int j = 0;
234  int c_j=-1, c_e=-2;
235  poly c_p=NULL;
236  assume(strat->tailRing==currRing);
237 
238  ratGB_divide_out((*h).p);
239  d = currRing->pFDeg((*h).p,currRing)+(*h).ecart;
240  reddeg = strat->LazyDegree+d;
242  {
244  else h->pCleardenom();// also does a pContentRat
245  }
246  loop
247  {
248  if (j > strat->sl)
249  {
250  if (c_j>=0)
251  {
252  /*
253  * the polynomial to reduce with is;
254  * S[c_j]
255  */
257  pNorm(strat->S[c_j]);
258 #ifdef KDEBUG
259  if (TEST_OPT_DEBUG)
260  if (TEST_OPT_DEBUG)
261  {
262  wrp(h->p);
263  Print(" with S[%d]= ",c_j);
264  wrp(strat->S[c_j]);
265  }
266 #endif
267  //poly hh = nc_CreateSpoly(strat->S[c_j],(*h).p, currRing);
268  // Print("vor nc_rat_ReduceSpolyNew (ce:%d) ",c_e);wrp(h->p);PrintLn();
269  //if(c_e==-1)
270  // c_p = nc_CreateSpoly(pCopy(strat->S[c_j]),pCopy((*h).p), currRing);
271  //else
272  // c_p=nc_rat_ReduceSpolyNew(strat->S[c_j],pCopy((*h).p), currRing->real_var_start-1,currRing);
273  // Print("nach nc_rat_ReduceSpolyNew ");wrp(c_p);PrintLn();
274  // pDelete(&((*h).p));
275 
276  c_p=nc_rat_ReduceSpolyNew(strat->S[c_j],(*h).p, currRing->real_var_start-1,currRing);
277  (*h).p=c_p;
279  {
281  else h->pCleardenom();// also does a p_Content
282  }
283 
284 #ifdef KDEBUG
285  if (TEST_OPT_DEBUG)
286  {
287  PrintS(" to ");
288  wrp(h->p);
289  PrintLn();
290  }
291 #endif
292  if ((*h).p == NULL)
293  {
294  if (h->lcm!=NULL) p_LmFree((*h).lcm, currRing);
295  return 0;
296  }
297  ratGB_divide_out((*h).p);
298  d = currRing->pLDeg((*h).p,&((*h).length),currRing);
299  (*h).FDeg=currRing->pFDeg((*h).p,currRing);
300  (*h).ecart = d-(*h).FDeg; /*pFDeg((*h).p);*/
301  /*- try to reduce the s-polynomial again -*/
302  pass++;
303  j=0;
304  c_j=-1; c_e=-2; c_p=NULL;
305  }
306  else
307  { // nothing found
308  return 0;
309  }
310  }
311  // first try usal division
312  if (p_LmDivisibleBy(strat->S[j],(*h).p,currRing))
313  {
314 #ifdef KDEBUG
315  if(TEST_OPT_DEBUG)
316  {
317  p_wrp(h->p,currRing); Print(" divisible by S[%d]=",j);
318  p_wrp(strat->S[j],currRing); PrintS(" e=-1\n");
319  }
320 #endif
321  if ((c_j<0)||(c_e>=0))
322  {
323  c_e=-1; c_j=j;
324  }
325  }
326  else
327  if (p_LmDivisibleByPart(strat->S[j],(*h).p,currRing,
328  currRing->real_var_start,currRing->real_var_end))
329  {
330  int a_e=(p_Totaldegree(strat->S[j],currRing)-currRing->pFDeg(strat->S[j],currRing));
331 #ifdef KDEBUG
332  if(TEST_OPT_DEBUG)
333  {
334  p_wrp(h->p,currRing); Print(" divisibly by S[%d]=",j);
335  p_wrp(strat->S[j],currRing); Print(" e=%d\n",a_e);
336  }
337 #endif
338  if ((c_j<0)||(c_e>a_e))
339  {
340  c_e=a_e; c_j=j;
341  //c_p = nc_CreateSpoly(pCopy(strat->S[c_j]),pCopy((*h).p), currRing);
342  }
343  /*computes the ecart*/
344  if ((strat->syzComp!=0) && !strat->honey)
345  {
346  if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
347  {
348 #ifdef KDEBUG
349  if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
350 #endif
351  return 0;
352  }
353  }
354  }
355  else
356  {
357 #ifdef KDEBUG
358  if(TEST_OPT_DEBUG)
359  {
360  p_wrp(h->p,currRing); Print(" not divisibly by S[%d]=",j);
361  p_wrp(strat->S[j],currRing); PrintLn();
362  }
363 #endif
364  }
365  j++;
366  }
367 }
368 #endif
369 
370 /*2
371 * reduction procedure for the homogeneous case
372 * and the case of a degree-ordering
373 */
375 {
376  if (strat->tl<0)
377  {
378  enterT((*h),strat);
379  return 1;
380  }
381 
382  int j = 0;
383 
384  if (TEST_OPT_DEBUG)
385  {
386  PrintS("red:");
387  wrp(h->p);
388  PrintS(" ");
389  }
390  loop
391  {
392  if (TEST_OPT_DEBUG) Print("%d",j);
393  if (pDivisibleBy(strat->S[j],(*h).p))
394  {
395  if (TEST_OPT_DEBUG)
396  {
397  PrintS("+\nwith ");
398  wrp(strat->S[j]);
399  }
400  /*- compute the s-polynomial -*/
401  (*h).p = nc_ReduceSpoly(strat->S[j],(*h).p,currRing);
402  if ((*h).p == NULL)
403  {
404  if (TEST_OPT_DEBUG) PrintS(" to 0\n");
405  if (h->lcm!=NULL) pLmFree((*h).lcm);
406  (*h).lcm=NULL;
407  return 0;
408  }
409 /*
410 * else if (strat->syzComp)
411 * {
412 * if (pMinComp((*h).p) > strat->syzComp)
413 * {
414 * enterT((*h),strat);
415 * return;
416 * }
417 * }
418 */
419  /*- try to reduce the s-polynomial -*/
420  j = 0;
421  }
422  else
423  {
424  if (j >= strat->sl)
425  {
426  enterT((*h),strat);
427  return 1;
428  }
429  j++;
430  }
431  }
432 }
433 
434 #if 0
435 /*2
436 * reduction procedure for the homogeneous case
437 * and the case of a degree-ordering
438 */
439 static int nc_redHomog0 (LObject* h,kStrategy strat)
440 {
441  if (strat->tl<0)
442  {
443  enterT((*h),strat);
444  return 0;
445  }
446 
447  int j = 0;
448  int k = 0;
449 
450  if (TEST_OPT_DEBUG)
451  {
452  PrintS("red:");
453  wrp(h->p);
454  PrintS(" ");
455  }
456  loop
457  {
458  if (TEST_OPT_DEBUG) Print("%d",j);
459  if (pDivisibleBy(strat->T[j].p,(*h).p))
460  {
461  if (TEST_OPT_DEBUG)
462  {
463  PrintS("+\nwith ");
464  wrp(strat->S[j]);
465  }
466  /*- compute the s-polynomial -*/
467  (*h).p = nc_ReduceSpoly(strat->T[j].p,(*h).p,strat->kNoether,currRing);
468  if ((*h).p == NULL)
469  {
470  if (TEST_OPT_DEBUG) PrintS(" to 0\n");
471  if (h->lcm!=NULL) pLmFree((*h).lcm);
472  (*h).lcm=NULL;
473  return 0;
474  }
475  else
476  {
478  {
480  else h->pCleardenom();// also does a pContent
481  }
482  if (strat->syzComp!=0)
483  {
484  if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
485  {
486 /*
487 * (*h).length=pLength0((*h).p);
488 */
489  enterT((*h),strat);
490  return 0;
491  }
492  }
493  }
494  /*- try to reduce the s-polynomial -*/
495  j = 0;
496  }
497  else
498  {
499  if (j >= strat->tl)
500  {
502  {
504  else h->pCleardenom();// also does a p_Content
505  }
506 /*
507 * (*h).length=pLength0((*h).p);
508 */
509  enterT((*h),strat);
510  return 0;
511  }
512  j++;
513  }
514  }
515 }
516 
517 /*2
518 * reduction procedure for the inhomogeneous case
519 * and not a degree-ordering
520 */
521 static int nc_redLazy (LObject* h,kStrategy strat)
522 {
523  if (strat->tl<0)
524  {
525  enterT((*h),strat);
526  return 0;
527  }
528 
529  int at,d,i;
530  int j = 0;
531  int pass = 0;
532  int reddeg = currRing->pFDeg((*h).p,currRing);
533 
534  if (TEST_OPT_DEBUG)
535  {
536  PrintS("red:");
537  wrp(h->p);
538  PrintS(" ");
539  }
540  loop
541  {
542  if (TEST_OPT_DEBUG) Print("%d",j);
543  if (pDivisibleBy(strat->S[j],(*h).p))
544  {
545  if (TEST_OPT_DEBUG)
546  {
547  PrintS("+\nwith ");
548  wrp(strat->S[j]);
549  }
550  /*- compute the s-polynomial -*/
551  (*h).p = nc_ReduceSpoly(strat->S[j],(*h).p,strat->kNoether,currRing);
552  if ((*h).p == NULL)
553  {
554  if (TEST_OPT_DEBUG) PrintS(" to 0\n");
555  if (h->lcm!=NULL) pLmFree((*h).lcm);
556  (*h).lcm=NULL;
557  return 0;
558  }
559 // else if (strat->syzComp)
560 // {
561 // if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
562 // {
563 // if (TEST_OPT_DEBUG) PrintS(" > syzComp\n");
564 // if (TEST_OPT_INTSTRATEGY) p_Content(h->p,currRing);
565 // enterTBba((*h),strat->tl+1,strat);
566 // return;
567 // }
568 // }
569  else
570  {
571  if (TEST_OPT_DEBUG)
572  {
573  PrintS("to:");
574  wrp((*h).p);
575  PrintLn();
576  }
578  {
579  p_Content(h->p,currRing);
580  //pCleardenom(h->p);// also does a p_Content
581  }
582  }
583  /*- try to reduce the s-polynomial -*/
584  pass++;
585  d = currRing->pFDeg((*h).p,currRing);
586  if ((strat->Ll >= 0) && ((d > reddeg) || (pass > strat->LazyPass)))
587  {
588  at = posInL11(strat->L,strat->Ll,h,strat);
589  if (at <= strat->Ll)
590  {
591  i=strat->sl+1;
592  do
593  {
594  i--;
595  if (i<0)
596  {
597  enterT((*h),strat);
598  return 0;
599  }
600  }
601  while (!pDivisibleBy(strat->S[i],(*h).p));
602  if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at);
603  enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
604  (*h).p = NULL;
605  return 0;
606  }
607  }
608  else if ((TEST_OPT_PROT) && (strat->Ll < 0) && (d != reddeg))
609  {
610  Print(".%d",d);mflush();
611  reddeg = d;
612  }
613  j = 0;
614  }
615  else
616  {
617  if (TEST_OPT_DEBUG) PrintS("-");
618  if (j >= strat->sl)
619  {
620  if (TEST_OPT_DEBUG) PrintLn();
622  {
624  else h->pCleardenom();// also does a p_Content
625  }
626  enterT((*h),strat);
627  return 0;
628  }
629  j++;
630  }
631  }
632 }
633 
634 /*2
635 * reduction procedure for the sugar-strategy (honey)
636 * reduces h with elements from T choosing first possible
637 * element in T with respect to the given ecart
638 */
639 static int nc_redHoney (LObject* h,kStrategy strat)
640 {
641  if (strat->tl<0)
642  {
643  enterT((*h),strat);
644  return 0;
645  }
646 
647  poly pi;
648  int i,j,at,reddeg,d,pass,ei;
649 
650  pass = j = 0;
651  d = reddeg = currRing->pFDeg((*h).p,currRing)+(*h).ecart;
652  if (TEST_OPT_DEBUG)
653  {
654  PrintS("red:");
655  wrp((*h).p);
656  }
657  loop
658  {
659  if (TEST_OPT_DEBUG) Print("%d",j);
660  if (pDivisibleBy(strat->T[j].p,(*h).p))
661  {
662  if (TEST_OPT_DEBUG) PrintS("+");
663  pi = strat->T[j].p;
664  ei = strat->T[j].ecart;
665  /*
666  * the polynomial to reduce with (up to the moment) is;
667  * pi with ecart ei
668  */
669  i = j;
670  loop
671  {
672  /*- takes the first possible with respect to ecart -*/
673  i++;
674  if (i > strat->tl)
675  break;
676  if ((!BTEST1(20)) && (ei <= (*h).ecart))
677  break;
678  if (TEST_OPT_DEBUG) Print("%d",i);
679  if ((strat->T[i].ecart < ei) && pDivisibleBy(strat->T[i].p,(*h).p))
680  {
681  if (TEST_OPT_DEBUG) PrintS("+");
682  /*
683  * the polynomial to reduce with is now;
684  */
685  pi = strat->T[i].p;
686  ei = strat->T[i].ecart;
687  }
688  else if (TEST_OPT_DEBUG) PrintS("-");
689  }
690 
691  /*
692  * end of search: have to reduce with pi
693  */
694  if (ei > (*h).ecart)
695  {
696  /*
697  * It is not possible to reduce h with smaller ecart;
698  * if possible h goes to the lazy-set L,i.e
699  * if its position in L would be not the last one
700  */
701  if (strat->Ll >= 0) /* L is not empty */
702  {
703  at = strat->posInL(strat->L,strat->Ll,h,strat);
704  if(at <= strat->Ll)
705  /*- h will not become the next element to reduce -*/
706  {
707  enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
708  if (TEST_OPT_DEBUG) Print(" ecart too big: -> L%d\n",at);
709  (*h).p = NULL;
710  return 0;
711  }
712  }
713  }
714  if (TEST_OPT_DEBUG)
715  {
716  PrintS("\nwith ");
717  wrp(pi);
718  }
719  if (strat->fromT)
720  {
721  strat->fromT=FALSE;
722  (*h).p = nc_ReduceSpoly(pi,(*h).p,strat->kNoether,currRing);
723  }
724  else
725  (*h).p = nc_ReduceSpoly(pi,(*h).p,strat->kNoether,currRing);
726  if (TEST_OPT_DEBUG)
727  {
728  PrintS(" to ");
729  wrp((*h).p);
730  PrintLn();
731  }
732  if ((*h).p == NULL)
733  {
734  if (h->lcm!=NULL) pLmFree((*h).lcm);
735  (*h).lcm=NULL;
736  return 0;
737  }
739  {
740  h->pCleardenom();// also does a p_Content
741  }
742  /* compute the ecart */
743  if (ei <= (*h).ecart)
744  (*h).ecart = d-currRing->pFDeg((*h).p,currRing);
745  else
746  (*h).ecart = d-currRing->pFDeg((*h).p,currRing)+ei-(*h).ecart;
747 // if (strat->syzComp)
748 // {
749 // if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
750 // {
751 // if (TEST_OPT_DEBUG)
752 // PrintS(" >syzComp\n");
753 // if (TEST_OPT_INTSTRATEGY) p_Content(h->p,currRing);
754 // at=strat->posInT(strat->T,strat->tl,(*h));
755 // enterTBba((*h),at,strat);
756 // return;
757 // }
758 // }
759  /*
760  * try to reduce the s-polynomial h
761  *test first whether h should go to the lazyset L
762  *-if the degree jumps
763  *-if the number of pre-defined reductions jumps
764  */
765  pass++;
766  d = currRing->pFDeg((*h).p,currRing)+(*h).ecart;
767  if ((strat->Ll >= 0) && ((d > reddeg) || (pass > strat->LazyPass)))
768  {
769  at = strat->posInL(strat->L,strat->Ll,h,strat);
770  if (at <= strat->Ll)
771  {
772  /*test if h is already standardbasis element*/
773  i=strat->sl+1;
774  do
775  {
776  i--;
777  if (i<0)
778  {
779  enterT((*h),strat);
780  return 0;
781  }
782  } while (!pDivisibleBy(strat->S[i],(*h).p));
783  enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
784  if (TEST_OPT_DEBUG)
785  Print(" degree jumped: -> L%d\n",at);
786  (*h).p = NULL;
787  return 0;
788  }
789  }
790  else if (TEST_OPT_PROT && (strat->Ll < 0) && (d > reddeg))
791  {
792  reddeg = d;
793  Print(".%d",d); mflush();
794  }
795  j = 0;
796  }
797  else
798  {
799  if (TEST_OPT_DEBUG) PrintS("-");
800  if (j >= strat->tl)
801  {
802  if (TEST_OPT_DEBUG) PrintLn();
804  {
805  h->pCleardenom();// also does a p_Content
806  }
807  enterT((*h),strat);
808  return 0;
809  }
810  j++;
811  }
812  }
813 }
814 
815 /*2
816 * reduction procedure for tests only
817 * reduces with elements from T and chooses the best possible
818 */
819 static int nc_redBest (LObject* h,kStrategy strat)
820 {
821  if (strat->tl<0)
822  {
823  enterT((*h),strat);
824  return 0;
825  }
826 
827  int j,jbest,at,reddeg,d,pass;
828  poly p,ph;
829  pass = j = 0;
830 
831  if (strat->honey)
832  reddeg = currRing->pFDeg((*h).p,currRing)+(*h).ecart;
833  else
834  reddeg = currRing->pFDeg((*h).p,currRing);
835  loop
836  {
837  if (pDivisibleBy(strat->T[j].p,(*h).p))
838  {
839  /* compute the s-polynomial */
840  if (!TEST_OPT_INTSTRATEGY) pNorm((*h).p);
841 #ifdef SDRING
842  // spSpolyShortBba will not work in the SRING case
843  if (pSDRING)
844  {
845  p=spSpolyCreate(strat->T[j].p,(*h).p,strat->kNoether);
846  if (p!=NULL) pDelete(&pNext(p));
847  }
848  else
849 #endif
850  p = nc_CreateShortSpoly(strat->T[j].p,(*h).p);
851  /* computes only the first monomial of the spoly */
852  if (p)
853  {
854  jbest = j;
855  /* looking for the best possible reduction */
856  if ((strat->syzComp==0) || (pMinComp(p) <= strat->syzComp))
857  {
858  loop
859  {
860  j++;
861  if (j > strat->tl)
862  break;
863  if (pDivisibleBy(strat->T[j].p,(*h).p))
864  {
865 #ifdef SDRING
866  // spSpolyShortBba will not work in the SRING case
867  if (pSDRING)
868  {
869  ph=spSpolyCreate(strat->T[j].p,(*h).p,strat->kNoether);
870  if (ph!=NULL) pDelete(&pNext(ph));
871  }
872  else
873 #endif
874  ph = nc_CreateShortSpoly(strat->T[j].p,(*h).p);
875  if (ph==NULL)
876  {
877  pLmFree(p);
878  pDelete(&((*h).p));
879  if (h->lcm!=NULL)
880  {
881  pLmFree((*h).lcm);
882  (*h).lcm=NULL;
883  }
884  return 0;
885  }
886  else if (pLmCmp(ph,p) == -1)
887  {
888  pLmFree(p);
889  p = ph;
890  jbest = j;
891  }
892  else
893  {
894  pLmFree(ph);
895  }
896  }
897  }
898  }
899  pLmFree(p);
900  (*h).p = nc_ReduceSpoly(strat->T[jbest].p,(*h).p,strat->kNoether,currRing);
901  }
902  else
903  {
904  if (h->lcm!=NULL)
905  {
906  pLmFree((*h).lcm);
907  (*h).lcm=NULL;
908  }
909  (*h).p = NULL;
910  return 0;
911  }
912  if (strat->honey && currRing->pLexOrder)
913  strat->initEcart(h);
914  /* h.length:=l; */
915  /* try to reduce the s-polynomial */
916 // if (strat->syzComp)
917 // {
918 // if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
919 // {
920 // if (TEST_OPT_DEBUG)
921 // PrintS(" >syzComp\n");
922 // if (TEST_OPT_INTSTRATEGY) p_Content(h->p,currRing);
923 // at=strat->posInT(strat->T,strat->tl,(*h));
924 // enterTBba((*h),at,strat);
925 // return;
926 // }
927 // }
928  if (strat->honey || currRing->pLexOrder)
929  {
930  pass++;
931  d = currRing->pFDeg((*h).p,currRing);
932  if (strat->honey)
933  d += (*h).ecart;
934  if ((strat->Ll >= 0) && ((pass > strat->LazyPass) || (d > reddeg)))
935  {
936  at = strat->posInL(strat->L,strat->Ll,h,strat);
937  if (at <= strat->Ll)
938  {
939  enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
940  (*h).p = NULL;
941  return 0;
942  }
943  }
944  else if (TEST_OPT_PROT && (strat->Ll < 0) && (d != reddeg))
945  {
946  reddeg = d;
947  Print("%d.");
948  mflush();
949  }
950  }
951  j = 0;
952  }
953  else
954  {
955  if (j >= strat->tl)
956  {
958  {
959  h->pCleardenom();// also does a p_Content
960  }
961  enterT((*h),strat);
962  return 0;
963  }
964  j++;
965  }
966  }
967 }
968 
969 #endif
970 
971 #ifdef HAVE_RATGRING
973 #else
974 void nc_gr_initBba(ideal, kStrategy strat)
975 #endif
976 {
978 
979  // int i;
980 // idhdl h;
981  /* setting global variables ------------------- */
982  strat->enterS = enterSBba;
983 
984 /*
985  if ((BTEST1(20)) && (!strat->honey))
986  strat->red = nc_redBest;
987  else if (strat->honey)
988  strat->red = nc_redHoney;
989  else if (currRing->pLexOrder && !strat->homog)
990  strat->red = nc_redLazy;
991  else if (TEST_OPT_INTSTRATEGY && strat->homog)
992  strat->red = nc_redHomog0;
993  else
994  strat->red = nc_redHomog;
995 */
996 
997 // if (rIsPluralRing(currRing))
998  strat->red = redGrFirst;
999 #ifdef HAVE_RATGRING
1000  if (rIsRatGRing(currRing))
1001  {
1002  int ii=IDELEMS(F)-1;
1003  int jj;
1004  BOOLEAN is_rat_id=FALSE;
1005  for(;ii>=0;ii--)
1006  {
1007  for(jj=currRing->real_var_start;jj<=currRing->real_var_end;jj++)
1008  {
1009  if(pGetExp(F->m[ii],jj)>0) { is_rat_id=TRUE; break; }
1010  }
1011  if (is_rat_id) break;
1012  }
1013  if (is_rat_id) strat->red=redGrRatGB;
1014  }
1015 #endif
1016 
1017  if (currRing->pLexOrder && strat->honey)
1018  strat->initEcart = initEcartNormal;
1019  else
1020  strat->initEcart = initEcartBBA;
1021  if (strat->honey)
1023  else
1025 // if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
1026 // {
1027 // //interred machen Aenderung
1028 // pFDegOld=currRing->pFDeg;
1029 // pLDegOld=currRing->pLDeg;
1030 // // h=ggetid("ecart");
1031 // // if ((h!=NULL) && (IDTYP(h)==INTVEC_CMD))
1032 // // {
1033 // // ecartWeights=iv2array(IDINTVEC(h));
1034 // // }
1035 // // else
1036 // {
1037 // ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
1038 // /*uses automatic computation of the ecartWeights to set them*/
1039 // kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
1040 // }
1041 // currRing->pFDeg=totaldegreeWecart;
1042 // currRing->pLDeg=maxdegreeWecart;
1043 // for(i=1; i<=(currRing->N); i++)
1044 // Print(" %d",ecartWeights[i]);
1045 // PrintLn();
1046 // mflush();
1047 // }
1048 }
1049 
1050 #define MYTEST 0
1051 
1052 ideal gnc_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing)
1053 {
1054  const ring save = currRing; if( currRing != _currRing ) rChangeCurrRing(_currRing);
1055 
1056 #if MYTEST
1057  PrintS("<gnc_gr_bba>\n");
1058 #endif
1059 
1060 #ifdef HAVE_PLURAL
1061 #if MYTEST
1062  PrintS("currRing: \n");
1063  rWrite(currRing);
1064 #ifdef RDEBUG
1066 #endif
1067 
1068  PrintS("F: \n");
1069  idPrint(F);
1070  PrintS("Q: \n");
1071  idPrint(Q);
1072 #endif
1073 #endif
1074 
1075  assume(currRing->OrdSgn != -1); // no mora!!! it terminates only for global ordering!!! (?)
1076 
1077  // intvec *w=NULL;
1078  // intvec *hilb=NULL;
1079  int olddeg,reduc;
1080  int red_result=1;
1081  int /*hilbeledeg=1,*/hilbcount=0/*,minimcnt=0*/;
1082 
1083  initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
1084  // initHilbCrit(F,Q,&hilb,strat);
1085  /* in plural we don't need Hilb yet */
1086  nc_gr_initBba(F,strat);
1087  initBuchMoraPos(strat);
1088  if (rIsRatGRing(currRing))
1089  {
1090  strat->posInL=posInL0; // by pCmp of lcm
1091  }
1092  /*set enterS, spSpolyShort, reduce, red, initEcart, initEcartPair*/
1093  /*Shdl=*/initBuchMora(F, Q,strat);
1094  strat->posInT=posInT110;
1095  reduc = olddeg = 0;
1096 
1097  /* compute------------------------------------------------------- */
1098  while (strat->Ll >= 0)
1099  {
1100  if (TEST_OPT_DEBUG) messageSets(strat);
1101 
1102  if (strat->Ll== 0) strat->interpt=TRUE;
1103  if (TEST_OPT_DEGBOUND
1104  && ((strat->honey
1105  && (strat->L[strat->Ll].ecart+currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))
1106  || ((!strat->honey) && (currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))))
1107  {
1108  /*
1109  *stops computation if
1110  * 24 IN test and the degree +ecart of L[strat->Ll] is bigger then
1111  *a predefined number Kstd1_deg
1112  */
1113  while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
1114  break;
1115  }
1116  /* picks the last element from the lazyset L */
1117  strat->P = strat->L[strat->Ll];
1118  strat->Ll--;
1119  //kTest(strat);
1120 
1121  if (strat->P.p != NULL)
1122  if (pNext(strat->P.p) == strat->tail)
1123  {
1124  /* deletes the short spoly and computes */
1125  pLmFree(strat->P.p);
1126  /* the real one */
1127 // if (ncRingType(currRing)==nc_lie) /* prod crit */
1128 // if(pHasNotCF(strat->P.p1,strat->P.p2))
1129 // {
1130 // strat->cp++;
1131 // /* prod.crit itself in nc_CreateSpoly */
1132 // }
1133 
1134 
1135  if( ! rIsRatGRing(currRing) )
1136  {
1137  strat->P.p = nc_CreateSpoly(strat->P.p1,strat->P.p2,currRing);
1138  }
1139 #ifdef HAVE_RATGRING
1140  else
1141  {
1142  /* rational case */
1143  strat->P.p = nc_rat_CreateSpoly(strat->P.p1,strat->P.p2,currRing->real_var_start-1,currRing);
1144  }
1145 #endif
1146 
1147 
1148 #ifdef PDEBUG
1149  p_Test(strat->P.p, currRing);
1150 #endif
1151 
1152 #if MYTEST
1153  if (TEST_OPT_DEBUG)
1154  {
1155  PrintS("p1: "); pWrite(strat->P.p1);
1156  PrintS("p2: "); pWrite(strat->P.p2);
1157  PrintS("SPoly: "); pWrite(strat->P.p);
1158  }
1159 #endif
1160  }
1161 
1162 
1163  if (strat->P.p != NULL)
1164  {
1165  if (TEST_OPT_PROT)
1166  message((strat->honey ? strat->P.ecart : 0) + strat->P.pFDeg(),
1167  &olddeg,&reduc,strat, red_result);
1168 
1169 #if MYTEST
1170  if (TEST_OPT_DEBUG)
1171  {
1172  PrintS("p1: "); pWrite(strat->P.p1);
1173  PrintS("p2: "); pWrite(strat->P.p2);
1174  PrintS("SPoly before: "); pWrite(strat->P.p);
1175  }
1176 #endif
1177 
1178  /* reduction of the element chosen from L */
1179  strat->red(&strat->P,strat);
1180 
1181 #if MYTEST
1182  if (TEST_OPT_DEBUG)
1183  {
1184  PrintS("red SPoly: "); pWrite(strat->P.p);
1185  }
1186 #endif
1187  }
1188  if (strat->P.p != NULL)
1189  {
1190  if (TEST_OPT_PROT)
1191  {
1192  PrintS("s\n");
1193  }
1194  /* enter P.p into s and L */
1195  {
1196 /* quick unit detection in the rational case */
1197 #ifdef HAVE_RATGRING
1198  if( rIsRatGRing(currRing) )
1199  {
1200  if ( p_LmIsConstantRat(strat->P.p, currRing) )
1201  {
1202 #ifdef PDEBUG
1203  Print("unit element detected:");
1204  p_wrp(strat->P.p,currRing);
1205 #endif
1206  p_Delete(&strat->P.p,currRing, strat->tailRing);
1207  strat->P.p = pOne();
1208  }
1209  }
1210 #endif
1211  strat->P.sev=0;
1212  int pos=posInS(strat,strat->sl,strat->P.p, strat->P.ecart);
1213  {
1215  {
1216  if ((strat->syzComp==0)||(!strat->homog))
1217  {
1218  #ifdef HAVE_RATGRING
1219  if(!rIsRatGRing(currRing))
1220  #endif
1221  strat->P.p = redtailBba(strat->P.p,pos-1,strat);
1222  }
1223 
1224  strat->P.p=p_Cleardenom(strat->P.p, currRing);
1225  }
1226  else
1227  {
1228  pNorm(strat->P.p);
1229  if ((strat->syzComp==0)||(!strat->homog))
1230  {
1231  strat->P.p = redtailBba(strat->P.p,pos-1,strat);
1232  }
1233  }
1234  if (TEST_OPT_DEBUG)
1235  {
1236  PrintS("new s:"); wrp(strat->P.p);
1237  PrintLn();
1238 #if MYTEST
1239  Print("s: "); pWrite(strat->P.p);
1240 #endif
1241 
1242  }
1243  // kTest(strat);
1244  //
1245  enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat);
1246 
1247  if (strat->sl==-1) pos=0;
1248  else pos=posInS(strat,strat->sl,strat->P.p,strat->P.ecart);
1249 
1250  strat->enterS(strat->P,pos,strat,-1);
1251  }
1252 // if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
1253  }
1254  if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
1255  }
1256 #ifdef KDEBUG
1257  strat->P.lcm=NULL;
1258 #endif
1259  //kTest(strat);
1260  }
1261  if (TEST_OPT_DEBUG) messageSets(strat);
1262 
1263  /* complete reduction of the standard basis--------- */
1264  if (TEST_OPT_SB_1)
1265  {
1266  int k=1;
1267  int j;
1268  while(k<=strat->sl)
1269  {
1270  j=0;
1271  loop
1272  {
1273  if (j>=k) break;
1274  clearS(strat->S[j],strat->sevS[j],&k,&j,strat);
1275  j++;
1276  }
1277  k++;
1278  }
1279  }
1280 
1281  if (TEST_OPT_REDSB)
1282  completeReduce(strat);
1283  /* release temp data-------------------------------- */
1284  exitBuchMora(strat);
1285 // if (TEST_OPT_WEIGHTM)
1286 // {
1287 // currRing->pFDeg=pFDegOld;
1288 // currRing->pLDeg=pLDegOld;
1289 // if (ecartWeights)
1290 // {
1291 // omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
1292 // ecartWeights=NULL;
1293 // }
1294 // }
1295  if (TEST_OPT_PROT) messageStat(hilbcount,strat);
1296  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
1297 
1298 
1299 #ifdef PDEBUG
1300 /* for counting number of pairs [enterL] in Plural */
1301 /* extern int zaehler; */
1302 /* Print("Total pairs considered:%d\n",zaehler); zaehler=0; */
1303 #endif /*PDEBUG*/
1304 
1305 #if MYTEST
1306  PrintS("</gnc_gr_bba>\n");
1307 #endif
1308 
1309  if( currRing != save ) rChangeCurrRing(save);
1310 
1311  return (strat->Shdl);
1312 }
1313 
1314 ideal gnc_gr_mora(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing)
1315 {
1316 #ifndef SING_NDEBUG
1317  // Not yet!
1318  WarnS("Sorry, non-commutative mora is not yet implemented!");
1319 #endif
1320 
1321  return gnc_gr_bba(F, Q, NULL, NULL, strat, _currRing);
1322 }
1323 
1324 #endif
1325 
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
Definition: kutil.cc:1140
int posInL11(const LSet set, const int length, LObject *p, const kStrategy)
Definition: kutil.cc:4664
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kutil.h:283
void nc_gr_initBba(ideal F, kStrategy strat)
nc_gr_initBba is needed for sca_gr_bba and gr_bba.
Definition: gr_kstd2.cc:972
BOOLEAN honey
Definition: kutil.h:371
#define pSetm(p)
Definition: polys.h:241
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
int syzComp
Definition: kutil.h:357
#define TEST_OPT_DEGBOUND
Definition: options.h:108
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:7466
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
Definition: kutil.cc:5628
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:469
class sLObject LObject
Definition: kutil.h:58
void messageStat(int hilbcount, kStrategy strat)
Definition: kutil.cc:5669
#define TEST_OPT_PROT
Definition: options.h:98
loop
Definition: myNF.cc:98
int Ll
Definition: kutil.h:354
#define pSetExp(p, i, v)
Definition: polys.h:42
static int si_min(const int a, const int b)
Definition: auxiliary.h:167
#define FALSE
Definition: auxiliary.h:140
Compatiblity layer for legacy polynomial operations (over currRing)
return P p
Definition: myNF.cc:203
f
Definition: cfModGcd.cc:4022
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:7558
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p
Definition: polys.h:105
void enterT(LObject p, kStrategy strat, int atT)
Definition: kutil.cc:7161
const ideal
Definition: gb_hack.h:42
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
Definition: kutil.cc:3671
poly kNoether
Definition: kutil.h:328
poly nc_rat_ReduceSpolyNew(const poly p1, poly p2, int ishift, const ring r)
Definition: ratgring.cc:466
int tl
Definition: kutil.h:353
#define BTEST1(a)
Definition: options.h:32
ideal gnc_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing)
Definition: gr_kstd2.cc:1052
#define TRUE
Definition: auxiliary.h:144
#define TEST_OPT_REDSB
Definition: options.h:99
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
Definition: kutil.h:286
void pWrite(poly p)
Definition: polys.h:279
int k
Definition: cfEzgcd.cc:93
poly nc_CreateShortSpoly(poly p1, poly p2, const ring r)
Definition: old.gring.cc:1926
#define TEST_OPT_DEBUG
Definition: options.h:103
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
Definition: kutil.cc:1101
#define Q
Definition: sirandom.c:25
#define WarnS
Definition: emacs.cc:81
#define pMinComp(p)
Definition: polys.h:271
int(* red)(LObject *L, kStrategy strat)
Definition: kutil.h:277
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
Definition: kInline.h:1120
int(* posInT)(const TSet T, const int tl, LObject &h)
Definition: kutil.h:280
static void p_LmFree(poly p, ring)
Definition: p_polys.h:679
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
poly gnc_ReduceSpolyNew(const poly p1, poly p2, const ring r)
Definition: old.gring.cc:1444
void rDebugPrint(ring r)
Definition: ring.cc:3971
#define mflush()
Definition: reporter.h:42
#define pIter(p)
Definition: monomials.h:44
void deleteInL(LSet set, int *length, int j, kStrategy strat)
Definition: kutil.cc:1039
BOOLEAN interpt
Definition: kutil.h:365
void(* initEcart)(TObject *L)
Definition: kutil.h:279
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
void ratGB_divide_out(poly p)
Definition: gr_kstd2.cc:176
#define idPrint(id)
Definition: ideals.h:62
BOOLEAN fromT
Definition: kutil.h:373
const ring r
Definition: syzextra.cc:208
BOOLEAN homog
Definition: kutil.h:366
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
Definition: kutil.cc:1147
#define TEST_OPT_INTSTRATEGY
Definition: options.h:105
Definition: intvec.h:16
int redGrRatGB(LObject *h, kStrategy strat)
Definition: gr_kstd2.cc:229
int j
Definition: myNF.cc:70
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
#define messageSets(s)
Definition: kutil.h:506
void initEcartBBA(TObject *h)
Definition: kutil.cc:1133
static poly nc_ReduceSpoly(const poly p1, poly p2, const ring r)
Definition: nc.h:271
int posInL0(const LSet set, const int length, LObject *p, const kStrategy)
Definition: kutil.cc:4568
LObject P
Definition: kutil.h:300
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:209
poly nc_rat_CreateSpoly(poly pp1, poly pp2, int ishift, const ring r)
Definition: ratgring.cc:341
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
static BOOLEAN p_LmDivisibleByPart(poly a, poly b, const ring r, const int start, const int end)
Definition: p_polys.h:1638
poly tail
Definition: kutil.h:334
static int nc_redHomog(LObject *h, kStrategy strat)
Definition: gr_kstd2.cc:374
#define pOne()
Definition: polys.h:286
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
polyset S
Definition: kutil.h:304
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2182
#define IDELEMS(i)
Definition: simpleideals.h:19
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1673
#define p_Test(p, r)
Definition: p_polys.h:160
void rChangeCurrRing(ring r)
Definition: polys.cc:14
int redGrFirst(LObject *h, kStrategy strat)
Definition: gr_kstd2.cc:56
kStrategy strat
Definition: myNF.cc:319
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define pi
Definition: libparse.cc:1143
BOOLEAN p_LmIsConstantRat(const poly p, const ring r)
Definition: ratgring.cc:643
LSet L
Definition: kutil.h:325
#define NULL
Definition: omList.c:10
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
Definition: polys.h:126
int Lmax
Definition: kutil.h:354
ring tailRing
Definition: kutil.h:343
int posInT110(const TSet set, const int length, LObject &p)
Definition: kutil.cc:4167
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:334
#define TEST_OPT_SB_1
Definition: options.h:113
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
Definition: kutil.cc:3860
#define pDelete(p_ptr)
Definition: polys.h:157
unsigned long * sevS
Definition: kutil.h:320
ideal gnc_gr_mora(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing)
Definition: gr_kstd2.cc:1314
void completeReduce(kStrategy strat, BOOLEAN withT)
Definition: kutil.cc:7991
#define pNext(p)
Definition: monomials.h:43
void updateResult(ideal r, ideal Q, kStrategy strat)
Definition: kutil.cc:7864
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
Definition: polys.h:70
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
Definition: kInline.h:1145
int sl
Definition: kutil.h:351
TSet T
Definition: kutil.h:324
static poly nc_CreateSpoly(const poly p1, const poly p2, const ring r)
Definition: nc.h:258
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:235
void initEcartNormal(TObject *h)
Definition: kutil.cc:1125
void wrp(poly p)
Definition: polys.h:281
void enterSBba(LObject p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:6927
int LazyPass
Definition: kutil.h:356
int Kstd1_deg
Definition: kutil.cc:228
ideal Shdl
Definition: kutil.h:301
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2655
static bool rIsRatGRing(const ring r)
Definition: ring.h:366
void exitBuchMora(kStrategy strat)
Definition: kutil.cc:7637
int LazyDegree
Definition: kutil.h:356