Changeset c8523f in git for kernel/GBEngine


Ignore:
Timestamp:
Oct 7, 2015, 4:51:45 PM (9 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
212806f6073de03851c64acb881326ea4667bad2
Parents:
03305393d877240ff162abbfb9e1b9c1f14214e85d9204728b9fa909f073b21e83c172b0b49dc2e2
Message:
Merge branch 'Anne' into STDChanges
Location:
kernel/GBEngine
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kspoly.cc

    r033053 rc8523f  
    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

    r033053 rc8523f  
    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 -*/
     
    16671701      printf("\nBefore Ll = %i\n", strat->Ll);
    16681702      #endif
    1669       red_result = strat->red(&strat->P,strat);
     1703      #ifdef HAVE_RINGS
     1704      if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing))
     1705      {
     1706        int inittl = strat->tl;
     1707        red_result = strat->red(&strat->P,strat);
     1708        strat->tl = inittl;
     1709      }
     1710      else
     1711      #endif
     1712        red_result = strat->red(&strat->P,strat);
    16701713      #if ADIDEBUG
    16711714      printf("\nThis is P nach red:\n");p_Write(strat->P.p,strat->tailRing);p_Write(strat->P.p1,strat->tailRing);p_Write(strat->P.p2,strat->tailRing);
     
    16991742
    17001743      // put in T
    1701       enterT(strat->P,strat);
     1744      #ifdef HAVE_RINGS
     1745      if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing))
     1746      {
     1747        int inittl = strat->tl;
     1748        enterT(strat->P,strat);
     1749        strat->tl = inittl+1;
     1750      }
     1751      else
     1752        enterT(strat->P,strat);
     1753      #endif
    17021754      // build new pairs
    17031755#ifdef HAVE_RINGS
  • kernel/GBEngine/kstd2.cc

    r5d9204 rc8523f  
    15581558    }
    15591559    #endif
    1560     getchar();
     1560    //getchar();
    15611561    #endif
    15621562    #ifdef KDEBUG
  • kernel/GBEngine/kutil.cc

    r033053 rc8523f  
    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);
     
    13121527  }
    13131528  #endif
     1529  number s, t;
    13141530  poly m1, m2, gcd;
    13151531  #if ADIDEBUG
     
    13331549    if(pm1 == NULL)
    13341550    {
    1335       pDelete(&sim2);
    1336       pDelete(&pm1);
    1337       pDelete(&m1);
    1338       pDelete(&m2);
     1551      //pDelete(&sim2);
     1552      //pDelete(&pm1);
     1553      //pDelete(&gcd);
     1554      //pDelete(&m1);
     1555      //pDelete(&m2);
    13391556      return;
    13401557    }
    13411558    else
    13421559    {
    1343       gcd = p_Copy(pm1, strat->tailRing);
     1560      gcd = pCopy(pm1);
    13441561      pDelete(&pm1);
    13451562      pDelete(&sim2);
     
    14081625  enterL(&strat->B,&strat->Bl,&strat->Bmax,h,posx);
    14091626  kTest_TS(strat);
     1627  #endif
    14101628}
    14111629
     
    14151633*/
    14161634
    1417 BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1)
     1635BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR, bool redMoraNF)
    14181636{
    14191637  number d, s, t;
    1420   assume(i<=strat->sl);
    14211638  assume(atR >= 0);
    1422   poly m1, m2, gcd;
    1423 
    1424   d = n_ExtGcd(pGetCoeff(p), pGetCoeff(strat->S[i]), &s, &t, currRing->cf);
     1639  poly m1, m2, gcd,si;
     1640  if(!redMoraNF)
     1641  {
     1642    assume(i<=strat->sl);
     1643    si = strat->S[i];
     1644  }
     1645  else
     1646  {
     1647    assume(i<=strat->tl);
     1648    si = strat->T[i].p;
     1649  }
     1650  //printf("\n--------------------------------\n");
     1651  //pWrite(p);pWrite(si);
     1652  d = n_ExtGcd(pGetCoeff(p), pGetCoeff(si), &s, &t, currRing->cf);
    14251653
    14261654  if (nIsZero(s) || nIsZero(t))  // evtl. durch divBy tests ersetzen
     
    14321660  }
    14331661
    1434   k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
     1662  k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing);
    14351663  //p_Test(m1,strat->tailRing);
    14361664  //p_Test(m2,strat->tailRing);
    1437   while (! kCheckStrongCreation(atR, m1, i, m2, strat) )
    1438   {
    1439     memset(&(strat->P), 0, sizeof(strat->P));
    1440     kStratChangeTailRing(strat);
    1441     strat->P = *(strat->R[atR]);
    1442     p_LmFree(m1, strat->tailRing);
    1443     p_LmFree(m2, strat->tailRing);
    1444     p_LmFree(gcd, currRing);
    1445     k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
    1446   }
     1665  /*if(!redMoraNF)
     1666  {
     1667    while (! kCheckStrongCreation(atR, m1, i, m2, strat) )
     1668    {
     1669      memset(&(strat->P), 0, sizeof(strat->P));
     1670      kStratChangeTailRing(strat);
     1671      strat->P = *(strat->R[atR]);
     1672      p_LmFree(m1, strat->tailRing);
     1673      p_LmFree(m2, strat->tailRing);
     1674      p_LmFree(gcd, currRing);
     1675      k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing);
     1676    }
     1677  }*/
    14471678  pSetCoeff0(m1, s);
    14481679  pSetCoeff0(m2, t);
     
    14501681  p_Test(m1,strat->tailRing);
    14511682  p_Test(m2,strat->tailRing);
    1452 
     1683  //printf("\n===================================\n");
     1684  //pWrite(m1);pWrite(m2);pWrite(gcd);
    14531685#ifdef KDEBUG
    14541686  if (TEST_OPT_DEBUG)
     
    14651697    wrp(p);
    14661698    Print("\n strat->S[%d]: ", i);
    1467     wrp(strat->S[i]);
     1699    wrp(si);
    14681700    PrintS(" ---> ");
    14691701  }
    14701702#endif
    1471 
    1472   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);
     1703 
     1704  pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(si), m2, strat->tailRing), strat->tailRing);
    14731705  p_LmDelete(m1, strat->tailRing);
    14741706  p_LmDelete(m2, strat->tailRing);
    1475 
    14761707#ifdef KDEBUG
    14771708  if (TEST_OPT_DEBUG)
     
    14881719  h.pCleardenom();
    14891720  strat->initEcart(&h);
    1490   if (strat->Ll==-1)
    1491     posx =0;
    1492   else
    1493     posx = strat->posInL(strat->L,strat->Ll,&h,strat);
    14941721  h.sev = pGetShortExpVector(h.p);
    14951722  h.i_r1 = -1;h.i_r2 = -1;
    14961723  if (currRing!=strat->tailRing)
    1497   {
    1498     if (h.t_p==NULL) /* may already been set by pLdeg() in initEcart */
    1499       h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
    1500   }
    1501   #if 1
    1502   h.p1 = p;h.p2 = strat->S[i];
    1503   #endif
    1504   if (atR >= 0)
     1724    h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
     1725  if(!redMoraNF)
     1726  {
     1727    #if 1
     1728    h.p1 = p;h.p2 = strat->S[i];
     1729    #endif
     1730    if (atR >= 0)
    15051731    {
    15061732      h.i_r2 = strat->S_2_R[i];
     
    15121738      h.i_r2 = -1;
    15131739    }
    1514   enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
     1740    if (strat->Ll==-1)
     1741      posx =0;
     1742    else
     1743      posx = strat->posInL(strat->L,strat->Ll,&h,strat);
     1744    enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
     1745  }
     1746  else
     1747  {
     1748    enterT_strong(h, strat,strat->tl+1);
     1749  }
     1750  //#if 1
    15151751  #if ADIDEBUG
    1516   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);
     1752  printf("\nThis strong poly was added to L:\n");pWrite(h.p);pWrite(h.p1);pWrite(h.p2);
    15171753  #endif
    15181754  return TRUE;
     
    30643300    }
    30653301    #if 1
     3302
    30663303    if (new_pair)
    30673304    {
     
    37473984      && ((iCompH<=strat->syzComp)||(strat->syzComp==0)))
    37483985      {
    3749         enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR);
     3986        enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR, FALSE);
    37503987      }
    37513988    }
     
    38794116void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR)
    38804117{
     4118#if ADIDEBUG
     4119  PrintS("\nEnter superenterpairs\n");
     4120  int iii = strat->Ll;
     4121  printf("\nstrat->tl = %i\n",strat->tl);
     4122#endif
    38814123  assume (rField_is_Ring(currRing));
    38824124  // enter also zero divisor * poly, if this is non zero and of smaller degree
    38834125  if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat);
     4126#if ADIDEBUG
     4127  if(iii==strat->Ll)
     4128  {
     4129    PrintS("\n                enterExtendedSpoly has not changed the list L.\n");
     4130  }
     4131  else
     4132  {
     4133    PrintLn();
     4134    PrintS("\n                enterExtendedSpoly changed the list L:\n");
     4135    for(iii=0;iii<=strat->Ll;iii++)
     4136    {
     4137      Print("\n                L[%d]:\n",iii);
     4138      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     4139      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     4140      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     4141    }
     4142  }
     4143  printf("\nstrat->tl = %i\n",strat->tl);
     4144  iii = strat->Ll;
     4145#endif
    38844146  initenterpairs(h, k, ecart, 0, strat, atR);
     4147#if ADIDEBUG
     4148  if(iii==strat->Ll)
     4149  {
     4150    PrintS("\n                initenterpairs has not changed the list L.\n");
     4151  }
     4152  else
     4153  {
     4154    PrintS("\n                initenterpairs changed the list L:\n");
     4155    for(iii=0;iii<=strat->Ll;iii++)
     4156    {
     4157      Print("\n                L[%d]:\n",iii);
     4158      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     4159      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     4160      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     4161    }
     4162  }
     4163  printf("\nstrat->tl = %i\n",strat->tl);
     4164  iii = strat->Ll;
     4165#endif
    38854166  initenterstrongPairs(h, k, ecart, 0, strat, atR);
     4167#if ADIDEBUG
     4168  if(iii==strat->Ll)
     4169  {
     4170    PrintS("\n                initenterstrongPairs has not changed the list L.\n");
     4171  }
     4172  else
     4173  {
     4174    PrintS("\n                initenterstrongPairs changed the list L:\n");
     4175    for(iii=0;iii<=strat->Ll;iii++)
     4176    {
     4177      Print("\n                L[%d]:\n",iii);
     4178      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     4179      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     4180      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     4181    }
     4182  }
     4183  printf("\nstrat->tl = %i\n",strat->tl);
     4184  PrintS("\nEnd of superenterpairs\n");
     4185#endif
    38864186  clearSbatch(h, k, pos, strat);
     4187#if ADIDEBUG
     4188  printf("\nstrat->tl = %i\n",strat->tl);
     4189#endif
    38874190}
    38884191#endif
     
    38994202  assume (!rField_is_Ring(currRing));
    39004203#endif
     4204  #if ADIDEBUG
     4205        Print("\n    Vor initenterpairs: The new pair list L -- after superenterpairs in loop\n");
     4206        for(int iii=0;iii<=strat->Ll;iii++)
     4207        {
     4208          printf("\n    L[%d]:\n",iii);
     4209          PrintS("         ");p_Write(strat->L[iii].p,strat->tailRing);
     4210          PrintS("         ");p_Write(strat->L[iii].p1,strat->tailRing);
     4211          PrintS("         ");p_Write(strat->L[iii].p2,strat->tailRing);
     4212        }
     4213        #endif
     4214
    39014215  initenterpairs(h,k,ecart,0,strat, atR);
     4216
     4217      #if ADIDEBUG
     4218        Print("\n    Nach initenterpairs: The new pair list L -- after superenterpairs in loop \n");
     4219        for(int iii=0;iii<=strat->Ll;iii++)
     4220        {
     4221          printf("\n    L[%d]:\n",iii);
     4222          PrintS("         ");p_Write(strat->L[iii].p,strat->tailRing);
     4223          PrintS("         ");p_Write(strat->L[iii].p1,strat->tailRing);
     4224          PrintS("         ");p_Write(strat->L[iii].p2,strat->tailRing);
     4225        }
     4226        #endif
     4227
    39024228  if ( (!strat->fromT)
    39034229  && ((strat->syzComp==0)
     
    39124238      j++;
    39134239    }
    3914   }
     4240    //Print("end clearS sl=%d\n",strat->sl);
     4241  }
     4242 // PrintS("end enterpairs\n");
    39154243}
    39164244
     
    76978025  }
    76988026#endif
     8027
    76998028#ifdef HAVE_TAIL_RING
    77008029  if (currRing!=strat->tailRing)
     
    77358064  }
    77368065  strat->T[atT] = (TObject) p;
     8066  #if ADIDEBUG
     8067  printf("\nenterT: add in position %i\n",atT);
     8068  pWrite(p.p);
     8069  #endif
     8070  //printf("\nenterT: neue hingefÃŒgt: lÀnge = %i, ecart = %i\n",p.length,p.ecart);
    77378071
    77388072  if (strat->tailRing != currRing && pNext(p.p) != NULL)
     
    77468080  assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev);
    77478081  strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev);
     8082  #ifdef HAVE_RINGS
     8083  if(rField_is_Ring(currRing) &&
     8084  rHasLocalOrMixedOrdering(currRing) && !n_IsUnit(p.p->coef, currRing->cf))
     8085  {
     8086    #if ADIDEBUG_NF
     8087    printf("\nDas ist p:\n");pWrite(p.p);
     8088    #endif
     8089    for(i=strat->tl;i>=0;i--)
     8090    {
     8091      if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p))
     8092      {
     8093        #if ADIDEBUG_NF
     8094        printf("\nFound one: %i\n",i);pWrite(strat->T[i].p);
     8095        #endif
     8096        enterOneStrongPoly(i,p.p,p.ecart,0,strat,0 , TRUE);
     8097      }
     8098    }
     8099  }
     8100  /*
     8101  printf("\nThis is T:\n");
     8102  for(i=strat->tl;i>=0;i--)
     8103  {
     8104    pWrite(strat->T[i].p);
     8105  }
     8106  //getchar();*/
     8107#endif
     8108  kTest_T(&(strat->T[atT]));
     8109}
     8110
     8111/*2
     8112* puts p to the set T at position atT
     8113*/
     8114void enterT_strong(LObject &p, kStrategy strat, int atT)
     8115{
     8116  int i;
     8117
     8118  pp_Test(p.p, currRing, p.tailRing);
     8119  assume(strat->tailRing == p.tailRing);
     8120  // redMoraNF complains about this -- but, we don't really
     8121  // neeed this so far
     8122  assume(p.pLength == 0 || pLength(p.p) == p.pLength || rIsSyzIndexRing(currRing)); // modulo syzring
     8123  assume(p.FDeg == p.pFDeg());
     8124  assume(!p.is_normalized || nIsOne(pGetCoeff(p.p)));
     8125
     8126#ifdef KDEBUG
     8127  // do not put an LObject twice into T:
     8128  for(i=strat->tl;i>=0;i--)
     8129  {
     8130    if (p.p==strat->T[i].p)
     8131    {
     8132      printf("already in T at pos %d of %d, atT=%d\n",i,strat->tl,atT);
     8133      return;
     8134    }
     8135  }
     8136#endif
     8137
     8138#ifdef HAVE_TAIL_RING
     8139  if (currRing!=strat->tailRing)
     8140  {
     8141    p.t_p=p.GetLmTailRing();
     8142  }
     8143#endif
     8144  strat->newt = TRUE;
     8145  if (atT < 0)
     8146    atT = strat->posInT(strat->T, strat->tl, p);
     8147  if (strat->tl == strat->tmax-1)
     8148    enlargeT(strat->T,strat->R,strat->sevT,strat->tmax,setmaxTinc);
     8149  if (atT <= strat->tl)
     8150  {
     8151#ifdef ENTER_USE_MEMMOVE
     8152    memmove(&(strat->T[atT+1]), &(strat->T[atT]),
     8153            (strat->tl-atT+1)*sizeof(TObject));
     8154    memmove(&(strat->sevT[atT+1]), &(strat->sevT[atT]),
     8155            (strat->tl-atT+1)*sizeof(unsigned long));
     8156#endif
     8157    for (i=strat->tl+1; i>=atT+1; i--)
     8158    {
     8159#ifndef ENTER_USE_MEMMOVE
     8160      strat->T[i] = strat->T[i-1];
     8161      strat->sevT[i] = strat->sevT[i-1];
     8162#endif
     8163      strat->R[strat->T[i].i_r] = &(strat->T[i]);
     8164    }
     8165  }
     8166
     8167  if ((strat->tailBin != NULL) && (pNext(p.p) != NULL))
     8168  {
     8169    pNext(p.p)=p_ShallowCopyDelete(pNext(p.p),
     8170                                   (strat->tailRing != NULL ?
     8171                                    strat->tailRing : currRing),
     8172                                   strat->tailBin);
     8173    if (p.t_p != NULL) pNext(p.t_p) = pNext(p.p);
     8174  }
     8175  strat->T[atT] = (TObject) p;
     8176  #if ADIDEBUG
     8177  printf("\nenterT_strong: add in position %i\n",atT);
     8178  pWrite(p.p);
     8179  #endif
     8180  //printf("\nenterT_strong: neue hingefÃŒgt: lÀnge = %i, ecart = %i\n",p.length,p.ecart);
     8181
     8182  if (strat->tailRing != currRing && pNext(p.p) != NULL)
     8183    strat->T[atT].max = p_GetMaxExpP(pNext(p.p), strat->tailRing);
     8184  else
     8185    strat->T[atT].max = NULL;
     8186
     8187  strat->tl++;
     8188  strat->R[strat->tl] = &(strat->T[atT]);
     8189  strat->T[atT].i_r = strat->tl;
     8190  assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev);
     8191  strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev);
     8192  #if 0
     8193  #ifdef HAVE_RINGS
     8194  if(rField_is_Ring(currRing) && !n_IsUnit(p.p->coef, currRing->cf))
     8195  {
     8196    #if ADIDEBUG_NF
     8197    printf("\nDas ist p:\n");pWrite(p.p);
     8198    #endif
     8199    for(i=strat->tl;i>=0;i--)
     8200    {
     8201      if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p))
     8202      {
     8203        #if ADIDEBUG_NF
     8204        printf("\nFound one: %i\n",i);pWrite(strat->T[i].p);
     8205        #endif
     8206        enterOneStrongPoly(i,p.p,p.ecart,0,strat,0 , TRUE);
     8207      }
     8208    }
     8209  }
     8210  /*
     8211  printf("\nThis is T:\n");
     8212  for(i=strat->tl;i>=0;i--)
     8213  {
     8214    pWrite(strat->T[i].p);
     8215  }
     8216  //getchar();*/
     8217  #endif
     8218  #endif
    77488219  kTest_T(&(strat->T[atT]));
    77498220}
     
    81568627    updateS(TRUE,strat);
    81578628  }
    8158   //if (strat->fromQ!=NULL) omFreeSize(strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
    8159   //strat->fromQ=NULL;
     8629  if (strat->fromQ!=NULL) omFreeSize(strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));
     8630  strat->fromQ=NULL;
    81608631  assume(kTest_TS(strat));
    81618632}
     
    87909261  if((posconst != -1) && (!nIsZero(F->m[posconst]->coef)))
    87919262  {
    8792       //pDelete(&pmon);
     9263      pmon = pCopy(F->m[posconst]);
    87939264      idDelete(&F);
    8794       //idDelete(&monred);
    8795       return NULL;
     9265      idDelete(&monred);
     9266      return pmon;
    87969267  }
    87979268  int idelemQ = 0;
     
    88099280      if((posconst != -1) && (!nIsZero(monred->m[posconst]->coef)))
    88109281      {
     9282          pmon = pCopy(monred->m[posconst]);
    88119283          idDelete(&F);
    88129284          idDelete(&monred);
    8813           return NULL;
     9285          return pmon;
    88149286      }
    88159287  }
     
    88359307              II->m[i+1] = II->m[i];
    88369308      II->m[0] = pOne();
    8837       ideal syz = idSyzygies(II, isNotHomog, NULL);
    8838       //idPrint(syz);
     9309      ideal syz = idSyzygies(II, isNotHomog, NULL);     
    88399310      poly integer = NULL;
    88409311      for(int i = IDELEMS(syz)-1;i>=0; i--)
     
    88429313          if(pGetComp(syz->m[i]) == 1)
    88439314          {
    8844               integer = pHead(syz->m[i]);
    8845               pSetComp(integer,0);
    8846               if(pIsConstant(integer))
     9315              if(pIsConstant(syz->m[i]))
    88479316              {
     9317                  integer = pHead(syz->m[i]);
     9318                  pSetComp(integer, 0);
    88489319                  break;
    88499320              }
     
    88549325      pmon = prMapR(integer, nMap2, QQ_ring, origR);
    88559326      idDelete(&F);
    8856       //idDelete(&monred);
    8857       //idDelete(&II);
    8858       //idDelete(&one);
    8859       //idDelete(&syz);
    8860       //pDelete(&integer);
     9327      idDelete(&monred);
     9328      idDelete(&II);
     9329      idDelete(&one);
     9330      idDelete(&syz);
     9331      pDelete(&integer);
    88619332      rDelete(QQ_ring);
    88629333      return pmon;
     
    89339404  }
    89349405  idDelete(&F);
    8935   //idDelete(&monred);
    8936   //idDelete(&II);
    8937   //idDelete(&one);
    8938   //pDelete(&pmon);
     9406  idDelete(&monred);
     9407  idDelete(&II);
     9408  idDelete(&one);
     9409  pDelete(&pmon);
    89399410  rDelete(QQ_ring);
    89409411  return NULL;
     
    89589429    if(pNext(strat->S[i]) == NULL)
    89599430    {
     9431      //pWrite(p);
     9432      //pWrite(strat->S[i]);
    89609433      while(ok == FALSE)
    89619434      {
    89629435        if(pLmDivisibleBy(strat->S[i], p))
    89639436        {
    8964           number c = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf);
    8965           pSetCoeff(p,c);
     9437          p->coef = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf);
    89669438        }
    89679439        if(nIsZero(p->coef))
     
    89809452        if(pLmDivisibleBy(strat->S[i], pp))
    89819453        {
    8982           number c = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf);
    8983           pSetCoeff(pp,c);
     9454          pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf);
    89849455          if(nIsZero(pp->coef))
    89859456          {
     
    90289499          if(pLmDivisibleBy(strat->S[j], p))
    90299500          {
    9030             number n = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf);
    9031             pSetCoeff(p,n);
     9501            //nDelete(&(p->coef));
     9502            p->coef = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf);
    90329503          }
    90339504          pp = pNext(p);
     
    90429513                if(pLmDivisibleBy(strat->S[j], pp))
    90439514                {
    9044                   number n = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf);
    9045                   pSetCoeff(pp,n);
     9515                  //nDelete(&(pp->coef));
     9516                  pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf);
    90469517                  if(nIsZero(pp->coef))
    90479518                  {
  • kernel/GBEngine/kutil.h

    r033053 rc8523f  
    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);
     
    529530void enterSyz (LObject &p,kStrategy strat, int atT);
    530531void enterT (LObject &p,kStrategy strat, int atT = -1);
     532void enterT_strong (LObject &p,kStrategy strat, int atT = -1);
    531533void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
    532534void HEckeTest (poly pp,kStrategy strat);
Note: See TracChangeset for help on using the changeset viewer.