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) &&
436 if (strat->
T[jj].ecart<=ecart)
438 if (strat->
T[jj].pLength<=0)
439 strat->
T[jj].pLength=strat->
T[jj].GetpLength();
441 else if (strat->
T[
j].pLength > strat->
T[jj].pLength)
443 if (strat->
T[
j].pLength<=2)
return j;
458 else if (r== -1) r=jj;
459 if (strat->
T[jj].ecart<=ecart)
470 unsigned long not_sev = ~L->sev;
471 poly
p = L->GetLmCurrRing();
485 ende=
posInS(strat,*max_ind,
p,0)+1;
486 if (ende>(*max_ind)) ende=(*max_ind);
495 if (
j > ende)
return -1;
496#if defined(PDEBUG) || defined(PDIV_DEBUG)
500 if ( !(strat->
sevS[
j] & not_sev) &&
514 if (
j > ende)
return -1;
515#if defined(PDEBUG) || defined(PDIV_DEBUG)
519 if ( !(strat->
sevS[
j] & not_sev) &&
533 unsigned long not_sev = ~L->sev;
534 poly
p = L->GetLmCurrRing();
548 ende=
posInS(strat,*max_ind,
p,0)+1;
549 if (ende>(*max_ind)) ende=(*max_ind);
556 if (
j > ende)
return -1;
557#if defined(PDEBUG) || defined(PDIV_DEBUG)
561 if ( !(strat->
sevS[
j] & not_sev) &&
573 unsigned long not_sev = ~L->sev;
574 poly
p = L->GetLmCurrRing();
585 if (
j > ende)
return -1;
586#if defined(PDEBUG) || defined(PDIV_DEBUG)
590 if ( !(strat->
sevS[
j] & not_sev) &&
602 if (arg <= 0)
return 0;
604 if (arg%2 == 1) { arg--; }
620 poly zeroPoly =
NULL;
621 unsigned long a = (
unsigned long)
pGetCoeff(
p);
628 for (
int i = 1;
i <= leadRing->N;
i++)
637 poly lead_mult =
p_ISet(1, tailRing);
638 if (
n_GetChar(leadRing->cf) <= k_ind2 + a_ind2)
640 int too_much = k_ind2 + a_ind2 -
n_GetChar(leadRing->cf);
642 zeroPoly =
p_ISet(a, tailRing);
643 for (
int i = 1;
i <= leadRing->N;
i++)
656 for (
int j = 1;
j <= s_exp;
j++)
673 p_Setm(lead_mult, tailRing);
674 zeroPoly =
p_Mult_mm(zeroPoly, lead_mult, tailRing);
676 for (
int i = 1;
i <= leadRing->N;
i++)
726 if (
h->IsNull())
return 0;
727 if (strat->
tl<0)
return 1;
737 long reddeg =
h->GetpFDeg();
739 h->SetShortExpVector();
746#if STDZ_EXCHANGE_DURING_REDUCTION
774 if (
h->GetLmTailRing() ==
NULL)
803#if STDZ_EXCHANGE_DURING_REDUCTION
828 if (
h->GetLmTailRing() ==
NULL)
837 h->SetShortExpVector();
842 (strat->
Ll >= 0) && ((d > reddeg) || (pass > strat->
LazyPass)))
847 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
862 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
867 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
884 if (
h->IsNull())
return 0;
885 if (strat->
sl<0)
return 1;
893 h->SetShortExpVector();
894 int max_ind=strat->
sl;
903#if STDZ_EXCHANGE_DURING_REDUCTION
927 if (
h->GetLmTailRing() ==
NULL)
953#if STDZ_EXCHANGE_DURING_REDUCTION
967 redtailBbaAlsoLC_Z_S(&h2,
j, strat);
980 if (
h->GetLmCurrRing() ==
NULL)
985 h->SetShortExpVector();
994 if (strat->
tl<0)
return 1;
995 if (
h->IsNull())
return 0;
1006 long reddeg =
h->GetpFDeg();
1008 h->SetShortExpVector();
1027 h->i_r1 = strat->
tl;
1030 if (
h->GetLmTailRing() ==
NULL)
1043 if (
h->GetLmTailRing() ==
NULL)
1049 h->SetShortExpVector();
1054 (strat->
Ll >= 0) && ((d > reddeg) || (pass > strat->
LazyPass)))
1059 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1060 if (at <= strat->Ll)
1074 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
1079 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1096 if (strat->
sl<0)
return 1;
1097 if (
h->IsNull())
return 0;
1107 h->SetShortExpVector();
1126 if (
h->GetLmTailRing() ==
NULL)
1139 if (
h->GetLmTailRing() ==
NULL)
1144 h->SetShortExpVector();
1156 if (strat->
tl<0)
return 1;
1161 int i,
j,at,pass,cnt,ii;
1168 h->SetShortExpVector();
1169 h_p =
h->GetLmTailRing();
1174 if (
j < 0)
return 1;
1176 li = strat->
T[
j].pLength;
1184 if (test_opt_length)
1186 if (li<=0) li=strat->
T[
j].GetpLength();
1189 unsigned long not_sev = ~ h->sev;
1196 if ((strat->
T[
i].pLength < li)
1204 li = strat->
T[
i].pLength;
1205 if (li<=0) li=strat->
T[
i].GetpLength();
1229#if SBA_PRINT_REDUCTION_STEPS
1230 sba_interreduction_steps++;
1232#if SBA_PRINT_OPERATIONS
1233 sba_interreduction_operations +=
pLength(strat->
T[ii].p);
1245 h_p =
h->GetLmTailRing();
1261 else if (
h->t_p!=
NULL)
1280 else if (
h->t_p!=
NULL)
1289 h->SetShortExpVector();
1301 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1302 if (at <= strat->Ll)
1313 int dummy=strat->
sl;
1320 Print(
" lazy: -> L%d\n",at);
1339 assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1341 Red->HeadNormalize();
1375 if (strat->
tl<0)
return 1;
1381 PrintS(
"------- IN REDSIG -------\n");
1388 PrintS(
"---------------------------\n");
1391 int i,
j,at,pass, ii;
1394 unsigned long not_sev;
1400 h->SetShortExpVector();
1401 h_p =
h->GetLmTailRing();
1411 li = strat->
T[
j].pLength;
1412 if (li<=0) li=strat->
T[
j].GetpLength();
1420 if (test_opt_length)
1429 if ((strat->
T[
i].pLength < li)
1437 li = strat->
T[
i].pLength;
1438 if (li<=0) li=strat->
T[
i].GetpLength();
1460 Print(
"BEFORE REDUCTION WITH %d:\n",ii);
1461 PrintS(
"--------------------------------\n");
1468 PrintS(
"--------------------------------\n");
1469 printf(
"INDEX OF REDUCER T: %d\n",ii);
1472#if SBA_PRINT_REDUCTION_STEPS
1474 sba_reduction_steps++;
1476#if SBA_PRINT_OPERATIONS
1478 sba_operations +=
pLength(strat->
T[ii].p);
1485 Print(
"SigSAFE: %d\n",sigSafe);
1500 h_p =
h->GetLmTailRing();
1506 h->SetShortExpVector();
1518 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1519 if (at <= strat->Ll)
1521 int dummy=strat->
sl;
1529 Print(
" lazy: -> L%d\n",at);
1553 beforeredsig =
pCopy(
h->sig);
1555 if (strat->
tl<0)
return 1;
1561 Print(
"------- IN REDSIG -------\n");
1568 Print(
"---------------------------\n");
1571 int i,
j,at,pass, ii;
1574 unsigned long not_sev;
1580 h->SetShortExpVector();
1581 h_p =
h->GetLmTailRing();
1603 h->i_r1 = strat->
tl;
1606 if (
h->GetLmTailRing() ==
NULL)
1613 if(
pLtCmp(beforeredsig,
h->sig) == 1)
1636 li = strat->
T[
j].pLength;
1637 if (li<=0) li=strat->
T[
j].GetpLength();
1644 if (test_opt_length)
1653 if ((strat->
T[
i].pLength < li)
1661 li = strat->
T[
i].pLength;
1662 if (li<=0) li=strat->
T[
i].GetpLength();
1684 Print(
"BEFORE REDUCTION WITH %d:\n",ii);
1685 Print(
"--------------------------------\n");
1692 Print(
"--------------------------------\n");
1693 printf(
"INDEX OF REDUCER T: %d\n",ii);
1721#if SBA_PRINT_REDUCTION_STEPS
1723 sba_reduction_steps++;
1725#if SBA_PRINT_OPERATIONS
1727 sba_operations +=
pLength(strat->
T[ii].p);
1734 Print(
"SigSAFE: %d\n",sigSafe);
1749 h_p =
h->GetLmTailRing();
1755 h->SetShortExpVector();
1767 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
1768 if (at <= strat->Ll)
1770 int dummy=strat->
sl;
1778 Print(
" lazy: -> L%d\n",at);
1794 p =
h = L->GetLmTailRing();
1796 return L->GetLmCurrRing();
1804 Ln.sevSig = L->sevSig;
1805 Ln.pLength = L->GetpLength() - 1;
1820 Ln.SetShortExpVector();
1826 With = &(strat->
T[
j]);
1831 if (With ==
NULL)
break;
1855#if SBA_PRINT_REDUCTION_STEPS
1857 sba_reduction_steps++;
1859#if SBA_PRINT_OPERATIONS
1861 sba_operations +=
pLength(With->p);
1871 pNext(
h) = Ln.LmExtractAndIter();
1874 }
while (!Ln.IsNull());
1877 if (Ln.IsNull())
goto all_done;
1878 if (! withT) With_s.Init(
currRing);
1885 pNext(
h) = Ln.LmExtractAndIter();
1902 return L->GetLmCurrRing();
1911 if (strat->
tl<0)
return 1;
1917 long reddeg =
h->GetpFDeg();
1921 h->SetShortExpVector();
1922 poly h_p =
h->GetLmTailRing();
1927 if (
j < 0)
return 1;
1929 li = strat->
T[
j].pLength;
1938 if (test_opt_length)
1940 if (li<=0) li=strat->
T[
j].GetpLength();
1943 unsigned long not_sev = ~ h->sev;
1950 if ((strat->
T[
i].pLength < li)
1958 li = strat->
T[
i].pLength;
1959 if (li<=0) li=strat->
T[
i].GetpLength();
1984#if SBA_PRINT_REDUCTION_STEPS
1985 sba_interreduction_steps++;
1987#if SBA_PRINT_OPERATIONS
1988 sba_interreduction_operations +=
pLength(strat->
T[ii].p);
2000 h_p=
h->GetLmTailRing();
2017 else if (
h->t_p!=
NULL)
2036 else if (
h->t_p!=
NULL)
2045 h->SetShortExpVector();
2051 (strat->
Ll >= 0) && ((d > reddeg) || (pass > strat->
LazyPass)))
2054 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2055 if (at <= strat->Ll)
2067 int dummy=strat->
sl;
2080 else if (d != reddeg)
2084 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
2089 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2116 if (strat->
tl<0)
return 1;
2120 int i,
j,at,pass,ei, ii, h_d;
2126 d = reddeg =
h->GetpFDeg() +
h->ecart;
2127 h->SetShortExpVector();
2128 h_p =
h->GetLmTailRing();
2134 if (
j < 0)
return 1;
2137 ei = strat->
T[ii].ecart;
2157 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2175 Print(
"\nwith T[%d]:",ii);
2182#if SBA_PRINT_REDUCTION_STEPS
2183 sba_interreduction_steps++;
2185#if SBA_PRINT_OPERATIONS
2186 sba_interreduction_operations += strat->
T[ii].pLength;
2212 else if (
h->t_p!=
NULL)
2231 else if (
h->t_p!=
NULL)
2239 h->SetShortExpVector();
2240 h_d =
h->SetpFDeg();
2245 h->ecart = d-h_d+ei-
h->ecart;
2257 && ((d > reddeg) || (pass > strat->
LazyPass))))
2261 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2262 if (at <= strat->Ll)
2273 int dummy=strat->
sl;
2280 Print(
" degree jumped: -> L%d\n",at);
2286 else if (d > reddeg)
2290 if (
h->pTotalDeg()+
h->ecart >= (
long)strat->
tailRing->bitmask)
2295 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
2327 P.SetShortExpVector();
2330 if(is_ring) nonorm=
TRUE;
2448 P.SetShortExpVector();
2523 P.SetShortExpVector();
2586 P.SetShortExpVector();
2600 P.SetShortExpVector();
2626 int hilbeledeg=1,hilbcount=0,minimcnt=0;
2649 withT = ! strat->
homog;
2656#ifdef HAVE_TAIL_RING
2672 while (strat->
Ll >= 0)
2679 while (strat->
Ll >= 0)
2692 while ((strat->
Ll >= 0)
2693 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
2698 if (strat->
Ll<0)
break;
2703 strat->
P = strat->
L[strat->
Ll];
2733 else if (strat->
P.p1 ==
NULL)
2735 if (strat->
minim > 0)
2741 if ((strat->
P.p ==
NULL) && (strat->
P.t_p ==
NULL))
2749 &olddeg,&reduc,strat, red_result);
2752 red_result = strat->
red(&strat->
P,strat);
2762 if (red_result == 1)
2765 strat->
P.GetP(strat->
lmBin);
2774 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
2789 strat->
P.pCleardenom();
2793 strat->
P.pCleardenom();
2802 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
2814 if (strat->
minim==1)
2821 strat->
M->m[minimcnt]=strat->
P.p2;
2825 pNext(strat->
M->m[minimcnt])
2835 strat->
P.SetShortExpVector();
2842 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2857 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
2865 if (strat->
s_poly(strat))
2870 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
2876 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2880 else if (strat->
P.p1 ==
NULL && strat->
minim > 0)
2922#ifdef HAVE_TAIL_RING
2944 for(
int i = 0;
i<=strat->
sl;
i++)
2979 return (strat->
Shdl);
2991#if SBA_PRINT_ZERO_REDUCTIONS
2992 long zeroreductions = 0;
2994#if SBA_PRINT_PRODUCT_CRITERION
2995 long product_criterion = 0;
2999 int size_g_non_red = 0;
3001#if SBA_PRINT_SIZE_SYZ
3005#if SBA_PRINT_REDUCTION_STEPS
3006 sba_reduction_steps = 0;
3007 sba_interreduction_steps = 0;
3009#if SBA_PRINT_OPERATIONS
3011 sba_interreduction_operations = 0;
3020 if (sRing!=currRingOld)
3039 dummy =
pCopy(F->m[0]);
3041 F->m[
i] = F->m[
i+1];
3062 dummy =
pCopy(F->m[0]);
3064 F->m[
i] = F->m[
i+1];
3082 for (
int i=0;
i<
sort->length();++
i)
3097 F->m[
j] = F->m[
j-1];
3111#if SBA_INTERRED_START
3115 printf(
"SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
3117 printf(
"ordSgn = %d\n",
currRing->OrdSgn);
3120 int srmax,lrmax, red_result = 1;
3122 int hilbeledeg=1,hilbcount=0,minimcnt=0;
3136 reduc = olddeg = lrmax = 0;
3149#ifdef HAVE_TAIL_RING
3167 strat->
enterS(strat->
L[strat->
Ll-(
i)], strat->
sl+1, strat, strat->
tl);
3177 while (strat->
Ll >= 0)
3179 if (strat->
Ll > lrmax) lrmax =strat->
Ll;
3209 f5c ( strat, olddeg, minimcnt, hilbeledeg, hilbcount, srmax,
3210 lrmax, reduc,
Q,
w, hilb );
3220 strat->
P = strat->
L[strat->
Ll];
3226 if (!strat->
rewCrit2(strat->
P.sig, ~strat->
P.sevSig, strat->
P.GetLmCurrRing(), strat, strat->
P.checked+1))
3230 PrintS(
"SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
3231 PrintS(
"-------------------------------------------------\n");
3236 PrintS(
"-------------------------------------------------\n");
3271 else if (strat->
P.p1 ==
NULL)
3273 if (strat->
minim > 0)
3279 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
3287 PrintS(
"Poly before red: ");
3291#if SBA_PRODUCT_CRITERION
3292 if (strat->
P.prod_crit)
3294#if SBA_PRINT_PRODUCT_CRITERION
3295 product_criterion++;
3297 int pos =
posInSyz(strat, strat->
P.sig);
3304 red_result = strat->
red(&strat->
P,strat);
3307 red_result = strat->
red(&strat->
P,strat);
3323 strat->
P.p =
pNeg(strat->
P.p);
3324 strat->
P.sig =
pNeg(strat->
P.sig);
3327 if(strat->
P.sig !=
NULL)
3329 if(strat->
P.p !=
NULL)
3336 red_result =
redRing(&strat->
P,strat);
3341 strat->
P.sig =
NULL;
3345 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3361 if (red_result != 0)
3363 PrintS(
"Poly after red: ");
3365 pWrite(strat->
P.GetLmCurrRing());
3367 printf(
"%d\n",red_result);
3372 if(strat->
P.p !=
NULL)
3374 &olddeg,&reduc,strat, red_result);
3377 &olddeg,&reduc,strat, red_result);
3385 if (red_result == 1)
3388 strat->
P.GetP(strat->
lmBin);
3392 (strat->
P).FDeg = (strat->
P).pFDeg();
3404 int pos = strat->
sl+1;
3410 beforetailred =
pCopy(strat->
P.sig);
3415 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
3423 strat->
P.pCleardenom();
3426 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
3427 strat->
P.pCleardenom();
3434 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
3443 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3449 if(strat->
P.sig ==
NULL ||
pLtCmp(beforetailred,strat->
P.sig) == 1)
3453 red_result =
redRing(&strat->
P,strat);
3462 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3468 if(strat->
P.p ==
NULL)
3469 goto case_when_red_result_changed;
3475 for (
int jj = 0; jj<strat->
tl+1; jj++)
3479 strat->
T[jj].is_sigsafe =
FALSE;
3485 for (
int jj = 0; jj<strat->
tl+1; jj++)
3487 strat->
T[jj].is_sigsafe =
FALSE;
3497 if (strat->
minim==1)
3504 strat->
M->m[minimcnt]=strat->
P.p2;
3508 pNext(strat->
M->m[minimcnt])
3518 strat->
T[strat->
tl].is_sigsafe =
FALSE;
3532 strat->
enterS(strat->
P, pos, strat, strat->
tl);
3536 for (
int tk=0; tk<strat->
sl+1; tk++)
3557 for(
int ps=0;ps<strat->
sl+1;ps++)
3565 (strat->
syzmax)*
sizeof(
unsigned long),
3567 *
sizeof(
unsigned long));
3599 unsigned max_cmp =
IDELEMS(F);
3609 for (
int i=0;
i<strat->
sl; ++
i)
3626 for (
unsigned i=cmp+1;
i<=max_cmp; ++
i)
3629 for (
int j=0;
j<strat->
sl; ++
j)
3667 printf(
"---------------------------\n");
3668 Print(
" %d. ELEMENT ADDED TO GCURR:\n",strat->
sl+1);
3691 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
3694 if (strat->
sl>srmax) srmax = strat->
sl;
3698 case_when_red_result_changed:
3706#if SBA_PRINT_ZERO_REDUCTIONS
3715 int pos =
posInSyz(strat, strat->
P.sig);
3719 Print(
"ADDING STUFF TO SYZ : ");
3738 printf(
"\nSigDrop!\n");
3740 printf(
"\nEnded with no SigDrop\n");
3746 if(strat->
P.sig !=
NULL)
3785#ifdef HAVE_TAIL_RING
3801#if SBA_PRINT_SIZE_SYZ
3803 size_syz = strat->
syzl;
3830 for(;
k>=0 && (strat->
L[
k].p1 !=
NULL || strat->
L[
k].p2 !=
NULL);
k--)
3840 for(;
k>=0 && strat->
L[
k].p1 ==
NULL && strat->
L[
k].p2 ==
NULL;
k--)
3843 strat->
enterS(strat->
L[
k], strat->
sl+1, strat, strat->
tl);
3851 for(
k=strat->
sl;
k>=0;
k--)
3887 printf(
"SIZE OF SHDL: %d\n",
IDELEMS(strat->
Shdl));
3891 printf(
" %d. ",oo+1);
3896#if SBA_PRINT_ZERO_REDUCTIONS
3897 printf(
"----------------------------------------------------------\n");
3898 printf(
"ZERO REDUCTIONS: %ld\n",zeroreductions);
3901#if SBA_PRINT_REDUCTION_STEPS
3902 printf(
"----------------------------------------------------------\n");
3903 printf(
"S-REDUCTIONS: %ld\n",sba_reduction_steps);
3905#if SBA_PRINT_OPERATIONS
3906 printf(
"OPERATIONS: %ld\n",sba_operations);
3908#if SBA_PRINT_REDUCTION_STEPS
3909 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3910 printf(
"INTERREDUCTIONS: %ld\n",sba_interreduction_steps);
3912#if SBA_PRINT_OPERATIONS
3913 printf(
"INTERREDUCTION OPERATIONS: %ld\n",sba_interreduction_operations);
3915#if SBA_PRINT_REDUCTION_STEPS
3916 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3917 printf(
"ALL REDUCTIONS: %ld\n",sba_reduction_steps+sba_interreduction_steps);
3918 sba_interreduction_steps = 0;
3919 sba_reduction_steps = 0;
3921#if SBA_PRINT_OPERATIONS
3922 printf(
"ALL OPERATIONS: %ld\n",sba_operations+sba_interreduction_operations);
3923 sba_interreduction_operations = 0;
3927 printf(
"----------------------------------------------------------\n");
3928 printf(
"SIZE OF G: %d / %d\n",size_g,size_g_non_red);
3932#if SBA_PRINT_SIZE_SYZ
3933 printf(
"SIZE OF SYZ: %ld\n",size_syz);
3934 printf(
"----------------------------------------------------------\n");
3937#if SBA_PRINT_PRODUCT_CRITERION
3938 printf(
"PRODUCT CRITERIA: %ld\n",product_criterion);
3939 product_criterion = 0;
3941 return (strat->
Shdl);
4283 int& hilbcount,
int& srmax,
int& lrmax,
int& reduc, ideal
Q,
4286 int Ll_old, red_result = 1;
4292 reduc = olddeg = lrmax = 0;
4297 while (strat->
tl >= 0)
4299 if(!strat->
T[strat->
tl].is_redundant)
4302 h.p = strat->
T[strat->
tl].p;
4303 h.tailRing = strat->
T[strat->
tl].tailRing;
4304 h.t_p = strat->
T[strat->
tl].t_p;
4343 while (strat->
Ll>Ll_old)
4345 strat->
P = strat->
L[strat->
Ll];
4349 PrintS(
"NEXT PAIR TO HANDLE IN INTERRED ALGORITHM\n");
4350 PrintS(
"-------------------------------------------------\n");
4354 printf(
"%d\n",strat->
tl);
4355 PrintS(
"-------------------------------------------------\n");
4388 else if (strat->
P.p1 ==
NULL)
4390 if (strat->
minim > 0)
4397 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
4405 &olddeg,&reduc,strat, red_result);
4408 PrintS(
"Poly before red: ");
4412 red_result = strat->
red2(&strat->
P,strat);
4422 if (red_result == 1)
4425 strat->
P.GetP(strat->
lmBin);
4436 pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4440 pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4448 strat->
P.pCleardenom();
4451 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
4452 strat->
P.pCleardenom();
4459 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
4469 if (strat->
minim==1)
4476 strat->
M->m[minimcnt]=strat->
P.p2;
4480 pNext(strat->
M->m[minimcnt])
4493 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4496 PrintS(
"ELEMENT ADDED TO GCURR DURING INTERRED: ");
4500 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
4504 if (strat->
sl>srmax) srmax = strat->
sl;
4524 while (cc<strat->tl+1)
4526 strat->
T[cc].sig =
pOne();
4529 strat->
sig[cc] = strat->
T[cc].sig;
4530 strat->
sevSig[cc] = strat->
T[cc].sevSig;
4531 strat->
T[cc].is_sigsafe =
TRUE;
4539 for (
int cd=strat->
Ll;
cd>=0;
cd--)
4547 printf(
"\nAfter f5c sorting\n");
4548 for(
int i=0;
i<=strat->
sl;
i++)
4554 PrintS(
"------------------- STRAT S ---------------------\n");
4556 while (cc<strat->tl+1)
4560 printf(
"- - - - - -\n");
4563 PrintS(
"-------------------------------------------------\n");
4564 PrintS(
"------------------- STRAT T ---------------------\n");
4566 while (cc<strat->tl+1)
4570 printf(
"- - - - - -\n");
4573 PrintS(
"-------------------------------------------------\n");
4574 PrintS(
"------------------- STRAT L ---------------------\n");
4576 while (cc<strat->Ll+1)
4582 printf(
"- - - - - -\n");
4585 PrintS(
"-------------------------------------------------\n");
4586 printf(
"F5C DONE\nSTRAT SL: %d -- %d\n",strat->
sl, strat->
currIdx);
4598 int hilbeledeg=1,hilbcount=0,minimcnt=0;
4626#ifdef HAVE_TAIL_RING
4642 while (strat->
Ll >= 0)
4649 while (strat->
Ll >= 0)
4662 while ((strat->
Ll >= 0)
4663 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
4668 if (strat->
Ll<0)
break;
4673 strat->
P = strat->
L[strat->
Ll];
4703 else if (strat->
P.p1 ==
NULL)
4705 if (strat->
minim > 0)
4711 if ((strat->
P.p ==
NULL) && (strat->
P.t_p ==
NULL))
4719 &olddeg,&reduc,strat, red_result);
4722 red_result = strat->
red(&strat->
P,strat);
4732 if (red_result == 1)
4735 strat->
P.GetP(strat->
lmBin);
4744 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4759 strat->
P.pCleardenom();
4763 strat->
P.pCleardenom();
4776 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
4792 if (strat->
minim==1)
4799 strat->
M->m[minimcnt]=strat->
P.p2;
4803 pNext(strat->
M->m[minimcnt])
4817 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4822 if (hilb!=
NULL)
khCheck(
Q,
w,hilb,hilbeledeg,hilbcount,strat);
4830 if (strat->
s_poly(strat))
4835 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4838 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4844 else if (strat->
P.p1 ==
NULL && strat->
minim > 0)
4861 for (
int k = 0;
k <= strat->
sl; ++
k)
4864 for (
int j = 0;
j<=strat->
tl; ++
j)
4894#ifdef HAVE_TAIL_RING
4901 WarnS(
"reduction with S is not yet supported by Letterplace");
4918 for(
int i = 0;
i<=strat->
sl;
i++)
4953 return (strat->
Shdl);
4976 if (
h->IsNull())
return 0;
4984 d =
h->GetpFDeg() +
h->ecart;
4987 h->SetShortExpVector();
4993 h->SetDegStuffReturnLDeg(strat->
LDegLast);
4998 strat->
T[
j].pNorm();
5024 h->SetShortExpVector();
5037 h->SetDegStuffReturnLDeg(strat->
LDegLast);
5047 if (strat->
T[
j].ecart <=
h->ecart)
5048 h->ecart = d -
h->GetpFDeg();
5050 h->ecart = d -
h->GetpFDeg() + strat->
T[
j].ecart -
h->ecart;
5052 d =
h->GetpFDeg() +
h->ecart;
5055 d =
h->SetDegStuffReturnLDeg(strat->
LDegLast);
5064 && ((d >= reddeg) || (pass > strat->
LazyPass)))
5069 at = strat->
posInL(strat->
L,strat->
Ll,
h,strat);
5070 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, bigintmat *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, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, BOOLEAN rightGB)
ideal kInterRed(ideal F, const 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)
ideal sba(ideal F0, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
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)
int kFindDivisibleByInT_ecart(const kStrategy strat, const LObject *L, const int ecart)
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)
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)
ideal rightgb(ideal F, const ideal Q)
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
ideal bbaShift(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
static int redRing_S(LObject *h, kStrategy strat)
int redSig(LObject *h, kStrategy strat)
void kDebugPrint(kStrategy strat)
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 bba(ideal F, ideal Q, intvec *w, bigintmat *hilb, kStrategy strat)
static int redRing_Z_S(LObject *h, kStrategy strat)
void f5c(kStrategy strat, int &olddeg, int &minimcnt, int &hilbeledeg, int &hilbcount, int &srmax, int &lrmax, int &reduc, ideal Q, intvec *w, bigintmat *hilb)
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)
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)
void initHilbCrit(ideal, ideal, bigintmat **hilb, kStrategy strat)
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)
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 rHasLocalOrMixedOrdering(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)
#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.