1679 #if SBA_PRINT_ZERO_REDUCTIONS
1680 long zeroreductions = 0;
1682 #if SBA_PRINT_PRODUCT_CRITERION
1683 long product_criterion = 0;
1685 #if SBA_PRINT_SIZE_G
1687 int size_g_non_red = 0;
1689 #if SBA_PRINT_SIZE_SYZ
1693 #if SBA_PRINT_REDUCTION_STEPS
1694 sba_reduction_steps = 0;
1695 sba_interreduction_steps = 0;
1697 #if SBA_PRINT_OPERATIONS
1699 sba_interreduction_operations = 0;
1703 ring sRing, currRingOld;
1708 if (sRing!=currRingOld)
1718 F->m[
i] = F1->m[(*sort)[
i]-1];
1719 #if SBA_INTERRED_START
1723 printf(
"SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
1725 printf(
"ordSgn = %d\n",
currRing->OrdSgn);
1732 int srmax,lrmax, red_result = 1;
1734 int hilbeledeg=1,hilbcount=0,minimcnt=0;
1749 reduc = olddeg = lrmax = 0;
1767 PrintS(
"bba start GB: currRing: ");
1775 #ifdef HAVE_TAIL_RING
1791 while (strat->
Ll >= 0)
1793 if (strat->
Ll > lrmax) lrmax =strat->
Ll;
1824 f5c ( strat, olddeg, minimcnt, hilbeledeg, hilbcount, srmax,
1825 lrmax, reduc,
Q, w, hilb );
1836 strat->
P = strat->
L[strat->
Ll];
1840 if (!strat->
rewCrit2(strat->
P.sig, ~strat->
P.sevSig, strat->
P.GetLmCurrRing(),
strat, strat->
P.checked+1)) {
1843 Print(
"SIG OF NEXT PAIR TO HANDLE IN SIG-BASED ALGORITHM\n");
1844 Print(
"-------------------------------------------------\n");
1849 Print(
"-------------------------------------------------\n");
1886 else if (strat->
P.p1 ==
NULL)
1888 if (strat->
minim > 0)
1893 if (strat->
P.p ==
NULL && strat->
P.t_p ==
NULL)
1901 Print(
"Poly before red: ");
1905 #if SBA_PRODUCT_CRITERION
1906 if (strat->
P.prod_crit) {
1907 #if SBA_PRINT_PRODUCT_CRITERION
1908 product_criterion++;
1910 int pos =
posInSyz(strat, strat->
P.sig);
1912 if (strat->
P.lcm!=
NULL)
1916 red_result = strat->
red(&strat->
P,strat);
1919 red_result = strat->
red(&strat->
P,strat);
1933 if (red_result != 0) {
1934 Print(
"Poly after red: ");
1936 pWrite(strat->
P.GetLmCurrRing());
1938 printf(
"%d\n",red_result);
1948 if (red_result == 1)
1951 strat->
P.GetP(strat->
lmBin);
1955 (strat->
P).FDeg = (strat->
P).pFDeg();
1967 int pos = strat->
sl+1;
1982 strat->
P.pCleardenom();
1985 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
1986 strat->
P.pCleardenom();
1993 strat->
P.p =
redtailSba(&(strat->
P),pos-1,strat, withT);
2002 for (
int jj = 0; jj<strat->
tl+1; jj++)
2006 strat->
T[jj].is_sigsafe =
FALSE;
2012 for (
int jj = 0; jj<strat->
tl+1; jj++)
2014 strat->
T[jj].is_sigsafe =
FALSE;
2028 if (strat->
minim==1)
2035 strat->
M->m[minimcnt]=strat->
P.p2;
2039 pNext(strat->
M->m[minimcnt])
2049 strat->
T[strat->
tl].is_sigsafe =
FALSE;
2062 strat->
enterS(strat->
P, pos, strat, strat->
tl);
2066 for (
int tk=0; tk<strat->
sl+1; tk++)
2087 for(
int ps=0;ps<strat->
sl+1;ps++)
2095 (strat->
syzmax)*
sizeof(
unsigned long),
2097 *
sizeof(
unsigned long));
2100 Q.sig =
pCopy(strat->
P.sig);
2138 for (
int i=0; i<strat->
sl; ++
i) {
2152 for (
int i=cmp+1; i<=max_cmp; ++
i) {
2154 for (
int j=0;
j<strat->
sl; ++
j) {
2185 printf(
"---------------------------\n");
2186 Print(
" %d. ELEMENT ADDED TO GCURR:\n",strat->
sl+1);
2209 if (hilb!=
NULL)
khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
2211 if (strat->
P.lcm!=
NULL)
2217 if (strat->
sl>srmax) srmax = strat->
sl;
2226 if (red_result!=2) {
2227 #if SBA_PRINT_ZERO_REDUCTIONS
2230 int pos =
posInSyz(strat, strat->
P.sig);
2234 Print(
"ADDING STUFF TO SYZ : ");
2246 memset(&(strat->
P), 0,
sizeof(strat->
P));
2283 #ifdef HAVE_TAIL_RING
2291 for(i=strat->
sl;i>=0;i--) strat->
S_2_R[
i]=-1;
2298 #if SBA_PRINT_SIZE_SYZ
2300 size_syz = strat->
syzl;
2320 #if SBA_PRINT_SIZE_G
2334 #if SBA_PRINT_SIZE_G
2338 printf(
"SIZE OF SHDL: %d\n",
IDELEMS(strat->
Shdl));
2342 printf(
" %d. ",oo+1);
2347 #if SBA_PRINT_ZERO_REDUCTIONS
2348 printf(
"----------------------------------------------------------\n");
2349 printf(
"ZERO REDUCTIONS: %ld\n",zeroreductions);
2352 #if SBA_PRINT_REDUCTION_STEPS
2353 printf(
"----------------------------------------------------------\n");
2354 printf(
"S-REDUCTIONS: %ld\n",sba_reduction_steps);
2356 #if SBA_PRINT_OPERATIONS
2357 printf(
"OPERATIONS: %ld\n",sba_operations);
2359 #if SBA_PRINT_REDUCTION_STEPS
2360 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
2361 printf(
"INTERREDUCTIONS: %ld\n",sba_interreduction_steps);
2363 #if SBA_PRINT_OPERATIONS
2364 printf(
"INTERREDUCTION OPERATIONS: %ld\n",sba_interreduction_operations);
2366 #if SBA_PRINT_REDUCTION_STEPS
2367 printf(
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
2368 printf(
"ALL REDUCTIONS: %ld\n",sba_reduction_steps+sba_interreduction_steps);
2369 sba_interreduction_steps = 0;
2370 sba_reduction_steps = 0;
2372 #if SBA_PRINT_OPERATIONS
2373 printf(
"ALL OPERATIONS: %ld\n",sba_operations+sba_interreduction_operations);
2374 sba_interreduction_operations = 0;
2377 #if SBA_PRINT_SIZE_G
2378 printf(
"----------------------------------------------------------\n");
2379 printf(
"SIZE OF G: %d / %d\n",size_g,size_g_non_red);
2383 #if SBA_PRINT_SIZE_SYZ
2384 printf(
"SIZE OF SYZ: %ld\n",size_syz);
2385 printf(
"----------------------------------------------------------\n");
2388 #if SBA_PRINT_PRODUCT_CRITERION
2389 printf(
"PRODUCT CRITERIA: %ld\n",product_criterion);
2390 product_criterion = 0;
2392 return (strat->
Shdl);
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
#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)
void initSbaPos(kStrategy strat)
void messageStat(int hilbcount, kStrategy strat)
void enterSyz(LObject p, kStrategy strat, int atT)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
void enterT(LObject p, kStrategy strat, int atT)
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)
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(* 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)
unsigned long p_GetShortExpVector(poly p, const ring r)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
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)
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)
ideal idInit(int idsize, int rank)
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)
intvec * idSort(ideal id, BOOLEAN nolex=TRUE, const ring R=currRing)
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)
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
poly redtailSba(LObject *L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize)
void Werror(const char *fmt,...)
void kDebugPrint(kStrategy strat)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
#define pCopy(p)
return a copy of the poly