18#define PLURAL_INTERNAL_DECLARATIONS 1
21#define STDZ_EXHANGE_DURING_REDUCTION 0
39#define SBA_INTERRED_START 0
41#define SBA_PRODUCT_CRITERION 0
42#define SBA_PRINT_ZERO_REDUCTIONS 0
43#define SBA_PRINT_REDUCTION_STEPS 0
44#define SBA_PRINT_OPERATIONS 0
45#define SBA_PRINT_SIZE_G 0
46#define SBA_PRINT_SIZE_SYZ 0
47#define SBA_PRINT_PRODUCT_CRITERION 0
50#if SBA_PRINT_REDUCTION_STEPS
51VAR long sba_reduction_steps;
52VAR long sba_interreduction_steps;
54#if SBA_PRINT_OPERATIONS
55VAR long sba_operations;
56VAR long sba_interreduction_operations;
86#ifdef STDZ_EXCHANGE_DURING_REDUCTION
89 unsigned long not_sev = ~L->sev;
94 const unsigned long* sevT=strat->
sevT;
106 if (
j > strat->
tl)
return o;
127 if (
j > strat->
tl)
return o;
151 unsigned long not_sev = ~L->sev;
152 const unsigned long sevT0 = strat->
sevT[0];
153 number orest,rest,
mult;
156 const poly T0p = strat->
T[0].p;
163#if defined(PDEBUG) || defined(PDIV_DEBUG)
185 const poly T0p = strat->
T[0].t_p;
187 const poly
p = L->t_p;
189#if defined(PDEBUG) || defined(PDIV_DEBUG)
215 unsigned long not_sev = ~L->sev;
220 const unsigned long* sevT=strat->
sevT;
221 number rest, orest,
mult;
232 if (
j > strat->
tl)
return o;
233#if defined(PDEBUG) || defined(PDIV_DEBUG)
256 if (
j > strat->
tl)
return o;
257#if defined(PDEBUG) || defined(PDIV_DEBUG)
278 unsigned long not_sev = ~L->sev;
283 const unsigned long* sevS=strat->
sevS;
284 number rest, orest,
mult;
296 if (
j > strat->
sl)
return o;
297#if defined(PDEBUG) || defined(PDIV_DEBUG)
323 unsigned long not_sev = ~L->sev;
327 const unsigned long* sevT=strat->
sevT;
340 if (
j > strat->
tl)
return -1;
341#if defined(PDEBUG) || defined(PDIV_DEBUG)
345 if (!(sevT[
j] & not_sev)
360 if (
j > strat->
tl)
return -1;
361#if defined(PDEBUG) || defined(PDIV_DEBUG)
365 if (!(sevT[
j] & not_sev)
384 if (
j > strat->
tl)
return -1;
385#if defined(PDEBUG) || defined(PDIV_DEBUG)
389 if (!(sevT[
j] & not_sev) &&
403 if (
j > strat->
tl)
return -1;
404#if defined(PDEBUG) || defined(PDIV_DEBUG)
408 if (!(sevT[
j] & not_sev) &&
423 unsigned long not_sev = ~L->sev;
424 poly
p = L->GetLmCurrRing();
438 ende=
posInS(strat,*max_ind,
p,0)+1;
439 if (ende>(*max_ind)) ende=(*max_ind);
448 if (
j > ende)
return -1;
449#if defined(PDEBUG) || defined(PDIV_DEBUG)
453 if ( !(strat->
sevS[
j] & not_sev) &&
467 if (
j > ende)
return -1;
468#if defined(PDEBUG) || defined(PDIV_DEBUG)
472 if ( !(strat->
sevS[
j] & not_sev) &&
486 unsigned long not_sev = ~L->sev;
487 poly
p = L->GetLmCurrRing();
501 ende=
posInS(strat,*max_ind,
p,0)+1;
502 if (ende>(*max_ind)) ende=(*max_ind);
509 if (
j > ende)
return -1;
510#if defined(PDEBUG) || defined(PDIV_DEBUG)
514 if ( !(strat->
sevS[
j] & not_sev) &&
526 unsigned long not_sev = ~L->sev;
527 poly
p = L->GetLmCurrRing();
538 if (
j > ende)
return -1;
539#if defined(PDEBUG) || defined(PDIV_DEBUG)
543 if ( !(strat->
sevS[
j] & not_sev) &&
556 if (arg <= 0)
return 0;
558 if (arg%2 == 1) { arg--; }
576 poly zeroPoly =
NULL;
577 unsigned long a = (
unsigned long)
pGetCoeff(
p);
584 for (
int i = 1;
i <= leadRing->N;
i++)
593 poly lead_mult =
p_ISet(1, tailRing);
594 if (
n_GetChar(leadRing->cf) <= k_ind2 + a_ind2)
596 int too_much = k_ind2 + a_ind2 -
n_GetChar(leadRing->cf);
598 zeroPoly =
p_ISet(a, tailRing);
599 for (
int i = 1;
i <= leadRing->N;
i++)
612 for (
int j = 1;
j <= s_exp;
j++)
629 p_Setm(lead_mult, tailRing);
630 zeroPoly =
p_Mult_mm(zeroPoly, lead_mult, tailRing);
632 for (
int i = 1;
i <= leadRing->N;
i++)
685 if (
h->IsNull())
return 0;
686 if (strat->
tl<0)
return 1;
696 long reddeg =
h->GetpFDeg();
698 h->SetShortExpVector();
705#if STDZ_EXCHANGE_DURING_REDUCTION
733 if (
h->GetLmTailRing() ==
NULL)
762#if STDZ_EXCHANGE_DURING_REDUCTION
787 if (
h->GetLmTailRing() ==
NULL)
796 h->SetShortExpVector();
801 (strat->
Ll >= 0) && ((d > reddeg) || (pass > strat->
LazyPass)))
806 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
821 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
826 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
843 if (
h->IsNull())
return 0;
844 if (strat->
sl<0)
return 1;
854 long reddeg =
h->GetpFDeg();
855 h->SetShortExpVector();
856 int max_ind=strat->
sl;
865#if STDZ_EXCHANGE_DURING_REDUCTION
889 if (
h->GetLmTailRing() ==
NULL)
915#if STDZ_EXCHANGE_DURING_REDUCTION
929 redtailBbaAlsoLC_Z_S(&h2,
j, strat);
942 if (
h->GetLmCurrRing() ==
NULL)
947 h->SetShortExpVector();
956 if (strat->
tl<0)
return 1;
957 if (
h->IsNull())
return 0;
968 long reddeg =
h->GetpFDeg();
970 h->SetShortExpVector();
992 if (
h->GetLmTailRing() ==
NULL)
1005 if (
h->GetLmTailRing() ==
NULL)
1011 h->SetShortExpVector();
1016 (strat->
Ll >= 0) && ((d > reddeg) || (pass > strat->
LazyPass)))
1021 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1022 if (at <= strat->Ll)
1036 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
1041 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1058 if (strat->
sl<0)
return 1;
1059 if (
h->IsNull())
return 0;
1069 long reddeg =
h->GetpFDeg();
1072 h->SetShortExpVector();
1091 if (
h->GetLmTailRing() ==
NULL)
1104 if (
h->GetLmTailRing() ==
NULL)
1109 h->SetShortExpVector();
1123 if (strat->
tl<0)
return 1;
1128 int i,
j,at,pass,cnt,ii;
1136 h->SetShortExpVector();
1137 h_p =
h->GetLmTailRing();
1142 if (
j < 0)
return 1;
1144 li = strat->
T[
j].pLength;
1152 if (test_opt_length)
1154 if (li<=0) li=strat->
T[
j].GetpLength();
1157 unsigned long not_sev = ~ h->sev;
1164 if ((strat->
T[
i].pLength < li)
1172 li = strat->
T[
i].pLength;
1173 if (li<=0) li=strat->
T[
i].GetpLength();
1197#if SBA_PRINT_REDUCTION_STEPS
1198 sba_interreduction_steps++;
1200#if SBA_PRINT_OPERATIONS
1201 sba_interreduction_operations +=
pLength(strat->
T[ii].p);
1213 h_p =
h->GetLmTailRing();
1230 else if (
h->t_p!=
NULL)
1250 else if (
h->t_p!=
NULL)
1259 h->SetShortExpVector();
1271 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1272 if (at <= strat->Ll)
1283 int dummy=strat->
sl;
1290 Print(
" lazy: -> L%d\n",at);
1309 assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1311 Red->HeadNormalize();
1345 if (strat->
tl<0)
return 1;
1351 PrintS(
"------- IN REDSIG -------\n");
1358 PrintS(
"---------------------------\n");
1361 int i,
j,at,pass, ii;
1364 unsigned long not_sev;
1371 h->SetShortExpVector();
1372 h_p =
h->GetLmTailRing();
1382 li = strat->
T[
j].pLength;
1383 if (li<=0) li=strat->
T[
j].GetpLength();
1391 if (test_opt_length)
1400 if ((strat->
T[
i].pLength < li)
1408 li = strat->
T[
i].pLength;
1409 if (li<=0) li=strat->
T[
i].GetpLength();
1431 Print(
"BEFORE REDUCTION WITH %d:\n",ii);
1432 PrintS(
"--------------------------------\n");
1439 PrintS(
"--------------------------------\n");
1440 printf(
"INDEX OF REDUCER T: %d\n",ii);
1443#if SBA_PRINT_REDUCTION_STEPS
1445 sba_reduction_steps++;
1447#if SBA_PRINT_OPERATIONS
1449 sba_operations +=
pLength(strat->
T[ii].p);
1456 Print(
"SigSAFE: %d\n",sigSafe);
1471 h_p =
h->GetLmTailRing();
1477 h->SetShortExpVector();
1489 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1490 if (at <= strat->Ll)
1492 int dummy=strat->
sl;
1500 Print(
" lazy: -> L%d\n",at);
1524 beforeredsig =
pCopy(
h->sig);
1526 if (strat->
tl<0)
return 1;
1532 Print(
"------- IN REDSIG -------\n");
1539 Print(
"---------------------------\n");
1542 int i,
j,at,pass, ii;
1545 unsigned long not_sev;
1552 h->SetShortExpVector();
1553 h_p =
h->GetLmTailRing();
1575 h->i_r1 = strat->
tl;
1578 if (
h->GetLmTailRing() ==
NULL)
1585 if(
pLtCmp(beforeredsig,
h->sig) == 1)
1608 li = strat->
T[
j].pLength;
1609 if (li<=0) li=strat->
T[
j].GetpLength();
1616 if (test_opt_length)
1625 if ((strat->
T[
i].pLength < li)
1633 li = strat->
T[
i].pLength;
1634 if (li<=0) li=strat->
T[
i].GetpLength();
1656 Print(
"BEFORE REDUCTION WITH %d:\n",ii);
1657 Print(
"--------------------------------\n");
1664 Print(
"--------------------------------\n");
1665 printf(
"INDEX OF REDUCER T: %d\n",ii);
1693#if SBA_PRINT_REDUCTION_STEPS
1695 sba_reduction_steps++;
1697#if SBA_PRINT_OPERATIONS
1699 sba_operations +=
pLength(strat->
T[ii].p);
1706 Print(
"SigSAFE: %d\n",sigSafe);
1721 h_p =
h->GetLmTailRing();
1727 h->SetShortExpVector();
1739 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1740 if (at <= strat->Ll)
1742 int dummy=strat->
sl;
1750 Print(
" lazy: -> L%d\n",at);
1766 p =
h = L->GetLmTailRing();
1768 return L->GetLmCurrRing();
1776 Ln.sevSig = L->sevSig;
1777 Ln.pLength = L->GetpLength() - 1;
1792 Ln.SetShortExpVector();
1798 With = &(strat->
T[
j]);
1803 if (With ==
NULL)
break;
1827#if SBA_PRINT_REDUCTION_STEPS
1829 sba_reduction_steps++;
1831#if SBA_PRINT_OPERATIONS
1833 sba_operations +=
pLength(With->p);
1843 pNext(
h) = Ln.LmExtractAndIter();
1846 }
while (!Ln.IsNull());
1849 if (Ln.IsNull())
goto all_done;
1850 if (! withT) With_s.Init(
currRing);
1857 pNext(
h) = Ln.LmExtractAndIter();
1874 return L->GetLmCurrRing();
1883 if (strat->
tl<0)
return 1;
1889 long reddeg =
h->GetpFDeg();
1893 h->SetShortExpVector();
1894 poly h_p =
h->GetLmTailRing();
1899 if (
j < 0)
return 1;
1901 li = strat->
T[
j].pLength;
1910 if (test_opt_length)
1912 if (li<=0) li=strat->
T[
j].GetpLength();
1915 unsigned long not_sev = ~ h->sev;
1922 if ((strat->
T[
i].pLength < li)
1930 li = strat->
T[
i].pLength;
1931 if (li<=0) li=strat->
T[
i].GetpLength();
1956#if SBA_PRINT_REDUCTION_STEPS
1957 sba_interreduction_steps++;
1959#if SBA_PRINT_OPERATIONS
1960 sba_interreduction_operations +=
pLength(strat->
T[ii].p);
1972 h_p=
h->GetLmTailRing();
1990 else if (
h->t_p!=
NULL)
2010 else if (
h->t_p!=
NULL)
2019 h->SetShortExpVector();
2025 (strat->
Ll >= 0) && ((d > reddeg) || (pass > strat->
LazyPass)))
2028 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2029 if (at <= strat->Ll)
2041 int dummy=strat->
sl;
2054 else if (d != reddeg)
2058 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
2063 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2090 if (strat->
tl<0)
return 1;
2094 int i,
j,at,pass,ei, ii, h_d;
2100 d = reddeg =
h->GetpFDeg() +
h->ecart;
2101 h->SetShortExpVector();
2102 h_p =
h->GetLmTailRing();
2108 if (
j < 0)
return 1;
2110 ei = strat->
T[
j].ecart;
2111 li = strat->
T[
j].pLength;
2118 if (test_opt_length)
2120 if (li<=0) li=strat->
T[
j].GetpLength();
2123 unsigned long not_sev = ~ h->sev;
2128 if (
i > strat->
tl)
break;
2129 if (ei <= h->ecart)
break;
2133 strat->
T[
i].GetpLength();
2134 if (((strat->
T[
i].ecart < ei) && (ei>
h->ecart))
2135 || ((strat->
T[
i].ecart <=
h->ecart) && (strat->
T[
i].pLength < li)))
2140 ei = strat->
T[
i].ecart;
2141 li = strat->
T[
i].pLength;
2144 if (ei<=h->ecart)
break;
2165 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2183 Print(
"\nwith T[%d]:",ii);
2190#if SBA_PRINT_REDUCTION_STEPS
2191 sba_interreduction_steps++;
2193#if SBA_PRINT_OPERATIONS
2194 sba_interreduction_operations += strat->
T[ii].pLength;
2221 else if (
h->t_p!=
NULL)
2241 else if (
h->t_p!=
NULL)
2249 h->SetShortExpVector();
2250 h_d =
h->SetpFDeg();
2255 h->ecart = d-h_d+ei-
h->ecart;
2267 && ((d > reddeg) || (pass > strat->
LazyPass))))
2271 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2272 if (at <= strat->Ll)
2283 int dummy=strat->
sl;
2290 Print(
" degree jumped: -> L%d\n",at);
2296 else if (d > reddeg)
2300 if (
h->pTotalDeg()+
h->ecart >= (
long)strat->
tailRing->bitmask)
2305 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2337 P.SetShortExpVector();
2341 if(is_ring) nonorm=
TRUE;
2460 P.SetShortExpVector();
2537 P.SetShortExpVector();
2606 P.SetShortExpVector();
2620 P.SetShortExpVector();
2646 int hilbeledeg=1,hilbcount=0,minimcnt=0;
2669 withT = ! strat->
homog;
2674#ifdef HAVE_TAIL_RING
2690 while (strat->
Ll >= 0)
2697 while (strat->
Ll >= 0)
2710 while ((strat->
Ll >= 0)
2711 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
2716 if (strat->
Ll<0)
break;
2721 strat->
P = strat->
L[strat->
Ll];
2751 else if (strat->
P.p1 ==
NULL)
2753 if (strat->
minim > 0)
2759 if ((strat->
P.p ==
NULL) && (strat->
P.t_p ==
NULL))
2767 &olddeg,&reduc,strat, red_result);
2770 red_result = strat->
red(&strat->
P,strat);
2780 if (red_result == 1)
2783 strat->
P.GetP(strat->
lmBin);
2792 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
2807 strat->
P.pCleardenom();
2811 strat->
P.pCleardenom();
2820 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
2832 if (strat->
minim==1)
2839 strat->
M->m[minimcnt]=strat->
P.p2;
2843 pNext(strat->
M->m[minimcnt])
2854 strat->
P.SetShortExpVector();
2861 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2876 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
2884 if (strat->
s_poly(strat))
2889 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
2895 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2899 else if (strat->
P.p1 ==
NULL && strat->
minim > 0)
2905 memset(&(strat->
P), 0,
sizeof(strat->
P));
2941#ifdef HAVE_TAIL_RING
2963 for(
int i = 0;
i<=strat->
sl;
i++)
2998 return (strat->
Shdl);
3010#if SBA_PRINT_ZERO_REDUCTIONS
3011 long zeroreductions = 0;
3013#if SBA_PRINT_PRODUCT_CRITERION
3014 long product_criterion = 0;
3018 int size_g_non_red = 0;
3020#if SBA_PRINT_SIZE_SYZ
3024#if SBA_PRINT_REDUCTION_STEPS
3025 sba_reduction_steps = 0;
3026 sba_interreduction_steps = 0;
3028#if SBA_PRINT_OPERATIONS
3030 sba_interreduction_operations = 0;
3034 ring sRing, currRingOld;
3039 if (sRing!=currRingOld)
3058 dummy =
pCopy(F->m[0]);
3060 F->m[
i] = F->m[
i+1];
3081 dummy =
pCopy(F->m[0]);
3083 F->m[
i] = F->m[
i+1];
3101 for (
int i=0;
i<
sort->length();++
i)
3116 F->m[
j] = F->m[
j-1];
3130#if SBA_INTERRED_START
3134 printf(
"SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
3136 printf(
"ordSgn = %d\n",
currRing->OrdSgn);
3139 int srmax,lrmax, red_result = 1;
3141 int hilbeledeg=1,hilbcount=0,minimcnt=0;
3155 reduc = olddeg = lrmax = 0;
3168#ifdef HAVE_TAIL_RING
3186 strat->
enterS(strat->
L[strat->
Ll-(
i)], strat->
sl+1, strat, strat->
tl);
3196 while (strat->
Ll >= 0)
3198 if (strat->
Ll > lrmax) lrmax =strat->
Ll;
3228 f5c ( strat, olddeg, minimcnt, hilbeledeg, hilbcount, srmax,
3229 lrmax, reduc,
Q,
w, hilb );
3239 strat->
P = strat->
L[strat->
Ll];
3245 if (!strat->
rewCrit2(strat->
P.sig, ~strat->
P.sevSig, strat->
P.GetLmCurrRing(), strat, strat->
P.checked+1))
3249 PrintS(
"SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
3250 PrintS(
"-------------------------------------------------\n");
3255 PrintS(
"-------------------------------------------------\n");
3290 else if (strat->
P.p1 ==
NULL)
3292 if (strat->
minim > 0)
3298 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
3306 PrintS(
"Poly before red: ");
3310#if SBA_PRODUCT_CRITERION
3311 if (strat->
P.prod_crit)
3313#if SBA_PRINT_PRODUCT_CRITERION
3314 product_criterion++;
3316 int pos =
posInSyz(strat, strat->
P.sig);
3323 red_result = strat->
red(&strat->
P,strat);
3326 red_result = strat->
red(&strat->
P,strat);
3342 strat->
P.p =
pNeg(strat->
P.p);
3343 strat->
P.sig =
pNeg(strat->
P.sig);
3346 if(strat->
P.sig !=
NULL)
3348 if(strat->
P.p !=
NULL)
3355 red_result =
redRing(&strat->
P,strat);
3360 strat->
P.sig =
NULL;
3364 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3380 if (red_result != 0)
3382 PrintS(
"Poly after red: ");
3384 pWrite(strat->
P.GetLmCurrRing());
3386 printf(
"%d\n",red_result);
3391 if(strat->
P.p !=
NULL)
3393 &olddeg,&reduc,strat, red_result);
3396 &olddeg,&reduc,strat, red_result);
3404 if (red_result == 1)
3407 strat->
P.GetP(strat->
lmBin);
3411 (strat->
P).FDeg = (strat->
P).pFDeg();
3423 int pos = strat->
sl+1;
3430 beforetailred =
pCopy(strat->
P.sig);
3436 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
3444 strat->
P.pCleardenom();
3447 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
3448 strat->
P.pCleardenom();
3455 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
3464 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3470 if(strat->
P.sig ==
NULL ||
pLtCmp(beforetailred,strat->
P.sig) == 1)
3474 red_result =
redRing(&strat->
P,strat);
3483 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3489 if(strat->
P.p ==
NULL)
3490 goto case_when_red_result_changed;
3496 for (
int jj = 0; jj<strat->
tl+1; jj++)
3500 strat->
T[jj].is_sigsafe =
FALSE;
3506 for (
int jj = 0; jj<strat->
tl+1; jj++)
3508 strat->
T[jj].is_sigsafe =
FALSE;
3518 if (strat->
minim==1)
3525 strat->
M->m[minimcnt]=strat->
P.p2;
3529 pNext(strat->
M->m[minimcnt])
3539 strat->
T[strat->
tl].is_sigsafe =
FALSE;
3553 strat->
enterS(strat->
P, pos, strat, strat->
tl);
3557 for (
int tk=0; tk<strat->
sl+1; tk++)
3578 for(
int ps=0;ps<strat->
sl+1;ps++)
3586 (strat->
syzmax)*
sizeof(
unsigned long),
3588 *
sizeof(
unsigned long));
3620 unsigned max_cmp =
IDELEMS(F);
3630 for (
int i=0;
i<strat->
sl; ++
i)
3647 for (
unsigned i=cmp+1;
i<=max_cmp; ++
i)
3650 for (
int j=0;
j<strat->
sl; ++
j)
3688 printf(
"---------------------------\n");
3689 Print(
" %d. ELEMENT ADDED TO GCURR:\n",strat->
sl+1);
3712 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
3715 if (strat->
sl>srmax) srmax = strat->
sl;
3719 case_when_red_result_changed:
3727#if SBA_PRINT_ZERO_REDUCTIONS
3736 int pos =
posInSyz(strat, strat->
P.sig);
3740 Print(
"ADDING STUFF TO SYZ : ");
3753 memset(&(strat->
P), 0,
sizeof(strat->
P));
3759 printf(
"\nSigDrop!\n");
3761 printf(
"\nEnded with no SigDrop\n");
3767 if(strat->
P.sig !=
NULL)
3771 memset(&(strat->
P), 0,
sizeof(strat->
P));
3806#ifdef HAVE_TAIL_RING
3822#if SBA_PRINT_SIZE_SYZ
3824 size_syz = strat->
syzl;
3852 for(;
k>=0 && (strat->
L[
k].p1 !=
NULL || strat->
L[
k].p2 !=
NULL);
k--)
3862 for(;
k>=0 && strat->
L[
k].p1 ==
NULL && strat->
L[
k].p2 ==
NULL;
k--)
3865 strat->
enterS(strat->
L[
k], strat->
sl+1, strat, strat->
tl);
3873 for(
k=strat->
sl;
k>=0;
k--)
3910 printf(
"SIZE OF SHDL: %d\n",
IDELEMS(strat->
Shdl));
3914 printf(
" %d. ",oo+1);
3919#if SBA_PRINT_ZERO_REDUCTIONS
3920 printf(
"----------------------------------------------------------\n");
3921 printf(
"ZERO REDUCTIONS: %ld\n",zeroreductions);
3924#if SBA_PRINT_REDUCTION_STEPS
3925 printf(
"----------------------------------------------------------\n");
3926 printf(
"S-REDUCTIONS: %ld\n",sba_reduction_steps);
3928#if SBA_PRINT_OPERATIONS
3929 printf(
"OPERATIONS: %ld\n",sba_operations);
3931#if SBA_PRINT_REDUCTION_STEPS
3932 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3933 printf(
"INTERREDUCTIONS: %ld\n",sba_interreduction_steps);
3935#if SBA_PRINT_OPERATIONS
3936 printf(
"INTERREDUCTION OPERATIONS: %ld\n",sba_interreduction_operations);
3938#if SBA_PRINT_REDUCTION_STEPS
3939 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3940 printf(
"ALL REDUCTIONS: %ld\n",sba_reduction_steps+sba_interreduction_steps);
3941 sba_interreduction_steps = 0;
3942 sba_reduction_steps = 0;
3944#if SBA_PRINT_OPERATIONS
3945 printf(
"ALL OPERATIONS: %ld\n",sba_operations+sba_interreduction_operations);
3946 sba_interreduction_operations = 0;
3950 printf(
"----------------------------------------------------------\n");
3951 printf(
"SIZE OF G: %d / %d\n",size_g,size_g_non_red);
3955#if SBA_PRINT_SIZE_SYZ
3956 printf(
"SIZE OF SYZ: %ld\n",size_syz);
3957 printf(
"----------------------------------------------------------\n");
3960#if SBA_PRINT_PRODUCT_CRITERION
3961 printf(
"PRODUCT CRITERIA: %ld\n",product_criterion);
3962 product_criterion = 0;
3964 return (strat->
Shdl);
4297 int& hilbcount,
int& srmax,
int& lrmax,
int& reduc, ideal
Q,
4300 int Ll_old, red_result = 1;
4306 reduc = olddeg = lrmax = 0;
4311 while (strat->
tl >= 0)
4313 if(!strat->
T[strat->
tl].is_redundant)
4316 h.p = strat->
T[strat->
tl].p;
4317 h.tailRing = strat->
T[strat->
tl].tailRing;
4318 h.t_p = strat->
T[strat->
tl].t_p;
4357 while (strat->
Ll>Ll_old)
4359 strat->
P = strat->
L[strat->
Ll];
4363 PrintS(
"NEXT PAIR TO HANDLE IN INTERRED ALGORITHM\n");
4364 PrintS(
"-------------------------------------------------\n");
4368 printf(
"%d\n",strat->
tl);
4369 PrintS(
"-------------------------------------------------\n");
4402 else if (strat->
P.p1 ==
NULL)
4404 if (strat->
minim > 0)
4411 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
4419 &olddeg,&reduc,strat, red_result);
4422 PrintS(
"Poly before red: ");
4426 red_result = strat->
red2(&strat->
P,strat);
4436 if (red_result == 1)
4439 strat->
P.GetP(strat->
lmBin);
4450 pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4454 pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4462 strat->
P.pCleardenom();
4465 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
4466 strat->
P.pCleardenom();
4473 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
4483 if (strat->
minim==1)
4490 strat->
M->m[minimcnt]=strat->
P.p2;
4494 pNext(strat->
M->m[minimcnt])
4507 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4510 PrintS(
"ELEMENT ADDED TO GCURR DURING INTERRED: ");
4514 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
4518 if (strat->
sl>srmax) srmax = strat->
sl;
4534 memset(&(strat->
P), 0,
sizeof(strat->
P));
4538 while (cc<strat->tl+1)
4540 strat->
T[cc].sig =
pOne();
4543 strat->
sig[cc] = strat->
T[cc].sig;
4544 strat->
sevSig[cc] = strat->
T[cc].sevSig;
4545 strat->
T[cc].is_sigsafe =
TRUE;
4553 for (
int cd=strat->
Ll;
cd>=0;
cd--)
4561 printf(
"\nAfter f5c sorting\n");
4562 for(
int i=0;
i<=strat->
sl;
i++)
4568 PrintS(
"------------------- STRAT S ---------------------\n");
4570 while (cc<strat->tl+1)
4574 printf(
"- - - - - -\n");
4577 PrintS(
"-------------------------------------------------\n");
4578 PrintS(
"------------------- STRAT T ---------------------\n");
4580 while (cc<strat->tl+1)
4584 printf(
"- - - - - -\n");
4587 PrintS(
"-------------------------------------------------\n");
4588 PrintS(
"------------------- STRAT L ---------------------\n");
4590 while (cc<strat->Ll+1)
4596 printf(
"- - - - - -\n");
4599 PrintS(
"-------------------------------------------------\n");
4600 printf(
"F5C DONE\nSTRAT SL: %d -- %d\n",strat->
sl, strat->
currIdx);
4612 int hilbeledeg=1,hilbcount=0,minimcnt=0;
4640#ifdef HAVE_TAIL_RING
4656 while (strat->
Ll >= 0)
4663 while (strat->
Ll >= 0)
4676 while ((strat->
Ll >= 0)
4677 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
4682 if (strat->
Ll<0)
break;
4687 strat->
P = strat->
L[strat->
Ll];
4717 else if (strat->
P.p1 ==
NULL)
4719 if (strat->
minim > 0)
4725 if ((strat->
P.p ==
NULL) && (strat->
P.t_p ==
NULL))
4733 &olddeg,&reduc,strat, red_result);
4736 red_result = strat->
red(&strat->
P,strat);
4746 if (red_result == 1)
4749 strat->
P.GetP(strat->
lmBin);
4758 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4773 strat->
P.pCleardenom();
4777 strat->
P.pCleardenom();
4790 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
4806 if (strat->
minim==1)
4813 strat->
M->m[minimcnt]=strat->
P.p2;
4817 pNext(strat->
M->m[minimcnt])
4831 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4836 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
4844 if (strat->
s_poly(strat))
4849 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4852 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4858 else if (strat->
P.p1 ==
NULL && strat->
minim > 0)
4863 memset(&(strat->
P), 0,
sizeof(strat->
P));
4875 for (
int k = 0;
k <= strat->
sl; ++
k)
4878 for (
int j = 0;
j<=strat->
tl; ++
j)
4908#ifdef HAVE_TAIL_RING
4915 WarnS(
"reduction with S is not yet supported by Letterplace");
4932 for(
int i = 0;
i<=strat->
sl;
i++)
4967 return (strat->
Shdl);
4990 if (
h->IsNull())
return 0;
4998 d =
h->GetpFDeg() +
h->ecart;
5001 h->SetShortExpVector();
5007 h->SetDegStuffReturnLDeg(strat->
LDegLast);
5012 strat->
T[
j].pNorm();
5038 h->SetShortExpVector();
5051 h->SetDegStuffReturnLDeg(strat->
LDegLast);
5061 if (strat->
T[
j].ecart <=
h->ecart)
5062 h->ecart = d -
h->GetpFDeg();
5064 h->ecart = d -
h->GetpFDeg() + strat->
T[
j].ecart -
h->ecart;
5066 d =
h->GetpFDeg() +
h->ecart;
5069 d =
h->SetDegStuffReturnLDeg(strat->
LDegLast);
5078 && ((d >= reddeg) || (pass > strat->
LazyPass)))
5083 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
5084 if (at <= strat->Ll)
static int si_max(const int a, const int b)
CanonicalForm cd(bCommonDen(FF))
static void sort(int **points, int sizePoints)
static CanonicalForm bound(const CFMatrix &M)
KINLINE poly kNoetherTail()
int(* red2)(LObject *L, kStrategy strat)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
pShallowCopyDeleteProc p_shallow_copy_delete
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
char completeReduce_retry
void(* initEcart)(TObject *L)
int(* posInT)(const TSet T, const int tl, LObject &h)
int(* red)(LObject *L, kStrategy strat)
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
char posInLDependsOnLength
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ,...
static FORCE_INLINE number n_EucNorm(number a, const coeffs r)
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
void WerrorS(const char *s)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN idInsertPolyOnPos(ideal I, poly p, int pos)
insert p into I on position pos
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
static BOOLEAN length(leftv result, leftv arg)
KINLINE poly redtailBba_Ring(poly p, int pos, kStrategy strat)
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
void kBucketPolyRedNF(kBucket_pt bucket, poly p1, int l1, poly spNoether)
const poly kBucketGetLm(kBucket_pt bucket)
int kBucketCanonicalize(kBucket_pt bucket)
Canonicalizes Bpoly, i.e. converts polys of buckets into one poly in one bucket: Returns number of bu...
void khCheck(ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat, BOOLEAN reduce)
int ksReducePolySig(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)
int ksReducePolySigRing(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)
ideal kStdShift(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, BOOLEAN rightGB)
ideal kInterRed(ideal F, ideal Q)
void initBba(kStrategy strat)
void initSba(ideal F, kStrategy strat)
int redRing_Z(LObject *h, kStrategy strat)
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
int redFirstShift(LObject *h, kStrategy strat)
int kFindDivisibleByInT_Z(const kStrategy strat, const LObject *L, const int start)
int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject *L)
return -1 if no divisor is found number of first divisor in S, otherwise
int kTestDivisibleByT0_Z(const kStrategy strat, const LObject *L)
tests if T[0] divides the leading monomial of L, returns -1 if not
poly redNFBound(poly h, int &max_ind, int nonorm, kStrategy strat, int bound)
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
int redHoney(LObject *h, kStrategy strat)
static int kFindDivisibleByInS_Z(const kStrategy strat, LObject *L)
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
static long ind_fact_2(long arg)
int redHomog(LObject *h, kStrategy strat)
ideal sba(ideal F0, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
int redLazy(LObject *h, kStrategy strat)
int redSigRing(LObject *h, kStrategy strat)
int kFindDivisibleByInS_noCF(const kStrategy strat, int *max_ind, LObject *L)
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
KINLINE int ksReducePolyTailSig(LObject *PR, TObject *PW, LObject *Red, kStrategy strat)
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
static int redRing_S(LObject *h, kStrategy strat)
int redSig(LObject *h, kStrategy strat)
void kDebugPrint(kStrategy strat)
void f5c(kStrategy strat, int &olddeg, int &minimcnt, int &hilbeledeg, int &hilbcount, int &srmax, int &lrmax, int &reduc, ideal Q, intvec *w, intvec *hilb)
VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
int redRing(LObject *h, 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
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
static int redRing_Z_S(LObject *h, kStrategy strat)
ideal rightgb(ideal F, ideal Q)
void initSbaPos(kStrategy strat)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
void enterSyz(LObject &p, kStrategy strat, int atT)
void enterT(LObject &p, kStrategy strat, int atT)
void enterTShift(LObject p, kStrategy strat, int atT)
BOOLEAN kTest(kStrategy strat)
TObject * kFindDivisibleByInS_T(kStrategy strat, int end_pos, LObject *L, TObject *T, long ecart)
BOOLEAN kTest_TS(kStrategy strat)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
void redtailBbaAlsoLC_Z(LObject *L, int end_pos, kStrategy strat)
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
void initBuchMoraPos(kStrategy strat)
void initS(ideal F, ideal Q, kStrategy strat)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
BOOLEAN kTest_L(LObject *L, kStrategy strat, BOOLEAN testp, int lpos, TSet T, int tlength)
void exitBuchMora(kStrategy strat)
void messageStatSBA(int hilbcount, kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
void initSyzRules(kStrategy strat)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
void cleanT(kStrategy strat)
int posInSyz(const kStrategy strat, poly sig)
void replaceInLAndSAndT(LObject &p, int tj, kStrategy strat)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
void updateResult(ideal r, ideal Q, kStrategy strat)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
poly redtailBba_NF(poly p, kStrategy strat)
void exitSba(kStrategy strat)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void kStratInitChangeTailRing(kStrategy strat)
void initBuchMoraCrit(kStrategy strat)
void completeReduce(kStrategy strat, BOOLEAN withT)
void initBuchMoraPosRing(kStrategy strat)
void postReduceByMonSig(LObject *h, kStrategy strat)
void messageSets(kStrategy strat)
void deleteInS(int i, kStrategy strat)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy)
void initEcartBBA(TObject *h)
void enterSBbaShift(LObject &p, int atS, kStrategy strat, int atR)
void messageStat(int hilbcount, kStrategy strat)
int posInIdealMonFirst(const ideal F, const poly p, int start, int end)
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
void initSbaCrit(kStrategy strat)
void cancelunit(LObject *L, BOOLEAN inNF)
int ksReducePolyGCD(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
int kFindSameLMInT_Z(const kStrategy strat, const LObject *L, const int start=0)
#define REDNF_CANONICALIZE
static void kDeleteLcm(LObject *P)
int ksReducePolyZ(LObject *PR, TObject *PW, poly spNoether=NULL, number *coef=NULL, kStrategy strat=NULL)
#define REDTAIL_CANONICALIZE
static void nc_kBucketPolyRed_NF(kBucket_pt b, poly p, number *c, BOOLEAN reduce)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define __p_GetComp(p, r)
number ndQuotRem(number a, number b, number *r, const coeffs R)
#define omRealloc0Size(addr, o_size, size)
#define TEST_OPT_INTSTRATEGY
#define SI_RESTORE_OPT1(A)
#define TEST_OPT_DEGBOUND
#define TEST_OPT_REDTHROUGH
#define TEST_OPT_REDTAIL_SYZ
#define TEST_OPT_CONTENTSB
#define TEST_OPT_NOT_BUCKETS
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
unsigned long p_GetShortExpVector(const poly p, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
void pEnlargeSet(poly **p, int l, int increment)
long p_Deg(poly a, const ring r)
static int pLength(poly a)
static poly p_Add_q(poly p, poly q, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
#define p_LmEqual(p1, p2, r)
static void p_SetExpV(poly p, int *ev, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static void p_ExpVectorSub(poly p1, poly p2, const ring r)
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
static int p_LmCmp(poly p, poly q, const ring r)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static void p_Delete(poly *p, const ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
static poly p_Mult_mm(poly p, poly m, const ring r)
static poly p_LmDeleteAndNext(poly p, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pGetComp(p)
Component.
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
#define pCopy(p)
return a copy of the poly
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
void PrintS(const char *s)
void Werror(const char *fmt,...)
void rWrite(ring r, BOOLEAN details)
void rDelete(ring r)
unconditionally deletes fields in r
static BOOLEAN rField_is_Z(const ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static BOOLEAN rField_is_Zn(const ring r)
static BOOLEAN rIsLPRing(const ring r)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define rField_is_Ring(R)
static int SI_LOG2_LONG(long v)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_DelDiv(ideal id, const ring r)
delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e., delete id[i], if LT(i) == coeff*mon*L...
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
int F1(int a1, int &r1)
F1.