1881 #if SBA_PRINT_ZERO_REDUCTIONS
1882 long zeroreductions = 0;
1884 #if SBA_PRINT_PRODUCT_CRITERION
1885 long product_criterion = 0;
1887 #if SBA_PRINT_SIZE_G
1889 int size_g_non_red = 0;
1891 #if SBA_PRINT_SIZE_SYZ
1895 #if SBA_PRINT_REDUCTION_STEPS
1896 sba_reduction_steps = 0;
1897 sba_interreduction_steps = 0;
1899 #if SBA_PRINT_OPERATIONS
1901 sba_interreduction_operations = 0;
1905 ring sRing, currRingOld;
1910 if (sRing!=currRingOld)
1920 F->m[
i] = F1->m[(*sort)[
i]-1];
1921 #if SBA_INTERRED_START
1925 printf(
"SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
1927 printf(
"ordSgn = %d\n",
currRing->OrdSgn);
1930 int srmax,lrmax, red_result = 1;
1932 int hilbeledeg=1,hilbcount=0,minimcnt=0;
1947 reduc = olddeg = lrmax = 0;
1965 PrintS(
"bba start GB: currRing: ");
1973 #ifdef HAVE_TAIL_RING
1989 while (strat->
Ll >= 0)
1991 if (strat->
Ll > lrmax) lrmax =strat->
Ll;
2021 f5c ( strat, olddeg, minimcnt, hilbeledeg, hilbcount, srmax,
2022 lrmax, reduc,
Q, w, hilb );
2033 strat->
P = strat->
L[strat->
Ll];
2037 if (!strat->
rewCrit2(strat->
P.sig, ~strat->
P.sevSig, strat->
P.GetLmCurrRing(),
strat, strat->
P.checked+1)) {
2040 Print(
"SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
2041 Print(
"-------------------------------------------------\n");
2046 Print(
"-------------------------------------------------\n");
2083 else if (strat->
P.p1 ==
NULL)
2085 if (strat->
minim > 0)
2090 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
2098 Print(
"Poly before red: ");
2102 #if SBA_PRODUCT_CRITERION
2103 if (strat->
P.prod_crit) {
2104 #if SBA_PRINT_PRODUCT_CRITERION
2105 product_criterion++;
2107 int pos =
posInSyz(strat, strat->
P.sig);
2109 if (strat->
P.lcm!=
NULL)
2113 red_result = strat->
red(&strat->
P,strat);
2116 red_result = strat->
red(&strat->
P,strat);
2130 if (red_result != 0) {
2131 Print(
"Poly after red: ");
2133 pWrite(strat->
P.GetLmCurrRing());
2135 printf(
"%d\n",red_result);
2145 if (red_result == 1)
2148 strat->
P.GetP(strat->
lmBin);
2152 (strat->
P).FDeg = (strat->
P).pFDeg();
2164 int pos = strat->
sl+1;
2179 strat->
P.pCleardenom();
2182 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
2183 strat->
P.pCleardenom();
2190 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
2199 for (
int jj = 0; jj<strat->
tl+1; jj++)
2203 strat->
T[jj].is_sigsafe =
FALSE;
2209 for (
int jj = 0; jj<strat->
tl+1; jj++)
2211 strat->
T[jj].is_sigsafe =
FALSE;
2225 if (strat->
minim==1)
2232 strat->
M->m[minimcnt]=strat->
P.p2;
2236 pNext(strat->
M->m[minimcnt])
2246 strat->
T[strat->
tl].is_sigsafe =
FALSE;
2259 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2263 for (
int tk=0; tk<strat->
sl+1; tk++)
2284 for(
int ps=0;ps<strat->
sl+1;ps++)
2292 (strat->
syzmax)*
sizeof(
unsigned long),
2294 *
sizeof(
unsigned long));
2297 Q.sig =
pCopy(strat->
P.sig);
2335 for (
int i=0; i<strat->
sl; ++
i) {
2349 for (
int i=cmp+1; i<=max_cmp; ++
i) {
2351 for (
int j=0;
j<strat->
sl; ++
j) {
2382 printf(
"---------------------------\n");
2383 Print(
" %d. ELEMENT ADDED TO GCURR:\n",strat->
sl+1);
2406 if (hilb!=
NULL)
khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
2408 if (strat->
P.lcm!=
NULL)
2414 if (strat->
sl>srmax) srmax = strat->
sl;
2423 if (red_result!=2) {
2424 #if SBA_PRINT_ZERO_REDUCTIONS
2427 int pos =
posInSyz(strat, strat->
P.sig);
2431 Print(
"ADDING STUFF TO SYZ : ");
2443 memset(&(strat->
P), 0,
sizeof(strat->
P));
2480 #ifdef HAVE_TAIL_RING
2488 for(i=strat->
sl;i>=0;i--) strat->
S_2_R[
i]=-1;
2495 #if SBA_PRINT_SIZE_SYZ
2497 size_syz = strat->
syzl;
2517 #if SBA_PRINT_SIZE_G
2531 #if SBA_PRINT_SIZE_G
2535 printf(
"SIZE OF SHDL: %d\n",
IDELEMS(strat->
Shdl));
2539 printf(
" %d. ",oo+1);
2544 #if SBA_PRINT_ZERO_REDUCTIONS
2545 printf(
"----------------------------------------------------------\n");
2546 printf(
"ZERO REDUCTIONS: %ld\n",zeroreductions);
2549 #if SBA_PRINT_REDUCTION_STEPS
2550 printf(
"----------------------------------------------------------\n");
2551 printf(
"S-REDUCTIONS: %ld\n",sba_reduction_steps);
2553 #if SBA_PRINT_OPERATIONS
2554 printf(
"OPERATIONS: %ld\n",sba_operations);
2556 #if SBA_PRINT_REDUCTION_STEPS
2557 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
2558 printf(
"INTERREDUCTIONS: %ld\n",sba_interreduction_steps);
2560 #if SBA_PRINT_OPERATIONS
2561 printf(
"INTERREDUCTION OPERATIONS: %ld\n",sba_interreduction_operations);
2563 #if SBA_PRINT_REDUCTION_STEPS
2564 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
2565 printf(
"ALL REDUCTIONS: %ld\n",sba_reduction_steps+sba_interreduction_steps);
2566 sba_interreduction_steps = 0;
2567 sba_reduction_steps = 0;
2569 #if SBA_PRINT_OPERATIONS
2570 printf(
"ALL OPERATIONS: %ld\n",sba_operations+sba_interreduction_operations);
2571 sba_interreduction_operations = 0;
2574 #if SBA_PRINT_SIZE_G
2575 printf(
"----------------------------------------------------------\n");
2576 printf(
"SIZE OF G: %d / %d\n",size_g,size_g_non_red);
2580 #if SBA_PRINT_SIZE_SYZ
2581 printf(
"SIZE OF SYZ: %ld\n",size_syz);
2582 printf(
"----------------------------------------------------------\n");
2585 #if SBA_PRINT_PRODUCT_CRITERION
2586 printf(
"PRODUCT CRITERIA: %ld\n",product_criterion);
2587 product_criterion = 0;
2589 return (strat->
Shdl);
#define omRealloc0Size(addr, o_size, size)
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
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)
void messageStat(int hilbcount, kStrategy strat)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
BOOLEAN(* rewCrit2)(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start)
void initSba(ideal F, kStrategy strat)
void initSyzRules(kStrategy strat)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
pShallowCopyDeleteProc p_shallow_copy_delete
ring sbaRing(kStrategy strat, const ring r, BOOLEAN, int)
void WerrorS(const char *s)
void initSbaBuchMora(ideal F, ideal Q, kStrategy strat)
int(* red)(LObject *L, kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
void enterpairsSig(poly h, poly hSig, int hFrom, int k, int ecart, int pos, kStrategy strat, int atR)
#define pGetComp(p)
Component.
static int pLength(poly a)
static void p_SetExpV(poly p, int *ev, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
char completeReduce_retry
void kStratInitChangeTailRing(kStrategy strat)
#define TEST_OPT_NOT_BUCKETS
void enterT(LObject &p, kStrategy strat, int atT)
void(* initEcart)(TObject *L)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define TEST_OPT_INTSTRATEGY
void initHilbCrit(ideal, ideal, intvec **hilb, kStrategy strat)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
ideal kInterRed(ideal F, ideal Q)
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 exitSba(kStrategy strat)
void PrintS(const char *s)
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)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void rChangeCurrRing(ring r)
BOOLEAN kCheckSpolyCreation(LObject *L, kStrategy strat, poly &m1, poly &m2)
static void p_Delete(poly *p, const ring r)
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 BOOLEAN rField_is_Ring(const ring r)
void cleanT(kStrategy strat)
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
int posInSyz(const kStrategy strat, poly sig)
void initSbaCrit(kStrategy strat)
#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)...
void completeReduce(kStrategy strat, BOOLEAN withT)
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
int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
static poly p_Add_q(poly p, poly q, const ring r)
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void Werror(const char *fmt,...)
void kDebugPrint(kStrategy strat)
void enterSyz(LObject &p, kStrategy strat, int atT)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
#define pCopy(p)
return a copy of the poly