Changeset 8e903f in git for kernel/GBEngine/kutil.cc
- Timestamp:
- Apr 24, 2020, 7:01:53 PM (4 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 34ac5c4176020d530d61125750c8457430cd7f22
- Parents:
- b94a72a3900cee27c0409f0d8cfe58d9e880654c756dc7155d3cba64f765acc3475e5c4e12cdbbff
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2020-04-24 19:01:53+02:00
- git-committer:
- GitHub <noreply@github.com>2020-04-24 19:01:53+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kutil.cc
r756dc7 r8e903f 234 234 235 235 #ifdef HAVE_SHIFTBBA 236 static inline int pLPDivComp(poly p, poly q) { 236 static inline int pLPDivComp(poly p, poly q) 237 { 237 238 if ((currRing->pCompIndex < 0) || (__p_GetComp(p,currRing) == __p_GetComp(q,currRing))) 238 239 { … … 755 756 return -1; 756 757 } 757 758 #endif 759 760 #ifdef HAVE_SHIFTBBA 758 761 int kFindInTShift(poly p, kStrategy strat) 759 762 { … … 1600 1603 k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing); 1601 1604 1602 if (!rHasLocalOrMixedOrdering(currRing)) { 1605 if (!rHasLocalOrMixedOrdering(currRing)) 1606 { 1603 1607 unsigned long sev = pGetShortExpVector(gcd); 1604 1608 1605 for (int j = 0; j < strat->sl; j++) { 1609 for (int j = 0; j < strat->sl; j++) 1610 { 1606 1611 if (j == i) 1607 1612 continue; 1608 1613 1609 if (n_DivBy(d, pGetCoeff(strat->S[j]), currRing->cf) && 1610 !(strat->sevS[j] & ~sev) && 1611 p_LmDivisibleBy(strat->S[j], gcd, currRing)) { 1614 if (n_DivBy(d, pGetCoeff(strat->S[j]), currRing->cf) 1615 && !(strat->sevS[j] & ~sev) 1616 && p_LmDivisibleBy(strat->S[j], gcd, currRing)) 1617 { 1612 1618 nDelete(&d); 1613 1619 nDelete(&s); … … 3230 3236 strat->Bl = -1; 3231 3237 } 3238 3232 3239 /*2 3233 3240 *the pairset B of pairs of type (s[i],p) is complete now. It will be updated … … 7287 7294 return FALSE; 7288 7295 int found = -1; 7289 for (int i=strat->Bl; i>-1; i--) { 7296 for (int i=strat->Bl; i>-1; i--) 7297 { 7290 7298 if (pLmEqual(strat->B[i].sig,sig)) 7291 7299 { … … 7823 7831 int j; 7824 7832 j = kFindDivisibleByInT(strat, &Ln); 7825 if (j < 0) { 7833 if (j < 0) 7834 { 7826 7835 j = kFindDivisibleByInT_Z(strat, &Ln); 7827 if (j < 0) { 7836 if (j < 0) 7837 { 7828 7838 break; 7829 } else { 7839 } 7840 else 7841 { 7830 7842 /* reduction not cancelling a tail term, but reducing its coefficient */ 7831 7843 With = &(strat->T[j]); … … 12325 12337 // } 12326 12338 12327 #ifdef HAVE_SHIFTBBA12328 12339 /*2 12329 12340 * put the lcm(q,p) into the set B, q is the shift of some s[i] 12330 12341 */ 12342 #ifdef HAVE_SHIFTBBA 12331 12343 static BOOLEAN enterOneStrongPolyShift (poly q, poly p, int /*ecart*/, int /*isFromQ*/, kStrategy strat, int atR, int /*ecartq*/, int qisFromQ, int shiftcount, int ifromS) 12332 12344 { … … 12492 12504 return TRUE; 12493 12505 } 12506 #endif 12507 12494 12508 12495 12509 /*2 12496 12510 * put the pair (q,p) into the set B, ecart=ecart(p), q is the shift of some s[i] (ring case) 12497 12511 */ 12512 #ifdef HAVE_SHIFTBBA 12498 12513 static void enterOnePairRingShift (poly q, poly p, int /*ecart*/, int isFromQ, kStrategy strat, int atR, int /*ecartq*/, int qisFromQ, int shiftcount, int ifromS) 12499 12514 { … … 12736 12751 kTest_TS(strat); 12737 12752 } 12738 12753 #endif 12754 12755 #ifdef HAVE_SHIFTBBA 12739 12756 // adds the strong pair and the normal pair for rings (aka gpoly and spoly) 12740 12757 static void enterOneStrongPolyAndEnterOnePairRingShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS) … … 12743 12760 enterOnePairRingShift(q, p, ecart, isFromQ, strat, atR, ecartq, qisFromQ, shiftcount, ifromS); // "spoly" 12744 12761 } 12745 12762 #endif 12763 12764 #ifdef HAVE_SHIFTBBA 12746 12765 // creates if possible (q,p), (shifts(q),p) 12747 12766 static void enterOnePairWithShifts (int q_inS /*also i*/, poly q, poly p, int ecartp, int p_isFromQ, kStrategy strat, int atR, int p_lastVblock, int q_lastVblock) … … 12831 12850 #endif 12832 12851 12833 #ifdef HAVE_SHIFTBBA12834 12852 12835 12853 #ifdef KDEBUG … … 12840 12858 * put the pair (q,p) into the set B, ecart=ecart(p), q is the shift of some s[i] 12841 12859 */ 12860 #ifdef HAVE_SHIFTBBA 12842 12861 void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS) 12843 12862 { … … 12950 12969 pLmFree(Lp.lcm); 12951 12970 #ifdef CRITERION_DEBUG 12952 if (TEST_OPT_DEBUG) { 12971 if (TEST_OPT_DEBUG) 12972 { 12953 12973 Print("--- chain crit using B[%d].lcm=%s\n", j, pString(strat->B[j].lcm)); 12954 12974 } … … 12963 12983 { 12964 12984 #ifdef CRITERION_DEBUG 12965 if (TEST_OPT_DEBUG) { 12985 if (TEST_OPT_DEBUG) 12986 { 12966 12987 Print("--- chain crit using pair to remove B[%d].lcm=%s\n", j, pString(strat->B[j].lcm)); 12967 12988 } … … 13027 13048 pLmFree(Lp.lcm); 13028 13049 #ifdef CRITERION_DEBUG 13029 if (TEST_OPT_DEBUG) { 13050 if (TEST_OPT_DEBUG) 13051 { 13030 13052 Print("--- chain crit using B[%d].lcm=%s\n", j, pString(strat->B[j].lcm)); 13031 13053 } … … 13039 13061 { 13040 13062 #ifdef CRITERION_DEBUG 13041 if (TEST_OPT_DEBUG) { 13063 if (TEST_OPT_DEBUG) 13064 { 13042 13065 Print("--- chain crit using pair to remove B[%d].lcm=%s\n", j, pString(strat->B[j].lcm)); 13043 13066 } … … 13169 13192 } 13170 13193 } 13194 #endif 13171 13195 13172 13196 /*3 … … 13175 13199 * additionally we put the pairs (h, s \sdot h) for s>=1 to L 13176 13200 */ 13201 #ifdef HAVE_SHIFTBBA 13177 13202 void initenterpairsShift (poly h,int k,int ecart,int isFromQ, kStrategy strat, int atR) 13178 13203 { … … 13237 13262 { 13238 13263 // pairs (shifts(s[1..k]),h), (s[1..k],h) 13239 for (j=0; j<=k; j++) { 13264 for (j=0; j<=k; j++) 13265 { 13240 13266 if (!strat->fromQ[j]) 13241 13267 { … … 13281 13307 new_pair=TRUE; 13282 13308 // pairs (shifts(s[1..k]),h), (s[1..k],h) 13283 for (j=0; j<=k; j++) { 13309 for (j=0; j<=k; j++) 13310 { 13284 13311 poly s = strat->S[j]; 13285 13312 enterOnePairWithShifts(j, s, h, ecart, isFromQ, strat, atR, h_lastVblock, pmLastVblock(s)); … … 13355 13382 { 13356 13383 // pairs (shifts(s[1..k]),h), (s[1..k],h) 13357 for (j=0; j<=k; j++) { 13384 for (j=0; j<=k; j++) 13385 { 13358 13386 if ((pGetComp(h)==pGetComp(strat->S[j])) 13359 13387 || (pGetComp(strat->S[j])==0)) … … 13417 13445 } 13418 13446 } 13447 #endif 13419 13448 13420 13449 /*3 … … 13423 13452 * additionally we put the pairs (h, s \sdot h) for s>=1 to L 13424 13453 */ 13454 #ifdef HAVE_SHIFTBBA 13425 13455 void initenterstrongPairsShift (poly h,int k,int ecart,int isFromQ, kStrategy strat, int atR) 13426 13456 { … … 13485 13515 { 13486 13516 // pairs (shifts(s[1..k]),h), (s[1..k],h) 13487 for (j=0; j<=k; j++) { 13517 for (j=0; j<=k; j++) 13518 { 13488 13519 if (!strat->fromQ[j]) 13489 13520 { … … 13514 13545 new_pair=TRUE; 13515 13546 // pairs (shifts(s[1..k]),h), (s[1..k],h) 13516 for (j=0; j<=k; j++) { 13547 for (j=0; j<=k; j++) 13548 { 13517 13549 poly s = strat->S[j]; 13518 13550 // TODO: cache lastVblock of s[1..k] for later use … … 13560 13592 { 13561 13593 // pairs (shifts(s[1..k]),h), (s[1..k],h) 13562 for (j=0; j<=k; j++) { 13594 for (j=0; j<=k; j++) 13595 { 13563 13596 if ((pGetComp(h)==pGetComp(strat->S[j])) 13564 13597 || (pGetComp(strat->S[j])==0)) … … 13593 13626 } 13594 13627 } 13628 #endif 13595 13629 13596 13630 /*2 … … 13598 13632 *superfluous elements in S will be deleted 13599 13633 */ 13634 #ifdef HAVE_SHIFTBBA 13600 13635 void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR) 13601 13636 { … … 13621 13656 } 13622 13657 } 13658 #endif 13623 13659 13624 13660 /*2 … … 13626 13662 * assumes that p is already in T! 13627 13663 */ 13664 #ifdef HAVE_SHIFTBBA 13628 13665 void enterTShift(LObject p, kStrategy strat, int atT) 13629 13666 {
Note: See TracChangeset
for help on using the changeset viewer.