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
54#if SBA_PRINT_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];
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;
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;
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)
360 if (
j > strat->
tl)
return -1;
361#if defined(PDEBUG) || defined(PDIV_DEBUG)
384 if (
j > strat->
tl)
return -1;
385#if defined(PDEBUG) || defined(PDIV_DEBUG)
403 if (
j > strat->
tl)
return -1;
404#if defined(PDEBUG) || defined(PDIV_DEBUG)
423 unsigned long not_sev = ~L->sev;
424 poly
p = L->GetLmCurrRing();
448 if (
j >
ende)
return -1;
449#if defined(PDEBUG) || defined(PDIV_DEBUG)
467 if (
j >
ende)
return -1;
468#if defined(PDEBUG) || defined(PDIV_DEBUG)
486 unsigned long not_sev = ~L->sev;
487 poly
p = L->GetLmCurrRing();
509 if (
j >
ende)
return -1;
510#if defined(PDEBUG) || defined(PDIV_DEBUG)
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)
556 if (arg <= 0)
return 0;
558 if (arg%2 == 1) { arg--; }
685 if (
h->IsNull())
return 0;
686 if (strat->
tl<0)
return 1;
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();
821 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
843 if (
h->IsNull())
return 0;
844 if (strat->
sl<0)
return 1;
852 h->SetShortExpVector();
862#if STDZ_EXCHANGE_DURING_REDUCTION
886 if (
h->GetLmTailRing() ==
NULL)
912#if STDZ_EXCHANGE_DURING_REDUCTION
939 if (
h->GetLmCurrRing() ==
NULL)
944 h->SetShortExpVector();
953 if (strat->
tl<0)
return 1;
954 if (
h->IsNull())
return 0;
967 h->SetShortExpVector();
989 if (
h->GetLmTailRing() ==
NULL)
1002 if (
h->GetLmTailRing() ==
NULL)
1008 h->SetShortExpVector();
1033 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
1055 if (strat->
sl<0)
return 1;
1056 if (
h->IsNull())
return 0;
1066 h->SetShortExpVector();
1085 if (
h->GetLmTailRing() ==
NULL)
1098 if (
h->GetLmTailRing() ==
NULL)
1103 h->SetShortExpVector();
1116 if (strat->
tl<0)
return 1;
1128 h->SetShortExpVector();
1129 h_p =
h->GetLmTailRing();
1134 if (
j < 0)
return 1;
1136 li = strat->
T[
j].pLength;
1146 if (li<=0) li=strat->
T[
j].GetpLength();
1156 if ((strat->
T[
i].pLength < li)
1164 li = strat->
T[
i].pLength;
1165 if (li<=0) li=strat->
T[
i].GetpLength();
1189#if SBA_PRINT_REDUCTION_STEPS
1192#if SBA_PRINT_OPERATIONS
1205 h_p =
h->GetLmTailRing();
1221 else if (
h->t_p!=
NULL)
1240 else if (
h->t_p!=
NULL)
1249 h->SetShortExpVector();
1299 assume(
PR->GetLmCurrRing() !=
PW->GetLmCurrRing());
1301 Red->HeadNormalize();
1335 if (strat->
tl<0)
return 1;
1341 PrintS(
"------- IN REDSIG -------\n");
1348 PrintS(
"---------------------------\n");
1360 h->SetShortExpVector();
1361 h_p =
h->GetLmTailRing();
1371 li = strat->
T[
j].pLength;
1372 if (li<=0) li=strat->
T[
j].GetpLength();
1389 if ((strat->
T[
i].pLength < li)
1397 li = strat->
T[
i].pLength;
1398 if (li<=0) li=strat->
T[
i].GetpLength();
1420 Print(
"BEFORE REDUCTION WITH %d:\n",
ii);
1421 PrintS(
"--------------------------------\n");
1428 PrintS(
"--------------------------------\n");
1429 printf(
"INDEX OF REDUCER T: %d\n",
ii);
1432#if SBA_PRINT_REDUCTION_STEPS
1436#if SBA_PRINT_OPERATIONS
1460 h_p =
h->GetLmTailRing();
1466 h->SetShortExpVector();
1515 if (strat->
tl<0)
return 1;
1521 Print(
"------- IN REDSIG -------\n");
1528 Print(
"---------------------------\n");
1540 h->SetShortExpVector();
1541 h_p =
h->GetLmTailRing();
1563 h->i_r1 = strat->
tl;
1566 if (
h->GetLmTailRing() ==
NULL)
1596 li = strat->
T[
j].pLength;
1597 if (li<=0) li=strat->
T[
j].GetpLength();
1613 if ((strat->
T[
i].pLength < li)
1621 li = strat->
T[
i].pLength;
1622 if (li<=0) li=strat->
T[
i].GetpLength();
1644 Print(
"BEFORE REDUCTION WITH %d:\n",
ii);
1645 Print(
"--------------------------------\n");
1652 Print(
"--------------------------------\n");
1653 printf(
"INDEX OF REDUCER T: %d\n",
ii);
1681#if SBA_PRINT_REDUCTION_STEPS
1685#if SBA_PRINT_OPERATIONS
1709 h_p =
h->GetLmTailRing();
1715 h->SetShortExpVector();
1754 p =
h = L->GetLmTailRing();
1756 return L->GetLmCurrRing();
1764 Ln.sevSig = L->sevSig;
1765 Ln.pLength = L->GetpLength() - 1;
1780 Ln.SetShortExpVector();
1815#if SBA_PRINT_REDUCTION_STEPS
1819#if SBA_PRINT_OPERATIONS
1834 }
while (!
Ln.IsNull());
1862 return L->GetLmCurrRing();
1871 if (strat->
tl<0)
return 1;
1881 h->SetShortExpVector();
1882 poly
h_p =
h->GetLmTailRing();
1887 if (
j < 0)
return 1;
1889 li = strat->
T[
j].pLength;
1900 if (li<=0) li=strat->
T[
j].GetpLength();
1910 if ((strat->
T[
i].pLength < li)
1918 li = strat->
T[
i].pLength;
1919 if (li<=0) li=strat->
T[
i].GetpLength();
1944#if SBA_PRINT_REDUCTION_STEPS
1947#if SBA_PRINT_OPERATIONS
1960 h_p=
h->GetLmTailRing();
1977 else if (
h->t_p!=
NULL)
1996 else if (
h->t_p!=
NULL)
2005 h->SetShortExpVector();
2044 if (
h->pTotalDeg() >= (
long)strat->
tailRing->bitmask)
2076 if (strat->
tl<0)
return 1;
2086 d =
reddeg =
h->GetpFDeg() +
h->ecart;
2087 h->SetShortExpVector();
2088 h_p =
h->GetLmTailRing();
2094 if (
j < 0)
return 1;
2096 ei = strat->
T[
j].ecart;
2097 li = strat->
T[
j].pLength;
2106 if (li<=0) li=strat->
T[
j].GetpLength();
2114 if (
i > strat->
tl)
break;
2119 strat->
T[
i].GetpLength();
2120 if (((strat->
T[
i].ecart <
ei) && (
ei>
h->ecart))
2121 || ((strat->
T[
i].ecart <=
h->ecart) && (strat->
T[
i].pLength < li)))
2126 ei = strat->
T[
i].ecart;
2127 li = strat->
T[
i].pLength;
2176#if SBA_PRINT_REDUCTION_STEPS
2179#if SBA_PRINT_OPERATIONS
2206 else if (
h->t_p!=
NULL)
2225 else if (
h->t_p!=
NULL)
2233 h->SetShortExpVector();
2234 h_d =
h->SetpFDeg();
2274 Print(
" degree jumped: -> L%d\n",
at);
2284 if (
h->pTotalDeg()+
h->ecart >= (
long)strat->
tailRing->bitmask)
2321 P.SetShortExpVector();
2444 P.SetShortExpVector();
2521 P.SetShortExpVector();
2590 P.SetShortExpVector();
2604 P.SetShortExpVector();
2658#ifdef HAVE_TAIL_RING
2674 while (strat->
Ll >= 0)
2681 while (strat->
Ll >= 0)
2694 while ((strat->
Ll >= 0)
2695 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
2700 if (strat->
Ll<0)
break;
2705 strat->
P = strat->
L[strat->
Ll];
2735 else if (strat->
P.p1 ==
NULL)
2737 if (strat->
minim > 0)
2743 if ((strat->
P.p ==
NULL) && (strat->
P.t_p ==
NULL))
2767 strat->
P.GetP(strat->
lmBin);
2776 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
2791 strat->
P.pCleardenom();
2795 strat->
P.pCleardenom();
2816 if (strat->
minim==1)
2837 strat->
P.SetShortExpVector();
2844 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2867 if (strat->
s_poly(strat))
2872 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
2878 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2882 else if (strat->
P.p1 ==
NULL && strat->
minim > 0)
2924#ifdef HAVE_TAIL_RING
2946 for(
int i = 0;
i<=strat->
sl;
i++)
2981 return (strat->
Shdl);
2993#if SBA_PRINT_ZERO_REDUCTIONS
2996#if SBA_PRINT_PRODUCT_CRITERION
3003#if SBA_PRINT_SIZE_SYZ
3007#if SBA_PRINT_REDUCTION_STEPS
3011#if SBA_PRINT_OPERATIONS
3043 F->m[
i] = F->m[
i+1];
3066 F->m[
i] = F->m[
i+1];
3099 F->m[
j] = F->m[
j-1];
3113#if SBA_INTERRED_START
3117 printf(
"SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
3151#ifdef HAVE_TAIL_RING
3169 strat->
enterS(strat->
L[strat->
Ll-(
i)], strat->
sl+1, strat, strat->
tl);
3179 while (strat->
Ll >= 0)
3222 strat->
P = strat->
L[strat->
Ll];
3228 if (!strat->
rewCrit2(strat->
P.sig, ~strat->
P.sevSig, strat->
P.GetLmCurrRing(), strat, strat->
P.checked+1))
3232 PrintS(
"SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
3233 PrintS(
"-------------------------------------------------\n");
3238 PrintS(
"-------------------------------------------------\n");
3273 else if (strat->
P.p1 ==
NULL)
3275 if (strat->
minim > 0)
3281 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
3289 PrintS(
"Poly before red: ");
3293#if SBA_PRODUCT_CRITERION
3294 if (strat->
P.prod_crit)
3296#if SBA_PRINT_PRODUCT_CRITERION
3299 int pos =
posInSyz(strat, strat->
P.sig);
3325 strat->
P.p =
pNeg(strat->
P.p);
3326 strat->
P.sig =
pNeg(strat->
P.sig);
3329 if(strat->
P.sig !=
NULL)
3331 if(strat->
P.p !=
NULL)
3343 strat->
P.sig =
NULL;
3347 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3365 PrintS(
"Poly after red: ");
3367 pWrite(strat->
P.GetLmCurrRing());
3374 if(strat->
P.p !=
NULL)
3378 message((strat->honey ? strat->P.ecart : 0),
3390 strat->
P.GetP(strat->
lmBin);
3394 (strat->
P).FDeg = (strat->
P).pFDeg();
3406 int pos = strat->
sl+1;
3427 strat->
P.pCleardenom();
3431 strat->
P.pCleardenom();
3447 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3466 strat->
enterS(strat->
P, 0, strat, strat->
tl);
3472 if(strat->
P.p ==
NULL)
3479 for (
int jj = 0;
jj<strat->
tl+1;
jj++)
3489 for (
int jj = 0;
jj<strat->
tl+1;
jj++)
3501 if (strat->
minim==1)
3522 strat->
T[strat->
tl].is_sigsafe =
FALSE;
3536 strat->
enterS(strat->
P, pos, strat, strat->
tl);
3540 for (
int tk=0;
tk<strat->
sl+1;
tk++)
3571 *
sizeof(
unsigned long));
3613 for (
int i=0;
i<strat->
sl; ++
i)
3633 for (
int j=0;
j<strat->
sl; ++
j)
3671 printf(
"---------------------------\n");
3672 Print(
" %d. ELEMENT ADDED TO GCURR:\n",strat->
sl+1);
3710#if SBA_PRINT_ZERO_REDUCTIONS
3719 int pos =
posInSyz(strat, strat->
P.sig);
3723 Print(
"ADDING STUFF TO SYZ : ");
3744 printf(
"\nEnded with no SigDrop\n");
3750 if(strat->
P.sig !=
NULL)
3789#ifdef HAVE_TAIL_RING
3805#if SBA_PRINT_SIZE_SYZ
3835 for(;
k>=0 && (strat->
L[
k].p1 !=
NULL || strat->
L[
k].p2 !=
NULL);
k--)
3845 for(;
k>=0 && strat->
L[
k].p1 ==
NULL && strat->
L[
k].p2 ==
NULL;
k--)
3848 strat->
enterS(strat->
L[
k], strat->
sl+1, strat, strat->
tl);
3856 for(
k=strat->
sl;
k>=0;
k--)
3902#if SBA_PRINT_ZERO_REDUCTIONS
3903 printf(
"----------------------------------------------------------\n");
3907#if SBA_PRINT_REDUCTION_STEPS
3908 printf(
"----------------------------------------------------------\n");
3911#if SBA_PRINT_OPERATIONS
3914#if SBA_PRINT_REDUCTION_STEPS
3915 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3918#if SBA_PRINT_OPERATIONS
3921#if SBA_PRINT_REDUCTION_STEPS
3922 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3927#if SBA_PRINT_OPERATIONS
3933 printf(
"----------------------------------------------------------\n");
3938#if SBA_PRINT_SIZE_SYZ
3940 printf(
"----------------------------------------------------------\n");
3943#if SBA_PRINT_PRODUCT_CRITERION
3947 return (strat->
Shdl);
4298 while (strat->
tl >= 0)
4300 if(!strat->
T[strat->
tl].is_redundant)
4303 h.p = strat->
T[strat->
tl].p;
4304 h.tailRing = strat->
T[strat->
tl].tailRing;
4305 h.t_p = strat->
T[strat->
tl].t_p;
4346 strat->
P = strat->
L[strat->
Ll];
4350 PrintS(
"NEXT PAIR TO HANDLE IN INTERRED ALGORITHM\n");
4351 PrintS(
"-------------------------------------------------\n");
4356 PrintS(
"-------------------------------------------------\n");
4389 else if (strat->
P.p1 ==
NULL)
4391 if (strat->
minim > 0)
4398 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
4409 PrintS(
"Poly before red: ");
4426 strat->
P.GetP(strat->
lmBin);
4437 pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4441 pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4449 strat->
P.pCleardenom();
4453 strat->
P.pCleardenom();
4470 if (strat->
minim==1)
4494 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4497 PrintS(
"ELEMENT ADDED TO GCURR DURING INTERRED: ");
4532 strat->
T[
cc].is_sigsafe =
TRUE;
4540 for (
int cd=strat->
Ll;
cd>=0;
cd--)
4548 printf(
"\nAfter f5c sorting\n");
4549 for(
int i=0;
i<=strat->
sl;
i++)
4555 PrintS(
"------------------- STRAT S ---------------------\n");
4564 PrintS(
"-------------------------------------------------\n");
4565 PrintS(
"------------------- STRAT T ---------------------\n");
4574 PrintS(
"-------------------------------------------------\n");
4575 PrintS(
"------------------- STRAT L ---------------------\n");
4586 PrintS(
"-------------------------------------------------\n");
4627#ifdef HAVE_TAIL_RING
4643 while (strat->
Ll >= 0)
4650 while (strat->
Ll >= 0)
4663 while ((strat->
Ll >= 0)
4664 && (strat->
L[strat->
Ll].p1!=
NULL) && (strat->
L[strat->
Ll].p2!=
NULL)
4669 if (strat->
Ll<0)
break;
4674 strat->
P = strat->
L[strat->
Ll];
4704 else if (strat->
P.p1 ==
NULL)
4706 if (strat->
minim > 0)
4712 if ((strat->
P.p ==
NULL) && (strat->
P.t_p ==
NULL))
4736 strat->
P.GetP(strat->
lmBin);
4745 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4760 strat->
P.pCleardenom();
4764 strat->
P.pCleardenom();
4793 if (strat->
minim==1)
4818 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4831 if (strat->
s_poly(strat))
4836 int pos=
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
4839 strat->
enterS(strat->
P, pos, strat, strat->
tl);
4845 else if (strat->
P.p1 ==
NULL && strat->
minim > 0)
4862 for (
int k = 0;
k <= strat->
sl; ++
k)
4865 for (
int j = 0;
j<=strat->
tl; ++
j)
4895#ifdef HAVE_TAIL_RING
4902 WarnS(
"reduction with S is not yet supported by Letterplace");
4919 for(
int i = 0;
i<=strat->
sl;
i++)
4954 return (strat->
Shdl);
4977 if (
h->IsNull())
return 0;
4985 d =
h->GetpFDeg() +
h->ecart;
4988 h->SetShortExpVector();
4994 h->SetDegStuffReturnLDeg(strat->
LDegLast);
4999 strat->
T[
j].pNorm();
5025 h->SetShortExpVector();
5038 h->SetDegStuffReturnLDeg(strat->
LDegLast);
5048 if (strat->
T[
j].ecart <=
h->ecart)
5049 h->ecart = d -
h->GetpFDeg();
5051 h->ecart = d -
h->GetpFDeg() + strat->
T[
j].ecart -
h->ecart;
5053 d =
h->GetpFDeg() +
h->ecart;
5056 d =
h->SetDegStuffReturnLDeg(strat->
LDegLast);
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(* 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, 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)
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)
ideal rightgb(ideal F, const ideal Q)
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)
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)
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)