19 #define PLURAL_INTERNAL_DECLARATIONS 1 38 #define SBA_INTERRED_START 0 39 #define SBA_TAIL_RED 1 40 #define SBA_PRODUCT_CRITERION 0 41 #define SBA_PRINT_ZERO_REDUCTIONS 0 42 #define SBA_PRINT_REDUCTION_STEPS 0 43 #define SBA_PRINT_OPERATIONS 0 44 #define SBA_PRINT_SIZE_G 0 45 #define SBA_PRINT_SIZE_SYZ 0 46 #define SBA_PRINT_PRODUCT_CRITERION 0 49 #if SBA_PRINT_REDUCTION_STEPS 50 long sba_reduction_steps;
51 long sba_interreduction_steps;
53 #if SBA_PRINT_OPERATIONS 55 long sba_interreduction_operations;
90 unsigned long not_sev = ~L->sev;
107 #if defined(PDEBUG) || defined(PDIV_DEBUG) 114 if (!(sevT[
j] & not_sev) &&
129 #if defined(PDEBUG) || defined(PDIV_DEBUG) 135 if (!(sevT[
j] & not_sev) &&
154 #if defined(PDEBUG) || defined(PDIV_DEBUG) 162 if (!(sevT[
j] & not_sev) &&
177 #if defined(PDEBUG) || defined(PDIV_DEBUG) 184 if (!(sevT[
j] & not_sev) &&
199 unsigned long not_sev = ~L->sev;
200 poly p = L->GetLmCurrRing();
208 if (ende>(*
max_ind)) ende=(*max_ind);
217 if (
j > ende)
return -1;
218 #if defined(PDEBUG) || defined(PDIV_DEBUG) 240 if (
j > ende)
return -1;
241 #if defined(PDEBUG) || defined(PDIV_DEBUG) 261 unsigned long not_sev = ~L->sev;
262 poly p = L->GetLmCurrRing();
275 if (
j > ende)
return -1;
276 #if defined(PDEBUG) || defined(PDIV_DEBUG) 298 if (
j > ende)
return -1;
299 #if defined(PDEBUG) || defined(PDIV_DEBUG) 329 int a_ind2 =
ind2(
a);
333 for (
int i = 1;
i <= leadRing->N;
i++)
343 if (
n_GetChar(leadRing->cf) <= k_ind2 + a_ind2)
345 int too_much = k_ind2 + a_ind2 -
n_GetChar(leadRing->cf);
348 for (
int i = 1;
i <= leadRing->N;
i++)
355 while ( (0 <
ind2(s_exp)) && (
ind2(s_exp) <= too_much) )
357 too_much = too_much -
ind2(s_exp);
361 for (
int j = 1;
j <= s_exp;
j++)
381 for (
int i = 1;
i <= leadRing->N;
i++)
434 if (
h->IsNull())
return 0;
446 long reddeg =
h->GetpFDeg();
448 h->SetShortExpVector();
470 if (
h->GetLmTailRing() ==
NULL)
483 if (
h->GetLmTailRing() ==
NULL)
492 h->SetShortExpVector();
550 unsigned long not_sev;
555 h->SetShortExpVector();
557 h_p =
h->GetLmTailRing();
610 #if SBA_PRINT_REDUCTION_STEPS 611 sba_interreduction_steps++;
613 #if SBA_PRINT_OPERATIONS 626 h_p =
h->GetLmTailRing();
635 h->SetShortExpVector();
656 Print(
" lazy: -> L%d\n",at);
669 assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
671 Red->HeadNormalize();
711 PrintS(
"------- IN REDSIG -------\n");
718 PrintS(
"---------------------------\n");
724 unsigned long not_sev;
729 h->SetShortExpVector();
731 h_p =
h->GetLmTailRing();
788 Print(
"BEFORE REDUCTION WITH %d:\n",ii);
789 PrintS(
"--------------------------------\n");
796 PrintS(
"--------------------------------\n");
797 printf(
"INDEX OF REDUCER T: %d\n",ii);
800 #if SBA_PRINT_REDUCTION_STEPS 802 sba_reduction_steps++;
804 #if SBA_PRINT_OPERATIONS 813 Print(
"SigSAFE: %d\n",sigSafe);
828 h_p =
h->GetLmTailRing();
837 h->SetShortExpVector();
860 Print(
" lazy: -> L%d\n",at);
879 printf(
"\nBefore sbaCheckGcdPair ");
pWrite(
h->p);
884 printf(
"\nIntermidiate sbaCheckGcdPair ");
pWrite(
h->p);
889 printf(
"\nAfter sbaCheckGcdPair ");
pWrite(
h->p);
893 beforeredsig =
pCopy(
h->sig);
900 printf(
"\n--------------------------redSig-------------------------------------\n");
901 printf(
"\nBefore redSig:\n");
906 Print(
"------- IN REDSIG -------\n");
913 Print(
"---------------------------\n");
919 unsigned long not_sev;
924 h->SetShortExpVector();
926 h_p =
h->GetLmTailRing();
935 printf(
"\nBefore sbaCheckGcdPair ");
pWrite(
h->p);
940 printf(
"\nIntermidiate sbaCheckGcdPair ");
pWrite(
h->p);
947 printf(
"\nAfter sbaCheckGcdPair ");
pWrite(
h->p);
960 if (
h->GetLmTailRing() ==
NULL)
967 if(
pLtCmp(beforeredsig,
h->sig) == 1)
970 printf(
"\nSigDrop after reduce\n");
pWrite(beforeredsig);
pWrite(
h->sig);
979 printf(
"\nReduced to 0 via redRing. Cancel sigdrop\n");
988 printf(
"\nReduced to this via redRing.SIGDROP\n");
pWrite(
h->p);
1015 if ((
strat->
T[
i].pLength < li)
1045 Print(
"BEFORE REDUCTION WITH %d:\n",ii);
1046 Print(
"--------------------------------\n");
1053 Print(
"--------------------------------\n");
1054 printf(
"INDEX OF REDUCER T: %d\n",ii);
1061 printf(
"\nAfter small reduction:\n");
pWrite(
h->p);
pWrite(
h->sig);
1074 printf(
"\nReducer and Original have same LT. Force it with redRing!\n");
1080 printf(
"\nRedRing reduced it to 0. Perfect\n");
1088 printf(
"\nRedRing reduced it to *.\nHave to sigdrop now\n");
pWrite(
h->p);
1097 #if SBA_PRINT_REDUCTION_STEPS 1099 sba_reduction_steps++;
1101 #if SBA_PRINT_OPERATIONS 1110 Print(
"SigSAFE: %d\n",sigSafe);
1125 h_p =
h->GetLmTailRing();
1134 h->SetShortExpVector();
1147 if (at <= strat->Ll)
1157 Print(
" lazy: -> L%d\n",at);
1170 #define REDTAIL_CANONICALIZE 100 1174 p =
h = L->GetLmTailRing();
1176 return L->GetLmCurrRing();
1184 Ln.sevSig = L->sevSig;
1185 Ln.pLength = L->GetpLength() - 1;
1200 Ln.SetShortExpVector();
1211 if (With ==
NULL)
break;
1242 #if SBA_PRINT_REDUCTION_STEPS 1244 sba_reduction_steps++;
1246 #if SBA_PRINT_OPERATIONS 1248 sba_operations +=
pLength(With->p);
1258 pNext(
h) = Ln.LmExtractAndIter();
1261 }
while (!Ln.IsNull());
1264 if (Ln.IsNull())
goto all_done;
1265 if (! withT) With_s.Init(
currRing);
1272 pNext(
h) = Ln.LmExtractAndIter();
1289 return L->GetLmCurrRing();
1303 long reddeg =
h->GetpFDeg();
1305 unsigned long not_sev;
1307 h->SetShortExpVector();
1308 poly h_p =
h->GetLmTailRing();
1313 if (
j < 0)
return 1;
1346 if ((
strat->
T[
i].pLength < li)
1377 #if SBA_PRINT_REDUCTION_STEPS 1378 sba_interreduction_steps++;
1380 #if SBA_PRINT_OPERATIONS 1393 h_p=
h->GetLmTailRing();
1403 h->SetShortExpVector();
1413 if (at <= strat->Ll)
1428 else if (d != reddeg)
1462 int i,
j,at,pass,ei, ii, h_d;
1463 unsigned long not_sev;
1467 d = reddeg =
h->GetpFDeg() +
h->ecart;
1468 h->SetShortExpVector();
1470 h_p =
h->GetLmTailRing();
1477 if (
j < 0)
return 1;
1498 if ((((
strat->
T[
i].ecart < ei) && (ei>
h->ecart))
1545 Print(
"\nwith T[%d]:",ii);
1553 #if SBA_PRINT_REDUCTION_STEPS 1554 sba_interreduction_steps++;
1556 #if SBA_PRINT_OPERATIONS 1586 else if (
h->t_p!=
NULL)
1595 h->SetShortExpVector();
1597 h_d =
h->SetpFDeg();
1602 h->ecart = d-h_d+ei-
h->ecart;
1617 if (at <= strat->Ll)
1625 Print(
" degree jumped: -> L%d\n",at);
1631 else if (d > reddeg)
1662 #define REDNF_CANONICALIZE 60 1673 P.SetShortExpVector();
1779 P.SetShortExpVector();
1828 P.SetShortExpVector();
1909 P.SetShortExpVector();
1937 P.SetShortExpVector();
1976 int hilbeledeg=1,hilbcount=0,minimcnt=0;
2004 #ifdef HAVE_TAIL_RING 2023 printf(
"\n ------------------------NEW LOOP\n");
2024 printf(
"\nShdl = \n");
2028 for(
int ii = 0; ii<=
strat->
sl;ii++)
2031 printf(
"\n list L\n");
2034 for(iii = 0; iii<=
strat->
Ll; iii++)
2036 printf(
"L[%i]:",iii);
2050 for(iii = 0; iii<=
strat->
Bl; iii++)
2052 printf(
"B[%i]:",iii);
2129 &olddeg,&reduc,
strat, red_result);
2142 if (red_result == 1)
2297 #ifdef HAVE_TAIL_RING 2364 #if SBA_PRINT_ZERO_REDUCTIONS 2365 long zeroreductions = 0;
2367 #if SBA_PRINT_PRODUCT_CRITERION 2368 long product_criterion = 0;
2370 #if SBA_PRINT_SIZE_G 2372 int size_g_non_red = 0;
2374 #if SBA_PRINT_SIZE_SYZ 2378 #if SBA_PRINT_REDUCTION_STEPS 2379 sba_reduction_steps = 0;
2380 sba_interreduction_steps = 0;
2382 #if SBA_PRINT_OPERATIONS 2384 sba_interreduction_operations = 0;
2388 ring sRing, currRingOld;
2393 if (sRing!=currRingOld)
2412 dummy =
pCopy(F->m[0]);
2414 F->m[
i] = F->m[
i+1];
2435 dummy =
pCopy(F->m[0]);
2437 F->m[
i] = F->m[
i+1];
2455 for (
int i=0;
i<
sort->length();++
i)
2456 F->m[
i] = F1->m[(*
sort)[
i]-1];
2470 F->m[
j] = F->m[
j-1];
2488 printf(
"SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
2490 printf(
"ordSgn = %d\n",
currRing->OrdSgn);
2493 int srmax,lrmax, red_result = 1;
2495 int hilbeledeg=1,hilbcount=0,minimcnt=0;
2509 reduc = olddeg = lrmax = 0;
2522 #ifdef HAVE_TAIL_RING 2553 printf(
"\n ------------------------NEW LOOP\n");
2554 printf(
"\nShdl = \n");
2558 for(
int ii = 0; ii<=
strat->
sl;ii++)
2565 for(
int iii = 0; iii<
strat->
syzl; iii++)
2567 printf(
"\nsyz[%i]:\n",iii);
2572 for(
int iii = 0; iii<=
strat->
tl; iii++)
2574 printf(
"\nT[%i]:\n",iii);
2578 printf(
"\n list L\n");
2581 for(iii = 0; iii<=
strat->
Ll; iii++)
2583 printf(
"\nL[%i]:\n",iii);
2630 f5c (
strat, olddeg, minimcnt, hilbeledeg, hilbcount, srmax,
2631 lrmax, reduc,
Q,
w, hilb );
2648 printf(
"\n-------------------------\nThis is the current element P\n");
2658 PrintS(
"SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
2659 PrintS(
"-------------------------------------------------\n");
2664 PrintS(
"-------------------------------------------------\n");
2715 PrintS(
"Poly before red: ");
2719 #if SBA_PRODUCT_CRITERION 2720 if (
strat->
P.prod_crit) {
2721 #if SBA_PRINT_PRODUCT_CRITERION 2722 product_criterion++;
2764 printf(
"\nSigdrop in the reduce. Trying redring\n");
2770 printf(
"\nSigdrop cancelled since redRing reduced to 0\n");
2779 printf(
"\nStill Sigdrop - redRing reduced to:\n");
pWrite(
strat->
P.p);
2790 printf(
"\nToo many blocked reductions\n");
2800 if (red_result != 0) {
2801 PrintS(
"Poly after red: ");
2805 printf(
"%d\n",red_result);
2812 &olddeg,&reduc,
strat, red_result);
2815 &olddeg,&reduc,
strat, red_result);
2823 if (red_result == 1)
2884 printf(
"\n Still sigdrop after redtailSba - it reduced to \n");
pWrite(
strat->
P.p);
2904 printf(
"\nReduced to 0 via redRing. Cancel sigdrop\n");
2912 printf(
"\nReduced to this via redRing.SIGDROP\n");
pWrite(
strat->
P.p);
2921 goto case_when_red_result_changed;
2924 printf(
"\nNach redTailSba: \n");
2931 for (
int jj = 0; jj<
strat->
tl+1; jj++)
2941 for (
int jj = 0; jj<
strat->
tl+1; jj++)
2985 printf(
"\nThis element is added to S\n");
2997 for (
int tk=0; tk<
strat->
sl+1; tk++)
3018 for(
int ps=0;ps<
strat->
sl+1;ps++)
3028 *
sizeof(
unsigned long));
3083 for (
int i=cmp+1;
i<=max_cmp; ++
i) {
3116 printf(
"---------------------------\n");
3152 case_when_red_result_changed:
3158 if (red_result!=2) {
3159 #if SBA_PRINT_ZERO_REDUCTIONS 3172 Print(
"ADDING STUFF TO SYZ : ");
3191 printf(
"\nSigDrop!\n");
3193 printf(
"\nEnded with no SigDrop\n");
3238 #ifdef HAVE_TAIL_RING 3254 #if SBA_PRINT_SIZE_SYZ 3269 #if SBA_PRINT_SIZE_G 3338 #if SBA_PRINT_SIZE_G 3346 printf(
" %d. ",oo+1);
3351 #if SBA_PRINT_ZERO_REDUCTIONS 3352 printf(
"----------------------------------------------------------\n");
3353 printf(
"ZERO REDUCTIONS: %ld\n",zeroreductions);
3356 #if SBA_PRINT_REDUCTION_STEPS 3357 printf(
"----------------------------------------------------------\n");
3358 printf(
"S-REDUCTIONS: %ld\n",sba_reduction_steps);
3360 #if SBA_PRINT_OPERATIONS 3361 printf(
"OPERATIONS: %ld\n",sba_operations);
3363 #if SBA_PRINT_REDUCTION_STEPS 3364 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3365 printf(
"INTERREDUCTIONS: %ld\n",sba_interreduction_steps);
3367 #if SBA_PRINT_OPERATIONS 3368 printf(
"INTERREDUCTION OPERATIONS: %ld\n",sba_interreduction_operations);
3370 #if SBA_PRINT_REDUCTION_STEPS 3371 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
3372 printf(
"ALL REDUCTIONS: %ld\n",sba_reduction_steps+sba_interreduction_steps);
3373 sba_interreduction_steps = 0;
3374 sba_reduction_steps = 0;
3376 #if SBA_PRINT_OPERATIONS 3377 printf(
"ALL OPERATIONS: %ld\n",sba_operations+sba_interreduction_operations);
3378 sba_interreduction_operations = 0;
3381 #if SBA_PRINT_SIZE_G 3382 printf(
"----------------------------------------------------------\n");
3383 printf(
"SIZE OF G: %d / %d\n",size_g,size_g_non_red);
3387 #if SBA_PRINT_SIZE_SYZ 3388 printf(
"SIZE OF SYZ: %ld\n",size_syz);
3389 printf(
"----------------------------------------------------------\n");
3392 #if SBA_PRINT_PRODUCT_CRITERION 3393 printf(
"PRODUCT CRITERIA: %ld\n",product_criterion);
3394 product_criterion = 0;
3697 int& hilbcount,
int& srmax,
int& lrmax,
int& reduc, ideal
Q,
3700 int Ll_old, red_result = 1;
3706 reduc = olddeg = lrmax = 0;
3764 PrintS(
"NEXT PAIR TO HANDLE IN INTERRED ALGORITHM\n");
3765 PrintS(
"-------------------------------------------------\n");
3770 PrintS(
"-------------------------------------------------\n");
3820 &olddeg,&reduc,
strat, red_result);
3823 PrintS(
"Poly before red: ");
3837 if (red_result == 1)
3912 PrintS(
"ELEMENT ADDED TO GCURR DURING INTERRED: ");
3945 while (cc<strat->tl+1)
3968 printf(
"\nAfter f5c sorting\n");
3975 PrintS(
"------------------- STRAT S ---------------------\n");
3977 while (cc<strat->tl+1)
3981 printf(
"- - - - - -\n");
3984 PrintS(
"-------------------------------------------------\n");
3985 PrintS(
"------------------- STRAT T ---------------------\n");
3987 while (cc<strat->tl+1)
3991 printf(
"- - - - - -\n");
3994 PrintS(
"-------------------------------------------------\n");
3995 PrintS(
"------------------- STRAT L ---------------------\n");
3997 while (cc<strat->Ll+1)
4003 printf(
"- - - - - -\n");
4006 PrintS(
"-------------------------------------------------\n");
4014 #ifdef HAVE_SHIFTBBA 4021 int hilbeledeg=1,hilbcount=0,minimcnt=0;
4051 #ifdef HAVE_TAIL_RING 4159 &olddeg,&reduc,
strat, red_result);
4166 if (red_result == 1)
4252 goto red_shrink2zero;
4309 Ln.SetShortExpVector();
4311 if (
j<0) {
k++;
j=-1;}
4317 if (
j<0) {
k++;
j=-1;}
4338 #ifdef HAVE_TAIL_RING 4371 ideal
freegb(ideal I,
int uptodeg,
int lVblock)
4383 WerrorS(
"The input ideal contains incorrectly encoded elements! ");
4407 if (
h->IsNull())
return 0;
4415 d =
h->GetpFDeg() +
h->ecart;
4418 h->SetShortExpVector();
4462 h->SetShortExpVector();
4486 h->ecart = d -
h->GetpFDeg();
4488 h->ecart = d -
h->GetpFDeg() +
strat->
T[
j].ecart -
h->ecart;
4490 d =
h->GetpFDeg() +
h->ecart;
4508 if (at <= strat->Ll)
void initEcartPairBba(LObject *Lp, poly, poly, int, int)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
int kFindNextDivisibleByInS(const kStrategy strat, int start, int max_ind, LObject *L)
BOOLEAN kbTest(kBucket_pt bucket)
Tests
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
int posInSMonFirst(const kStrategy strat, const int length, const poly p)
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 initSbaPos(kStrategy strat)
poly kNF2Bound(ideal F, ideal Q, poly q, int bound, kStrategy strat, int lazyReduce)
int redRing(LObject *h, kStrategy strat)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static void nc_kBucketPolyRed(kBucket_pt b, poly p, number *c)
static CanonicalForm bound(const CFMatrix &M)
static poly p_LmDeleteAndNext(poly p, const ring r)
#define TEST_OPT_DEGBOUND
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
void initBuchMoraPos(kStrategy strat)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
CanonicalForm cd(bCommonDen(FF))
BOOLEAN idInsertPolyOnPos(ideal I, poly p, int pos)
insert p into I on position pos
#define idDelete(H)
delete an ideal
int posInLF5CRing(const LSet set, int start, const int length, LObject *p, const kStrategy)
void messageStat(int hilbcount, kStrategy strat)
void postReduceByMonSig(LObject *h, kStrategy strat)
int posInIdealMonFirst(const ideal F, const poly p, int start, int end)
Compatiblity layer for legacy polynomial operations (over currRing)
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
void initBuchMora(ideal F, ideal Q, kStrategy strat)
static poly p_Mult_mm(poly p, poly m, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
int ideal_isInV(ideal I, int lV)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
#define TEST_OPT_CONTENTSB
BEGIN_NAMESPACE_SINGULARXX const ring const ring tailRing
BOOLEAN posInLDependsOnLength
#define REDNF_CANONICALIZE
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
const poly kBucketGetLm(kBucket_pt bucket)
void initSba(ideal F, kStrategy strat)
BOOLEAN sbaCheckGcdPair(LObject *h, kStrategy strat)
void initSyzRules(kStrategy strat)
void enterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
poly redNFBound(poly h, int &max_ind, int nonorm, kStrategy strat, int bound)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
void deleteInS(int i, kStrategy strat)
pShallowCopyDeleteProc p_shallow_copy_delete
void(* initEcartPair)(LObject *h, poly f, poly g, int ecartF, int ecartG)
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
void cancelunit(LObject *L, BOOLEAN inNF)
void WerrorS(const char *s)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
void initBba(kStrategy strat)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
int redSig(LObject *h, kStrategy strat)
ideal bba(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
ideal sba(ideal F0, ideal Q, intvec *w, intvec *hilb, kStrategy strat)
void enterpairsShift(poly h, int k, int ecart, int pos, kStrategy strat, int atR, int uptodeg, int lV)
int(* red)(LObject *L, kStrategy strat)
void initBuchMoraPosRing(kStrategy strat)
int redHomog(LObject *h, kStrategy strat)
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
int(* posInT)(const TSet T, const int tl, LObject &h)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
#define pGetComp(p)
Component.
static void p_SetExpV(poly p, int *ev, const ring r)
int ksReducePolySig(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)
int redFirstShift(LObject *h, kStrategy strat)
static poly p_Copy(poly p, const ring r)
returns a copy of p
poly redNF(poly h, int &max_ind, int nonorm, kStrategy strat)
char completeReduce_retry
void kStratInitChangeTailRing(kStrategy strat)
#define TEST_OPT_NOT_BUCKETS
void enterT(LObject &p, kStrategy strat, int atT)
int redHoney(LObject *h, kStrategy strat)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void updateSShift(kStrategy strat, int uptodeg, int lV)
ideal kStdShift(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, int uptodeg, int lV)
poly p_Shrink(poly p, int lV, const ring r)
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
int redLazy(LObject *h, kStrategy strat)
void initS(ideal F, ideal Q, kStrategy strat)
poly kNF2(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce)
void enterTShift(LObject p, kStrategy strat, int atT, int uptodeg, int lV)
void kBucketDestroy(kBucket_pt *bucket_pt)
void initEcartPairMora(LObject *Lp, poly, poly, int ecartF, int ecartG)
#define TEST_OPT_INTSTRATEGY
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
void initEcartBBA(TObject *h)
void messageStatSBA(int hilbcount, kStrategy strat)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
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:...
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
ideal kInterRed(ideal F, ideal Q)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
int kFindDivisibleByInS(const kStrategy strat, int *max_ind, LObject *L)
return -1 if no divisor is found number of first divisor in S, otherwise
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
static int p_LmCmp(poly p, poly q, const ring r)
BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject *T, unsigned long expbound)
void initBuchMoraCrit(kStrategy strat)
static int si_max(const int a, const int b)
void exitSba(kStrategy strat)
void PrintS(const char *s)
void deleteHC(LObject *L, kStrategy strat, BOOLEAN fromNext)
void superenterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
int redSigRing(LObject *h, kStrategy strat)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
void f5c(kStrategy strat, int &olddeg, int &minimcnt, int &hilbeledeg, int &hilbcount, int &srmax, int &lrmax, int &reduc, ideal Q, intvec *w, intvec *hilb)
void rWrite(ring r, BOOLEAN details)
static unsigned pLength(poly a)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal freegb(ideal I, int uptodeg, int lVblock)
void initBuchMoraShift(ideal F, ideal Q, kStrategy strat)
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
void rChangeCurrRing(ring r)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
#define REDTAIL_CANONICALIZE
static void p_Delete(poly *p, const ring r)
void initBbaShift(kStrategy strat)
void khCheck(ideal Q, intvec *w, intvec *hilb, int &eledeg, int &count, kStrategy strat)
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
void postReduceByMon(LObject *h, kStrategy strat)
used for GB over ZZ: intermediate reduction by monomial elements background: any known constant eleme...
static BOOLEAN rField_is_Ring(const ring r)
void cleanT(kStrategy strat)
#define SBA_INTERRED_START
void pEnlargeSet(poly **p, int l, int increment)
void superenterpairs(poly h, int k, int ecart, int pos, kStrategy strat, int atR)
void rDelete(ring r)
unconditionally deletes fields in r
long ind_fact_2(long arg)
int posInSyz(const kStrategy strat, poly sig)
static BOOLEAN rField_is_Ring_Z(const ring r)
void pNorm(poly p, const ring R=currRing)
void initSbaCrit(kStrategy strat)
int posInS(const kStrategy strat, const int length, const poly p, const int ecart_p)
#define pGetExpV(p, e)
Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long)...
ideal bbaShift(ideal F, ideal Q, intvec *w, intvec *hilb, kStrategy strat, int uptodeg, int lV)
void completeReduce(kStrategy strat, BOOLEAN withT)
static void p_Setm(poly p, const ring r)
void updateResult(ideal r, ideal Q, kStrategy strat)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
int(* test_PosInT)(const TSet T, const int tl, LObject &h)
void sort(CFArray &A, int l=0)
quick sort A
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
void p_Write(poly p, ring lmRing, ring tailRing)
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
KINLINE int ksReducePolyTailSig(LObject *PR, TObject *PW, LObject *Red, kStrategy strat)
int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
void initEcartNormal(TObject *h)
static poly p_Add_q(poly p, poly q, const ring r)
#define TEST_OPT_REDTHROUGH
void finalReduceByMon(kStrategy strat)
used for GB over ZZ: final reduction by constant elements background: any known constant element of i...
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets
int(* red2)(LObject *L, kStrategy strat)
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
int kBucketCanonicalize(kBucket_pt bucket)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly kNoetherTail()
#define SI_RESTORE_OPT1(A)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
void exitBuchMora(kStrategy strat)
void Werror(const char *fmt,...)
void kDebugPrint(kStrategy strat)
END_NAMESPACE BEGIN_NAMESPACE_SINGULARXX ideal poly int int lazyReduce
void enterSyz(LObject &p, kStrategy strat, int atT)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
#define pCopy(p)
return a copy of the poly
int ksReducePolySigRing(LObject *PR, TObject *PW, long, poly spNoether, number *coef, kStrategy strat)