Changeset b1bc24 in git for kernel/GBEngine/kutil.cc


Ignore:
Timestamp:
Dec 27, 2019, 10:50:09 AM (4 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
0c27e478f70c2768cfbc17e1a349338d9b343828
Parents:
08b6c4fc9c411f9d7cb3e1c09916bac15398f2db
Message:
Fix chain crit for Letterplace
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r08b6c4 rb1bc24  
    232232  return 0;
    233233}
     234
     235#ifdef HAVE_SHIFTBBA
     236static inline int pLPDivComp(poly p, poly q) {
     237  if ((currRing->pCompIndex < 0) || (__p_GetComp(p,currRing) == __p_GetComp(q,currRing)))
     238  {
     239    // maybe there is a more performant way to do this? This will get called quite often in bba.
     240    if (_p_LPLmDivisibleByNoComp(p, q, currRing)) return 1;
     241    if (_p_LPLmDivisibleByNoComp(q, p, currRing)) return -1;
     242  }
     243
     244  return 0;
     245}
     246#endif
    234247
    235248
     
    1288912902      {
    1289012903        if (j < 0)  break;
    12891         compare=pDivComp(strat->B[j].lcm,Lp.lcm);
     12904        compare=pLPDivComp(strat->B[j].lcm,Lp.lcm);
    1289212905        if ((compare==1)
    1289312906        &&(sugarDivisibleBy(strat->B[j].ecart,Lp.ecart)))
     
    1289812911            pLmFree(Lp.lcm);
    1289912912#ifdef CRITERION_DEBUG
    12900             if (TEST_OPT_DEBUG) Print("--- divided by B[%d]\n", j);
     12913            if (TEST_OPT_DEBUG) {
     12914              Print("--- chain crit using B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
     12915            }
    1290112916#endif
    1290212917            return;
     
    1290812923        && sugarDivisibleBy(Lp.ecart,strat->B[j].ecart))
    1290912924        {
     12925#ifdef CRITERION_DEBUG
     12926          if (TEST_OPT_DEBUG) {
     12927            Print("--- chain crit using pair to remove B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
     12928          }
     12929#endif
    1291012930          deleteInL(strat->B,&strat->Bl,j,strat);
    12911 #ifdef CRITERION_DEBUG
    12912           if (TEST_OPT_DEBUG) Print("divides B[%d] -> delete B[%d]\n", j, j);
    12913 #endif
    1291412931          strat->c3++;
    1291512932        }
     
    1296312980      for(j = strat->Bl;j>=0;j--)
    1296412981      {
    12965         compare=pDivComp(strat->B[j].lcm,Lp.lcm);
     12982        compare=pLPDivComp(strat->B[j].lcm,Lp.lcm);
    1296612983        if (compare==1)
    1296712984        {
     
    1297112988            pLmFree(Lp.lcm);
    1297212989#ifdef CRITERION_DEBUG
    12973             if (TEST_OPT_DEBUG) Print("--- divided by B[%d]\n", j);
     12990            if (TEST_OPT_DEBUG) {
     12991              Print("--- chain crit using B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
     12992            }
    1297412993#endif
    1297512994            return;
     
    1298012999        if (compare ==-1)
    1298113000        {
     13001#ifdef CRITERION_DEBUG
     13002          if (TEST_OPT_DEBUG) {
     13003            Print("--- chain crit using pair to remove B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
     13004          }
     13005#endif
    1298213006          deleteInL(strat->B,&strat->Bl,j,strat);
    12983 #ifdef CRITERION_DEBUG
    12984           if (TEST_OPT_DEBUG) Print("divides B[%d] -> delete B[%d]\n", j, j);
    12985 #endif
    1298613007          strat->c3++;
    1298713008        }
     
    1300613027    Lp.p=NULL;
    1300713028#ifdef CRITERION_DEBUG
    13008     if (TEST_OPT_DEBUG) PrintS("--- pair from Q\n");
     13029    if (TEST_OPT_DEBUG) PrintS("--- pair is from Q\n");
    1300913030#endif
    1301013031  }
Note: See TracChangeset for help on using the changeset viewer.