Changeset c1c2ccd in git


Ignore:
Timestamp:
Sep 9, 2015, 4:25:50 PM (9 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
b4fbb84ad318878fabdaa4dbc73d6d1fcea0a9e8
Parents:
456eb622b2382d15921e6e3db01415bc2871fd1c
Message:
Work with Anne
Location:
kernel/GBEngine
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kspoly.cc

    r456eb62 rc1c2ccd  
    4949    Print("Red %d:", red_count); PR->wrp(); Print(" with:");
    5050    PW->wrp();
     51    //printf("\necart(PR)-ecart(PW): %i\n",PR->ecart-PW->ecart);
     52    //pWrite(PR->p);
    5153  }
    5254#endif
     
    159161  {
    160162    Print(" to: "); PR->wrp(); Print("\n");
     163    //printf("\nt^%i ", PR->ecart);pWrite(pHead(PR->p));
    161164  }
    162165#endif
  • kernel/GBEngine/kstd1.cc

    r456eb62 rc1c2ccd  
    1414#define MYTEST 0
    1515
    16 #define ADIDEBUG 0
    17 #define ADIDEBUG_NF 0
     16#define ADIDEBUG 1
     17#define ADIDEBUG_NF 1
    1818
    1919#include <kernel/mod2.h>
     
    402402      PrintS("\n    No poly in T divides h.\n");
    403403    }
     404    //getchar();
    404405#endif
    405406    if (j < 0)
     
    734735  loop
    735736  {
     737    #if ADIDEBUG_NF
     738    for(int ii=0;ii<=strat->tl;ii++)
     739    {
     740      printf("\nT[%i]:\nt^%i ",ii,strat->T[ii].ecart);
     741      pWrite(strat->T[ii].p);
     742    }
     743    //getchar();
     744    #endif
    736745    if (j > strat->tl)
    737746    {
     
    813822        if (H.p == NULL)
    814823          return NULL;
     824        #if 0
     825        //kÃŒrzeste=1, kleinste ecart = 0
     826        int dummy=0;
     827        int z=-1;
     828        for(int ii=0; ii<=strat->tl;ii++)
     829        {
     830          if(pLmIsConstant(strat->T[ii].p))
     831          {
     832            printf("\nFound one:\n");pWrite(strat->T[ii].p);
     833            if(dummy==0 && strat->T[ii].ecart < strat->T[z].ecart)
     834            {
     835              z = ii;
     836            }
     837            if(dummy == 1 && strat->T[ii].length < strat->T[z].length)
     838            {
     839              z = ii;
     840            }
     841          }
     842        }
     843        printf("\n!!!!!!!!!!!!!!!!!   z = %i\n",z);
     844        if(z!=-1)
     845        {
     846          enterOneStrongPoly(z,H.p,H.ecart,0,strat,-1 , TRUE);
     847        }
     848        #endif
    815849      }
    816850      else
     
    825859      #if ADIDEBUG_NF
    826860      printf("\nAfter the small reduction it looks like this:\n");pWrite(H.p);
    827       getchar();
     861      //getchar();
    828862      #endif
    829863      /*- try to reduce the s-polynomial -*/
     
    15931627    }
    15941628    #endif
    1595     getchar();
     1629    //getchar();
    15961630    #endif
    15971631    #ifdef KDEBUG
  • kernel/GBEngine/kutil.cc

    r456eb62 rc1c2ccd  
    7777#endif
    7878
    79 #define ADIDEBUG 0
     79#define ADIDEBUG 1
    8080
    8181denominator_list DENOMINATOR_LIST=NULL;
     
    11681168void enterOnePairRing (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1)
    11691169{
    1170   number s, t;
     1170  #if 0
     1171  assume(i<=strat->sl);
     1172    int      l,j,compare,compareCoeff;
     1173    LObject  Lp;
     1174    if (strat->interred_flag) return;
     1175  #ifdef KDEBUG
     1176    Lp.ecart=0; Lp.length=0;
     1177  #endif
     1178    /*- computes the lcm(s[i],p) -*/
     1179    Lp.lcm = pInit();
     1180    pSetCoeff0(Lp.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
     1181 
     1182    // Lp.lcm == 0
     1183    if (nIsZero(pGetCoeff(Lp.lcm)))
     1184    {
     1185  #ifdef KDEBUG
     1186        if (TEST_OPT_DEBUG)
     1187        {
     1188          PrintS("--- Lp.lcm == 0\n");
     1189          PrintS("p:");
     1190          wrp(p);
     1191          Print("  strat->S[%d]:", i);
     1192          wrp(strat->S[i]);
     1193          PrintLn();
     1194        }
     1195  #endif
     1196        strat->cp++;
     1197        pLmDelete(Lp.lcm);
     1198        return;
     1199    }
     1200    // basic product criterion
     1201    pLcm(p,strat->S[i],Lp.lcm);
     1202 
     1203    pSetm(Lp.lcm);
     1204    assume(!strat->sugarCrit);
     1205    if (pHasNotCF(p,strat->S[i]) && n_IsUnit(pGetCoeff(p),currRing->cf)
     1206        && n_IsUnit(pGetCoeff(strat->S[i]),currRing->cf))
     1207    {
     1208  #ifdef KDEBUG
     1209        if (TEST_OPT_DEBUG)
     1210        {
     1211          PrintS("--- product criterion func enterOnePairRing type 1\n");
     1212          PrintS("p:");
     1213          wrp(p);
     1214          Print("  strat->S[%d]:", i);
     1215          wrp(strat->S[i]);
     1216          PrintLn();
     1217        }
     1218  #endif
     1219        strat->cp++;
     1220        pLmDelete(Lp.lcm);
     1221        return;
     1222    }
     1223    assume(!strat->fromT);
     1224    /*
     1225    *the set B collects the pairs of type (S[j],p)
     1226    *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p) != lcm(r,p)
     1227    *if the leading term of s devides lcm(r,p) then (r,p) will be canceled
     1228    *if the leading term of r devides lcm(s,p) then (s,p) will not enter B
     1229    */
     1230    for(j = strat->Bl;j>=0;j--)
     1231    {
     1232      compare=pDivCompRing(strat->B[j].lcm,Lp.lcm);
     1233      compareCoeff = n_DivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(Lp.lcm), currRing->cf);
     1234      if ((compareCoeff == pDivComp_EQUAL) || (compare == compareCoeff))
     1235      {
     1236        if (compare == 1)
     1237        {
     1238          strat->c3++;
     1239  #ifdef KDEBUG
     1240          if (TEST_OPT_DEBUG)
     1241          {
     1242            PrintS("--- chain criterion type 1\n");
     1243            PrintS("strat->B[j]:");
     1244            wrp(strat->B[j].lcm);
     1245            PrintS("  Lp.lcm:");
     1246            wrp(Lp.lcm);
     1247            PrintLn();
     1248          }
     1249  #endif
     1250          if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     1251          {
     1252            pLmDelete(Lp.lcm);
     1253            return;
     1254          }
     1255          break;
     1256        }
     1257        else
     1258        if (compare == -1)
     1259        {
     1260  #ifdef KDEBUG
     1261          if (TEST_OPT_DEBUG)
     1262          {
     1263            PrintS("--- chain criterion type 2\n");
     1264            Print("strat->B[%d].lcm:",j);
     1265            wrp(strat->B[j].lcm);
     1266            PrintS("  Lp.lcm:");
     1267            wrp(Lp.lcm);
     1268            PrintLn();
     1269          }
     1270  #endif
     1271          deleteInL(strat->B,&strat->Bl,j,strat);
     1272          strat->c3++;
     1273        }
     1274      }
     1275      if ((compare == pDivComp_EQUAL) && (compareCoeff != 2))
     1276      {
     1277        if (compareCoeff == pDivComp_LESS)
     1278        {
     1279  #ifdef KDEBUG
     1280          if (TEST_OPT_DEBUG)
     1281          {
     1282            PrintS("--- chain criterion type 3\n");
     1283            Print("strat->B[%d].lcm:", j);
     1284            wrp(strat->B[j].lcm);
     1285            PrintS("  Lp.lcm:");
     1286            wrp(Lp.lcm);
     1287            PrintLn();
     1288          }
     1289  #endif
     1290          strat->c3++;
     1291          if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     1292          {
     1293            pLmDelete(Lp.lcm);
     1294            return;
     1295          }
     1296          break;
     1297        }
     1298        else
     1299        // Add hint for same LM and LC (later) (TODO Oliver)
     1300        // if (compareCoeff == pDivComp_GREATER)
     1301        {
     1302  #ifdef KDEBUG
     1303          if (TEST_OPT_DEBUG)
     1304          {
     1305            PrintS("--- chain criterion type 4\n");
     1306            Print("strat->B[%d].lcm:", j);
     1307            wrp(strat->B[j].lcm);
     1308            PrintS("  Lp.lcm:");
     1309            wrp(Lp.lcm);
     1310            PrintLn();
     1311          }
     1312  #endif
     1313          deleteInL(strat->B,&strat->Bl,j,strat);
     1314          strat->c3++;
     1315        }
     1316      }
     1317    }
     1318    /*
     1319    *the pair (S[i],p) enters B if the spoly != 0
     1320    */
     1321    /*-  compute the short s-polynomial -*/
     1322    if ((strat->S[i]==NULL) || (p==NULL))
     1323    {
     1324  #ifdef KDEBUG
     1325      if (TEST_OPT_DEBUG)
     1326      {
     1327        PrintS("--- spoly = NULL\n");
     1328      }
     1329  #endif
     1330      pLmDelete(Lp.lcm);
     1331      return;
     1332    }
     1333    if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0))
     1334    {
     1335      // Is from a previous computed GB, therefore we know that spoly will
     1336      // reduce to zero. Oliver.
     1337      WarnS("Could we come here? 8738947389");
     1338      Lp.p=NULL;
     1339    }
     1340    else
     1341    {
     1342      Lp.p = ksCreateShortSpoly(strat->S[i], p, strat->tailRing);
     1343    }
     1344    if (Lp.p == NULL)
     1345    {
     1346  #ifdef KDEBUG
     1347      if (TEST_OPT_DEBUG)
     1348      {
     1349        PrintS("--- spoly = NULL\n");
     1350      }
     1351  #endif
     1352      /*- the case that the s-poly is 0 -*/
     1353      if (strat->pairtest==NULL) initPairtest(strat);
     1354      strat->pairtest[i] = TRUE;/*- hint for spoly(S^[i],p)=0 -*/
     1355      strat->pairtest[strat->sl+1] = TRUE;
     1356      /*hint for spoly(S[i],p) == 0 for some i,0 <= i <= sl*/
     1357      /*
     1358      *suppose we have (s,r),(r,p),(s,p) and spoly(s,p) == 0 and (r,p) is
     1359      *still in B (i.e. lcm(r,p) == lcm(s,p) or the leading term of s does not
     1360      *devide lcm(r,p)). In the last case (s,r) can be canceled if the leading
     1361      *term of p devides the lcm(s,r)
     1362      *(this canceling should be done here because
     1363      *the case lcm(s,p) == lcm(s,r) is not covered in chainCrit)
     1364      *the first case is handeled in chainCrit
     1365      */
     1366      pLmDelete(Lp.lcm);
     1367    }
     1368    else
     1369    {
     1370      /*- the pair (S[i],p) enters B -*/
     1371      Lp.p1 = strat->S[i];
     1372      Lp.p2 = p;
     1373 
     1374      pNext(Lp.p) = strat->tail;
     1375 
     1376      if (atR >= 0)
     1377      {
     1378        Lp.i_r2 = atR;
     1379        Lp.i_r1 = strat->S_2_R[i];
     1380      }
     1381      strat->initEcartPair(&Lp,strat->S[i],p,strat->ecartS[i],ecart);
     1382      l = strat->posInL(strat->L,strat->Ll,&Lp,strat);
     1383      enterL(&strat->L,&strat->Ll,&strat->Lmax,Lp,l);
     1384    }
     1385  #else
    11711386  assume(i<=strat->sl);
    11721387  assume(atR >= 0);
     
    12851500  }
    12861501  #endif
     1502  number s, t;
    12871503  poly m1, m2, gcd;
    12881504  #if ADIDEBUG
     
    13061522    if(pm1 == NULL)
    13071523    {
    1308       pDelete(&sim2);
    1309       pDelete(&pm1);
    1310       pDelete(&m1);
    1311       pDelete(&m2);
     1524      //pDelete(&sim2);
     1525      //pDelete(&pm1);
     1526      //pDelete(&gcd);
     1527      //pDelete(&m1);
     1528      //pDelete(&m2);
    13121529      return;
    13131530    }
    13141531    else
    13151532    {
    1316       gcd = p_Copy(pm1, strat->tailRing);
     1533      gcd = pCopy(pm1);
    13171534      pDelete(&pm1);
    13181535      pDelete(&sim2);
     
    13811598  enterL(&strat->B,&strat->Bl,&strat->Bmax,h,posx);
    13821599  kTest_TS(strat);
     1600  #endif
    13831601}
    13841602
     
    13881606*/
    13891607
    1390 BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1)
     1608BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR, bool redMoraNF)
    13911609{
    13921610  number d, s, t;
    1393   assume(i<=strat->sl);
    13941611  assume(atR >= 0);
    1395   poly m1, m2, gcd;
    1396 
    1397   d = n_ExtGcd(pGetCoeff(p), pGetCoeff(strat->S[i]), &s, &t, currRing->cf);
     1612  poly m1, m2, gcd,si;
     1613  if(!redMoraNF)
     1614  {
     1615    assume(i<=strat->sl);
     1616    si = strat->S[i];
     1617  }
     1618  else
     1619  {
     1620    assume(i<=strat->tl);
     1621    si = strat->T[i].p;
     1622  }
     1623  //printf("\n--------------------------------\n");
     1624  //pWrite(p);pWrite(si);
     1625  d = n_ExtGcd(pGetCoeff(p), pGetCoeff(si), &s, &t, currRing->cf);
    13981626
    13991627  if (nIsZero(s) || nIsZero(t))  // evtl. durch divBy tests ersetzen
     
    14051633  }
    14061634
    1407   k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
     1635  k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing);
    14081636  //p_Test(m1,strat->tailRing);
    14091637  //p_Test(m2,strat->tailRing);
    1410   while (! kCheckStrongCreation(atR, m1, i, m2, strat) )
    1411   {
    1412     memset(&(strat->P), 0, sizeof(strat->P));
    1413     kStratChangeTailRing(strat);
    1414     strat->P = *(strat->R[atR]);
    1415     p_LmFree(m1, strat->tailRing);
    1416     p_LmFree(m2, strat->tailRing);
    1417     p_LmFree(gcd, currRing);
    1418     k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
     1638  if(!redMoraNF)
     1639  {
     1640    while (! kCheckStrongCreation(atR, m1, i, m2, strat) )
     1641    {
     1642      memset(&(strat->P), 0, sizeof(strat->P));
     1643      kStratChangeTailRing(strat);
     1644      strat->P = *(strat->R[atR]);
     1645      p_LmFree(m1, strat->tailRing);
     1646      p_LmFree(m2, strat->tailRing);
     1647      p_LmFree(gcd, currRing);
     1648      k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing);
     1649    }
    14191650  }
    14201651  pSetCoeff0(m1, s);
     
    14231654  p_Test(m1,strat->tailRing);
    14241655  p_Test(m2,strat->tailRing);
    1425 
     1656  //printf("\n===================================\n");
     1657  //pWrite(m1);pWrite(m2);pWrite(gcd);
    14261658#ifdef KDEBUG
    14271659  if (TEST_OPT_DEBUG)
     
    14381670    wrp(p);
    14391671    Print("\n strat->S[%d]: ", i);
    1440     wrp(strat->S[i]);
     1672    wrp(si);
    14411673    PrintS(" ---> ");
    14421674  }
    14431675#endif
    1444 
    1445   pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(strat->S[i]), m2, strat->tailRing), strat->tailRing);
     1676 
     1677  pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(si), m2, strat->tailRing), strat->tailRing);
    14461678  p_LmDelete(m1, strat->tailRing);
    14471679  p_LmDelete(m2, strat->tailRing);
    1448 
    14491680#ifdef KDEBUG
    14501681  if (TEST_OPT_DEBUG)
     
    14611692  h.pCleardenom();
    14621693  strat->initEcart(&h);
    1463   if (strat->Ll==-1)
    1464     posx =0;
    1465   else
    1466     posx = strat->posInL(strat->L,strat->Ll,&h,strat);
    14671694  h.sev = pGetShortExpVector(h.p);
    14681695  h.i_r1 = -1;h.i_r2 = -1;
    14691696  if (currRing!=strat->tailRing)
    1470   {
    1471     if (h.t_p==NULL) /* may already been set by pLdeg() in initEcart */
    1472       h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
    1473   }
    1474   #if 1
    1475   h.p1 = p;h.p2 = strat->S[i];
    1476   #endif
    1477   if (atR >= 0)
     1697    h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
     1698  if(!redMoraNF)
     1699  {
     1700    #if 1
     1701    h.p1 = p;h.p2 = strat->S[i];
     1702    #endif
     1703    if (atR >= 0)
    14781704    {
    14791705      h.i_r2 = strat->S_2_R[i];
     
    14851711      h.i_r2 = -1;
    14861712    }
    1487   enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
     1713    if (strat->Ll==-1)
     1714      posx =0;
     1715    else
     1716      posx = strat->posInL(strat->L,strat->Ll,&h,strat);
     1717    enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
     1718  }
     1719  else
     1720  {
     1721    enterT(h, strat);
     1722  }
     1723  //#if 1
    14881724  #if ADIDEBUG
    1489   printf("\nThis strong poly was added to L:\n");pWrite(h.p);pWrite(h.p1);pWrite(h.p2);printf("\ni_r1 = %i, i_r2 = %i\n",h.i_r1, h.i_r2);pWrite(strat->T[h.i_r1].p);pWrite(strat->T[h.i_r2].p);
     1725  printf("\nThis strong poly was added to L:\n");pWrite(h.p);pWrite(h.p1);pWrite(h.p2);
    14901726  #endif
    14911727  return TRUE;
     
    30373273    }
    30383274    #if 1
     3275
    30393276    if (new_pair)
    30403277    {
     
    37023939      && ((iCompH<=strat->syzComp)||(strat->syzComp==0)))
    37033940      {
    3704         enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR);
     3941        enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR, FALSE);
    37053942      }
    37063943    }
     
    38344071void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR)
    38354072{
     4073#if ADIDEBUG
     4074  PrintS("\nEnter superenterpairs\n");
     4075  int iii = strat->Ll;
     4076#endif
    38364077  assume (rField_is_Ring(currRing));
    38374078  // enter also zero divisor * poly, if this is non zero and of smaller degree
    38384079  if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat);
     4080#if ADIDEBUG
     4081  if(iii==strat->Ll)
     4082  {
     4083    PrintS("\n                enterExtendedSpoly has not changed the list L.\n");
     4084  }
     4085  else
     4086  {
     4087    PrintLn();
     4088    PrintS("\n                enterExtendedSpoly changed the list L:\n");
     4089    for(iii=0;iii<=strat->Ll;iii++)
     4090    {
     4091      Print("\n                L[%d]:\n",iii);
     4092      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     4093      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     4094      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     4095    }
     4096  }
     4097  iii = strat->Ll;
     4098#endif
    38394099  initenterpairs(h, k, ecart, 0, strat, atR);
     4100#if ADIDEBUG
     4101  if(iii==strat->Ll)
     4102  {
     4103    PrintS("\n                initenterpairs has not changed the list L.\n");
     4104  }
     4105  else
     4106  {
     4107    PrintS("\n                initenterpairs changed the list L:\n");
     4108    for(iii=0;iii<=strat->Ll;iii++)
     4109    {
     4110      Print("\n                L[%d]:\n",iii);
     4111      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     4112      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     4113      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     4114    }
     4115  }
     4116  iii = strat->Ll;
     4117#endif
    38404118  initenterstrongPairs(h, k, ecart, 0, strat, atR);
     4119#if ADIDEBUG
     4120  if(iii==strat->Ll)
     4121  {
     4122    PrintS("\n                initenterstrongPairs has not changed the list L.\n");
     4123  }
     4124  else
     4125  {
     4126    PrintS("\n                initenterstrongPairs changed the list L:\n");
     4127    for(iii=0;iii<=strat->Ll;iii++)
     4128    {
     4129      Print("\n                L[%d]:\n",iii);
     4130      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     4131      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     4132      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     4133    }
     4134  }
     4135  PrintS("\nEnd of superenterpairs\n");
     4136#endif
    38414137  clearSbatch(h, k, pos, strat);
    38424138}
     
    38544150  assume (!rField_is_Ring(currRing));
    38554151#endif
     4152  #if ADIDEBUG
     4153        Print("\n    Vor initenterpairs: The new pair list L -- after superenterpairs in loop\n");
     4154        for(int iii=0;iii<=strat->Ll;iii++)
     4155        {
     4156          printf("\n    L[%d]:\n",iii);
     4157          PrintS("         ");p_Write(strat->L[iii].p,strat->tailRing);
     4158          PrintS("         ");p_Write(strat->L[iii].p1,strat->tailRing);
     4159          PrintS("         ");p_Write(strat->L[iii].p2,strat->tailRing);
     4160        }
     4161        #endif
     4162
    38564163  initenterpairs(h,k,ecart,0,strat, atR);
     4164
     4165      #if ADIDEBUG
     4166        Print("\n    Nach initenterpairs: The new pair list L -- after superenterpairs in loop \n");
     4167        for(int iii=0;iii<=strat->Ll;iii++)
     4168        {
     4169          printf("\n    L[%d]:\n",iii);
     4170          PrintS("         ");p_Write(strat->L[iii].p,strat->tailRing);
     4171          PrintS("         ");p_Write(strat->L[iii].p1,strat->tailRing);
     4172          PrintS("         ");p_Write(strat->L[iii].p2,strat->tailRing);
     4173        }
     4174        #endif
     4175
    38574176  if ( (!strat->fromT)
    38584177  && ((strat->syzComp==0)
     
    38674186      j++;
    38684187    }
    3869   }
     4188    //Print("end clearS sl=%d\n",strat->sl);
     4189  }
     4190 // PrintS("end enterpairs\n");
    38704191}
    38714192
     
    76527973  }
    76537974#endif
     7975#ifdef HAVE_RINGS
     7976  if(rField_is_Ring(currRing) && !n_IsUnit(p.p->coef, currRing->cf))
     7977  {
     7978    #if ADIDEBUG_NF
     7979    printf("\nDas ist p:\n");pWrite(p.p);
     7980    #endif
     7981    for(i=strat->tl;i>=0;i--)
     7982    {
     7983      if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p))
     7984      {
     7985        #if ADIDEBUG_NF
     7986        printf("\nFound one: %i\n",i);pWrite(strat->T[i].p);
     7987        #endif
     7988        enterOneStrongPoly(i,p.p,p.ecart,0,strat,0 , TRUE);
     7989      }
     7990    }
     7991  }
     7992  /*
     7993  printf("\nThis is T:\n");
     7994  for(i=strat->tl;i>=0;i--)
     7995  {
     7996    pWrite(strat->T[i].p);
     7997  }
     7998  //getchar();*/
     7999#endif
    76548000#ifdef HAVE_TAIL_RING
    76558001  if (currRing!=strat->tailRing)
     
    81118457    updateS(TRUE,strat);
    81128458  }
    8113   //if (strat->fromQ!=NULL) omFreeSize(strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
    8114   //strat->fromQ=NULL;
     8459  if (strat->fromQ!=NULL) omFreeSize(strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
     8460  strat->fromQ=NULL;
    81158461  assume(kTest_TS(strat));
    81168462}
     
    87459091  if((posconst != -1) && (!nIsZero(F->m[posconst]->coef)))
    87469092  {
    8747       //pDelete(&pmon);
     9093      pmon = pCopy(F->m[posconst]);
    87489094      idDelete(&F);
    8749       //idDelete(&monred);
    8750       return NULL;
     9095      idDelete(&monred);
     9096      return pmon;
    87519097  }
    87529098  int idelemQ = 0;
     
    87649110      if((posconst != -1) && (!nIsZero(monred->m[posconst]->coef)))
    87659111      {
     9112          pmon = pCopy(monred->m[posconst]);
    87669113          idDelete(&F);
    87679114          idDelete(&monred);
    8768           return NULL;
     9115          return pmon;
    87699116      }
    87709117  }
     
    87909137              II->m[i+1] = II->m[i];
    87919138      II->m[0] = pOne();
    8792       ideal syz = idSyzygies(II, isNotHomog, NULL);
    8793       //idPrint(syz);
     9139      ideal syz = idSyzygies(II, isNotHomog, NULL);     
    87949140      poly integer = NULL;
    87959141      for(int i = IDELEMS(syz)-1;i>=0; i--)
     
    87979143          if(pGetComp(syz->m[i]) == 1)
    87989144          {
    8799               integer = pHead(syz->m[i]);
    8800               pSetComp(integer,0);
    8801               if(pIsConstant(integer))
     9145              if(pIsConstant(syz->m[i]))
    88029146              {
     9147                  integer = pHead(syz->m[i]);
     9148                  pSetComp(integer, 0);
    88039149                  break;
    88049150              }
     
    88099155      pmon = prMapR(integer, nMap2, QQ_ring, origR);
    88109156      idDelete(&F);
    8811       //idDelete(&monred);
    8812       //idDelete(&II);
    8813       //idDelete(&one);
    8814       //idDelete(&syz);
    8815       //pDelete(&integer);
     9157      idDelete(&monred);
     9158      idDelete(&II);
     9159      idDelete(&one);
     9160      idDelete(&syz);
     9161      pDelete(&integer);
    88169162      rDelete(QQ_ring);
    88179163      return pmon;
     
    88889234  }
    88899235  idDelete(&F);
    8890   //idDelete(&monred);
    8891   //idDelete(&II);
    8892   //idDelete(&one);
    8893   //pDelete(&pmon);
     9236  idDelete(&monred);
     9237  idDelete(&II);
     9238  idDelete(&one);
     9239  pDelete(&pmon);
    88949240  rDelete(QQ_ring);
    88959241  return NULL;
     
    89139259    if(pNext(strat->S[i]) == NULL)
    89149260    {
     9261      pWrite(p);
     9262      pWrite(strat->S[i]);
    89159263      while(ok == FALSE)
    89169264      {
    89179265        if(pLmDivisibleBy(strat->S[i], p))
    89189266        {
    8919           number c = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf);
    8920           pSetCoeff(p,c);
     9267          p->coef = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf);
    89219268        }
    89229269        if(nIsZero(p->coef))
     
    89359282        if(pLmDivisibleBy(strat->S[i], pp))
    89369283        {
    8937           number c = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf);
    8938           pSetCoeff(pp,c);
     9284          pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf);
    89399285          if(nIsZero(pp->coef))
    89409286          {
     
    89839329          if(pLmDivisibleBy(strat->S[j], p))
    89849330          {
    8985             number n = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf);
    8986             pSetCoeff(p,n);
     9331            //nDelete(&(p->coef));
     9332            p->coef = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf);
    89879333          }
    89889334          pp = pNext(p);
     
    89979343                if(pLmDivisibleBy(strat->S[j], pp))
    89989344                {
    8999                   number n = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf);
    9000                   pSetCoeff(pp,n);
     9345                  //nDelete(&(pp->coef));
     9346                  pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf);
    90019347                  if(nIsZero(pp->coef))
    90029348                  {
  • kernel/GBEngine/kutil.h

    r456eb62 rc1c2ccd  
    503503void entersets (LObject h);
    504504void pairs ();
     505BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1, bool redMoraNF = FALSE);
    505506void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
    506507void messageStat (int hilbcount,kStrategy strat);
Note: See TracChangeset for help on using the changeset viewer.