Changeset 6d11d2 in git


Ignore:
Timestamp:
Jul 7, 2015, 1:28:17 PM (9 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3d3ab7de4e431d41d91343651c4c8fde36d43d06
Parents:
22d119e2f3926b708140a4db3479c1c31c0ba384
Message:
fix: enterOnePairRing
git diff made it harder to see the diffs:
the big picture: the procedure used before is in #if0 block
and the new one in the #else block.
This commit is followed by one "cleaning" commit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r22d119e r6d11d2  
    11681168void enterOnePairRing (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1)
    11691169{
     1170  #if 0
     1171  assume(i<=strat->sl);
     1172    int      l,j,compare,compareCoeff;
     1173    LObject  Lp;
     1174  omTestMemory(1);
     1175    if (strat->interred_flag) return;
     1176  #ifdef KDEBUG
     1177    Lp.ecart=0; Lp.length=0;
     1178  #endif
     1179    /*- computes the lcm(s[i],p) -*/
     1180    Lp.lcm = pInit();
     1181    pSetCoeff0(Lp.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
     1182 
     1183    // Lp.lcm == 0
     1184    if (nIsZero(pGetCoeff(Lp.lcm)))
     1185    {
     1186  #ifdef KDEBUG
     1187        if (TEST_OPT_DEBUG)
     1188        {
     1189          PrintS("--- Lp.lcm == 0\n");
     1190          PrintS("p:");
     1191          wrp(p);
     1192          Print("  strat->S[%d]:", i);
     1193          wrp(strat->S[i]);
     1194          PrintLn();
     1195        }
     1196  #endif
     1197        strat->cp++;
     1198        pLmDelete(Lp.lcm);
     1199        return;
     1200    }
     1201    omTestMemory(1);
     1202    // basic product criterion
     1203    pLcm(p,strat->S[i],Lp.lcm);
     1204 
     1205    pSetm(Lp.lcm);
     1206    assume(!strat->sugarCrit);
     1207    if (pHasNotCF(p,strat->S[i]) && n_IsUnit(pGetCoeff(p),currRing->cf)
     1208        && n_IsUnit(pGetCoeff(strat->S[i]),currRing->cf))
     1209    {
     1210  #ifdef KDEBUG
     1211        if (TEST_OPT_DEBUG)
     1212        {
     1213          PrintS("--- product criterion func enterOnePairRing type 1\n");
     1214          PrintS("p:");
     1215          wrp(p);
     1216          Print("  strat->S[%d]:", i);
     1217          wrp(strat->S[i]);
     1218          PrintLn();
     1219        }
     1220  #endif
     1221        strat->cp++;
     1222        pLmDelete(Lp.lcm);
     1223        return;
     1224    }
     1225    assume(!strat->fromT);
     1226    omTestMemory(1);
     1227    /*
     1228    *the set B collects the pairs of type (S[j],p)
     1229    *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p) != lcm(r,p)
     1230    *if the leading term of s devides lcm(r,p) then (r,p) will be canceled
     1231    *if the leading term of r devides lcm(s,p) then (s,p) will not enter B
     1232    */
     1233    for(j = strat->Bl;j>=0;j--)
     1234    {
     1235      compare=pDivCompRing(strat->B[j].lcm,Lp.lcm);
     1236      compareCoeff = n_DivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(Lp.lcm), currRing->cf);
     1237      if ((compareCoeff == pDivComp_EQUAL) || (compare == compareCoeff))
     1238      {
     1239        if (compare == 1)
     1240        {
     1241          strat->c3++;
     1242  #ifdef KDEBUG
     1243          if (TEST_OPT_DEBUG)
     1244          {
     1245            PrintS("--- chain criterion type 1\n");
     1246            PrintS("strat->B[j]:");
     1247            wrp(strat->B[j].lcm);
     1248            PrintS("  Lp.lcm:");
     1249            wrp(Lp.lcm);
     1250            PrintLn();
     1251          }
     1252  #endif
     1253          if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     1254          {
     1255            pLmDelete(Lp.lcm);
     1256            return;
     1257          }
     1258          break;
     1259        }
     1260        else
     1261        if (compare == -1)
     1262        {
     1263  #ifdef KDEBUG
     1264          if (TEST_OPT_DEBUG)
     1265          {
     1266            PrintS("--- chain criterion type 2\n");
     1267            Print("strat->B[%d].lcm:",j);
     1268            wrp(strat->B[j].lcm);
     1269            PrintS("  Lp.lcm:");
     1270            wrp(Lp.lcm);
     1271            PrintLn();
     1272          }
     1273  #endif
     1274          deleteInL(strat->B,&strat->Bl,j,strat);
     1275          strat->c3++;
     1276        }
     1277      }
     1278      if ((compare == pDivComp_EQUAL) && (compareCoeff != 2))
     1279      {
     1280        if (compareCoeff == pDivComp_LESS)
     1281        {
     1282  #ifdef KDEBUG
     1283          if (TEST_OPT_DEBUG)
     1284          {
     1285            PrintS("--- chain criterion type 3\n");
     1286            Print("strat->B[%d].lcm:", j);
     1287            wrp(strat->B[j].lcm);
     1288            PrintS("  Lp.lcm:");
     1289            wrp(Lp.lcm);
     1290            PrintLn();
     1291          }
     1292  #endif
     1293          strat->c3++;
     1294          if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     1295          {
     1296            pLmDelete(Lp.lcm);
     1297            return;
     1298          }
     1299          break;
     1300        }
     1301        else
     1302        // Add hint for same LM and LC (later) (TODO Oliver)
     1303        // if (compareCoeff == pDivComp_GREATER)
     1304        {
     1305  #ifdef KDEBUG
     1306          if (TEST_OPT_DEBUG)
     1307          {
     1308            PrintS("--- chain criterion type 4\n");
     1309            Print("strat->B[%d].lcm:", j);
     1310            wrp(strat->B[j].lcm);
     1311            PrintS("  Lp.lcm:");
     1312            wrp(Lp.lcm);
     1313            PrintLn();
     1314          }
     1315  #endif
     1316          deleteInL(strat->B,&strat->Bl,j,strat);
     1317          strat->c3++;
     1318        }
     1319      }
     1320    }
     1321    omTestMemory(1);
     1322    /*
     1323    *the pair (S[i],p) enters B if the spoly != 0
     1324    */
     1325    /*-  compute the short s-polynomial -*/
     1326    if ((strat->S[i]==NULL) || (p==NULL))
     1327    {
     1328  #ifdef KDEBUG
     1329      if (TEST_OPT_DEBUG)
     1330      {
     1331        PrintS("--- spoly = NULL\n");
     1332      }
     1333  #endif
     1334      pLmDelete(Lp.lcm);
     1335      return;
     1336    }
     1337    if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0))
     1338    {
     1339      // Is from a previous computed GB, therefore we know that spoly will
     1340      // reduce to zero. Oliver.
     1341      WarnS("Could we come here? 8738947389");
     1342      Lp.p=NULL;
     1343    }
     1344    else
     1345    {
     1346      Lp.p = ksCreateShortSpoly(strat->S[i], p, strat->tailRing);
     1347    }
     1348    omTestMemory(1);
     1349    if (Lp.p == NULL)
     1350    {
     1351  #ifdef KDEBUG
     1352      if (TEST_OPT_DEBUG)
     1353      {
     1354        PrintS("--- spoly = NULL\n");
     1355      }
     1356  #endif
     1357      /*- the case that the s-poly is 0 -*/
     1358      if (strat->pairtest==NULL) initPairtest(strat);
     1359      strat->pairtest[i] = TRUE;/*- hint for spoly(S^[i],p)=0 -*/
     1360      strat->pairtest[strat->sl+1] = TRUE;
     1361      /*hint for spoly(S[i],p) == 0 for some i,0 <= i <= sl*/
     1362      /*
     1363      *suppose we have (s,r),(r,p),(s,p) and spoly(s,p) == 0 and (r,p) is
     1364      *still in B (i.e. lcm(r,p) == lcm(s,p) or the leading term of s does not
     1365      *devide lcm(r,p)). In the last case (s,r) can be canceled if the leading
     1366      *term of p devides the lcm(s,r)
     1367      *(this canceling should be done here because
     1368      *the case lcm(s,p) == lcm(s,r) is not covered in chainCrit)
     1369      *the first case is handeled in chainCrit
     1370      */
     1371      pLmDelete(Lp.lcm);
     1372      printf("\nsdkjhggh\n");
     1373    }
     1374    else
     1375    {
     1376      /*- the pair (S[i],p) enters B -*/
     1377      Lp.p1 = strat->S[i];
     1378      Lp.p2 = p;
     1379 
     1380      pNext(Lp.p) = strat->tail;
     1381 
     1382      if (atR >= 0)
     1383      {
     1384        Lp.i_r2 = atR;
     1385        Lp.i_r1 = strat->S_2_R[i];
     1386      }
     1387      omTestMemory(1);
     1388      strat->initEcartPair(&Lp,strat->S[i],p,strat->ecartS[i],ecart);
     1389      omTestMemory(1);
     1390      l = strat->posInL(strat->L,strat->Ll,&Lp,strat);
     1391      omTestMemory(1);
     1392      enterL(&strat->L,&strat->Ll,&strat->Lmax,Lp,l);
     1393      omTestMemory(1);
     1394      printf("\nJust printed and retuirned:\n");
     1395    }
     1396  #else
     1397  number s, t;
     1398  assume(i<=strat->sl);
     1399  assume(atR >= 0);
    11701400  assume(i<=strat->sl);
    11711401  int      l,j,compare,compareCoeff;
    1172   LObject  Lp;
     1402  LObject  h;
    11731403
    11741404#ifdef KDEBUG
    1175   Lp.ecart=0; Lp.length=0;
     1405  h.ecart=0; h.length=0;
    11761406#endif
    11771407  /*- computes the lcm(s[i],p) -*/
    1178   Lp.lcm = pInit();
    1179   pSetCoeff0(Lp.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
    1180 
    1181   #if ADIDEBUG
    1182   PrintS("\nLp.lcm (lc) = ");pWrite(Lp.lcm);
    1183   #endif
    1184 
    1185   // Lp.lcm == 0
    1186   if (nIsZero(pGetCoeff(Lp.lcm)))
    1187   {
    1188 #ifdef KDEBUG
    1189       if (TEST_OPT_DEBUG)
    1190       {
    1191         PrintS("--- Lp.lcm == 0\n");
    1192         PrintS("p:");
    1193         wrp(p);
    1194         Print("  strat->S[%d]:", i);
    1195         wrp(strat->S[i]);
    1196         PrintLn();
    1197       }
    1198 #endif
     1408  h.lcm = pInit();
     1409  pSetCoeff0(h.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
     1410
     1411  if (nIsZero(pGetCoeff(h.lcm)))
     1412  {
    11991413      strat->cp++;
    1200       pLmDelete(Lp.lcm);
     1414      pLmDelete(h.lcm);
    12011415      return;
    12021416  }
    1203   // basic product criterion
    1204   pLcm(p,strat->S[i],Lp.lcm);
    1205   pSetm(Lp.lcm);
    1206 
    1207   #if ADIDEBUG
    1208   PrintS("\nLp.lcm (lcm) = ");pWrite(Lp.lcm);
    1209   #endif
    1210 
    1211   assume(!strat->sugarCrit);
    1212   if (pHasNotCF(p,strat->S[i]) && n_IsUnit(pGetCoeff(p),currRing->cf)
    1213       && n_IsUnit(pGetCoeff(strat->S[i]),currRing->cf))
    1214   {
    1215 #ifdef KDEBUG
    1216       if (TEST_OPT_DEBUG)
    1217       {
    1218         PrintS("--- product criterion func enterOnePairRing type 1\n");
    1219         PrintS("p:");
    1220         wrp(p);
    1221         Print("  strat->S[%d]:", i);
    1222         wrp(strat->S[i]);
    1223         PrintLn();
    1224       }
    1225 #endif
    1226       strat->cp++;
    1227       pLmDelete(Lp.lcm);
    1228       return;
    1229   }
    1230   assume(!strat->fromT);
    1231   /*
     1417  #if 0
     1418  // basic chain criterion
     1419  pLcm(p,strat->S[i],h.lcm);
     1420  pSetm(h.lcm);
     1421    /*
    12321422  *the set B collects the pairs of type (S[j],p)
    12331423  *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p) != lcm(r,p)
     
    12351425  *if the leading term of r devides lcm(s,p) then (s,p) will not enter B
    12361426  */
     1427  #if 0
     1428  idPrint(strat->Shdl);
     1429  for(int ii=0; ii<=strat->Ll; ii++)
     1430  {printf("\nL[%i]\n",ii);pWrite(strat->L[ii].p);pWrite(strat->L[ii].p1);pWrite(strat->L[ii].p2);pWrite(strat->L[ii].lcm);}
     1431  for(int ii=0; ii<=strat->Bl; ii++)
     1432  {printf("\nB[%i]\n",ii);pWrite(strat->B[ii].p);pWrite(strat->B[ii].p1);pWrite(strat->B[ii].p2);pWrite(strat->B[ii].lcm);}
     1433  #endif
    12371434  for(j = strat->Bl;j>=0;j--)
    12381435  {
    1239     compare=pDivCompRing(strat->B[j].lcm,Lp.lcm);
    1240     compareCoeff = n_DivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(Lp.lcm), currRing->cf);
     1436    compare=pDivCompRing(strat->B[j].lcm,h.lcm);
     1437    compareCoeff = n_DivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(h.lcm), currRing->cf);
    12411438    if ((compareCoeff == pDivComp_EQUAL) || (compare == compareCoeff))
    12421439    {
     
    12441441      {
    12451442        strat->c3++;
    1246 #ifdef KDEBUG
    1247         if (TEST_OPT_DEBUG)
    1248         {
    1249           PrintS("--- chain criterion type 1\n");
     1443        /*PrintS("--- chain criterion type 1\n");
    12501444          PrintS("strat->B[j]:");
    12511445          wrp(strat->B[j].lcm);
    1252           PrintS("  Lp.lcm:");
    1253           wrp(Lp.lcm);
    1254           PrintLn();
    1255         }
    1256 #endif
    1257         if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
    1258         {
    1259           pLmDelete(Lp.lcm);
     1446          PrintS("  h.lcm:");
     1447          wrp(h.lcm);
     1448          PrintLn();*/
     1449        if ((n_DivBy(h.lcm->coef,strat->B[j].lcm->coef,  currRing->cf) == 0) && ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)))
     1450        {
     1451          pLmDelete(h.lcm);
    12601452          return;
    12611453        }
     
    12641456      else if (compare == -1)
    12651457      {
    1266 #ifdef KDEBUG
    1267         if (TEST_OPT_DEBUG)
    1268         {
     1458          /*
    12691459          PrintS("--- chain criterion type 2\n");
    12701460          Print("strat->B[%d].lcm:",j);
    12711461          wrp(strat->B[j].lcm);
    1272           PrintS("  Lp.lcm:");
    1273           wrp(Lp.lcm);
    1274           PrintLn();
    1275         }
    1276 #endif
    1277         deleteInL(strat->B,&strat->Bl,j,strat);
    1278         strat->c3++;
     1462          PrintS("  h.lcm:");
     1463          wrp(h.lcm);
     1464          PrintLn();*/
     1465          if(n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf) == 0)
     1466          {
     1467            deleteInL(strat->B,&strat->Bl,j,strat);
     1468            strat->c3++;
     1469          }
    12791470      }
    12801471    }
     
    12831474      if (compareCoeff == pDivComp_LESS)
    12841475      {
    1285 #ifdef KDEBUG
    1286         if (TEST_OPT_DEBUG)
    1287         {
    1288           PrintS("--- chain criterion type 3\n");
     1476        /*PrintS("--- chain criterion type 3\n");
    12891477          Print("strat->B[%d].lcm:", j);
    12901478          wrp(strat->B[j].lcm);
    1291           PrintS("  Lp.lcm:");
    1292           wrp(Lp.lcm);
    1293           PrintLn();
    1294         }
    1295 #endif
     1479          PrintS("  h.lcm:");
     1480          wrp(h.lcm);
     1481          PrintLn();*/
    12961482        strat->c3++;
    1297         if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
    1298         {
    1299           pLmDelete(Lp.lcm);
     1483        if ((n_DivBy(h.lcm->coef,strat->B[j].lcm->coef,  currRing->cf) == 0) && (strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     1484        {
     1485          pLmDelete(h.lcm);
    13001486          return;
    13011487        }
     
    13061492      // if (compareCoeff == pDivComp_GREATER)
    13071493      {
    1308 #ifdef KDEBUG
    1309         if (TEST_OPT_DEBUG)
    1310         {
    1311           PrintS("--- chain criterion type 4\n");
     1494        /*PrintS("--- chain criterion type 4\n");
    13121495          Print("strat->B[%d].lcm:", j);
    13131496          wrp(strat->B[j].lcm);
    1314           PrintS("  Lp.lcm:");
    1315           wrp(Lp.lcm);
     1497          PrintS("  h.lcm:");
     1498          wrp(h.lcm);
    13161499          PrintLn();
    1317         }
    1318 #endif
    1319         deleteInL(strat->B,&strat->Bl,j,strat);
    1320         strat->c3++;
    1321       }
    1322     }
    1323   }
    1324   /*
    1325   *the pair (S[i],p) enters B if the spoly != 0
    1326   */
    1327   /*-  compute the short s-polynomial -*/
    1328   if ((strat->S[i]==NULL) || (p==NULL))
    1329   {
     1500          printf("\ndivby = %i\n", n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf));*/
     1501        if(n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf) == 0)
     1502        {
     1503          deleteInL(strat->B,&strat->Bl,j,strat);
     1504          strat->c3++;
     1505        }
     1506      }
     1507    }
     1508  }
     1509  #endif
     1510  poly m1, m2, gcd;
     1511  //#if 1
     1512  #if ADIDEBUG
     1513  printf("\nTrying to add spair S[%i] und p\n",i);pWrite(strat->S[i]);pWrite(p);
     1514  #endif
     1515  s = pGetCoeff(strat->S[i]);
     1516  t = pGetCoeff(p);
     1517  k_GetLeadTerms(p,strat->S[i],currRing,m1,m2,currRing);
     1518  ksCheckCoeff(&s, &t, currRing->cf);
     1519  pSetCoeff0(m1, s);
     1520  pSetCoeff0(m2, t);
     1521  pNeg(m2);
     1522  p_Test(m1,strat->tailRing);
     1523  p_Test(m2,strat->tailRing);
     1524  poly si = pCopy(strat->S[i]);
     1525  poly pm1 = pp_Mult_mm(pNext(p), m1, strat->tailRing);
     1526  poly sim2 = pp_Mult_mm(pNext(si), m2, strat->tailRing);
     1527  if(sim2 == NULL)
     1528  {
     1529    if(pm1 == NULL)
     1530    {
     1531      return;
     1532    }
     1533    else
     1534    {
     1535      gcd = pCopy(pm1);
     1536    }
     1537  }
     1538  else
     1539  {
     1540    if((pGetComp(strat->S[i]) == 0) && (0 != pGetComp(p)))
     1541    {
     1542      p_SetCompP(sim2, pGetComp(p), strat->tailRing);
     1543      pSetmComp(sim2);
     1544    }
     1545    //p_Write(pm1,strat->tailRing);p_Write(sim2,strat->tailRing);
     1546    gcd = p_Add_q(pm1, sim2, strat->tailRing);
     1547  }
     1548  p_Test(gcd, strat->tailRing);
     1549  p_LmDelete(m1, strat->tailRing);
     1550  p_LmDelete(m2, strat->tailRing);
    13301551#ifdef KDEBUG
    1331     if (TEST_OPT_DEBUG)
    1332     {
    1333       PrintS("--- spoly = NULL\n");
    1334     }
    1335 #endif
    1336     pLmDelete(Lp.lcm);
     1552  if (TEST_OPT_DEBUG)
     1553  {
     1554    wrp(gcd);
     1555    PrintLn();
     1556  }
     1557#endif
     1558  //LObject h;
     1559  h.p = gcd;
     1560  h.i_r = -1;
     1561  if(h.p == NULL)
    13371562    return;
    1338   }
    1339   if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0))
    1340   {
    1341     // Is from a previous computed GB, therefore we know that spoly will
    1342     // reduce to zero. Oliver.
    1343     WarnS("Could we come here? 8738947389");
    1344     Lp.p=NULL;
    1345   }
     1563  h.tailRing = strat->tailRing;
     1564  int posx;
     1565  h.pCleardenom();
     1566  //printf("\nThis is our new achieved polynomial:\n");pWrite(gcd);
     1567  if(h.p == NULL)
     1568    return;
     1569  pSetm(h.p);
     1570  //#if 1
     1571  #if ADIDEBUG
     1572  printf("\nThis is afterwards:\n");
     1573  pWrite(h.p);
     1574  #endif
     1575  h.i_r1 = -1;h.i_r2 = -1;
     1576  strat->initEcart(&h);
     1577  #if 1
     1578  h.p2 = strat->S[i];
     1579  h.p1 = p;
     1580  #endif
     1581  #if 1
     1582  if (atR >= 0)
     1583      {
     1584        h.i_r1 = atR;
     1585        h.i_r2 = strat->S_2_R[i];
     1586      }
     1587  #endif
     1588  if (strat->Bl==-1)
     1589    posx =0;
    13461590  else
    1347   {
    1348     Lp.p = ksCreateShortSpoly(strat->S[i], p, strat->tailRing);
    1349   }
    1350   if (Lp.p == NULL)
    1351   {
    1352 #ifdef KDEBUG
    1353     if (TEST_OPT_DEBUG)
    1354     {
    1355       PrintS("--- spoly = NULL\n");
    1356     }
    1357 #endif
    1358     /*- the case that the s-poly is 0 -*/
    1359     if (strat->pairtest==NULL) initPairtest(strat);
    1360     strat->pairtest[i] = TRUE;/*- hint for spoly(S^[i],p)=0 -*/
    1361     strat->pairtest[strat->sl+1] = TRUE;
    1362     /*hint for spoly(S[i],p) == 0 for some i,0 <= i <= sl*/
    1363     /*
    1364     *suppose we have (s,r),(r,p),(s,p) and spoly(s,p) == 0 and (r,p) is
    1365     *still in B (i.e. lcm(r,p) == lcm(s,p) or the leading term of s does not
    1366     *devide lcm(r,p)). In the last case (s,r) can be canceled if the leading
    1367     *term of p devides the lcm(s,r)
    1368     *(this canceling should be done here because
    1369     *the case lcm(s,p) == lcm(s,r) is not covered in chainCrit)
    1370     *the first case is handeled in chainCrit
    1371     */
    1372     pLmDelete(Lp.lcm);
    1373   }
    1374   else
    1375   {
    1376     /*- the pair (S[i],p) enters B -*/
    1377     Lp.p1 = strat->S[i];
    1378     Lp.p2 = p;
    1379 
    1380     pNext(Lp.p) = strat->tail;
    1381 
    1382     if (atR >= 0)
    1383     {
    1384       Lp.i_r2 = atR;
    1385       Lp.i_r1 = strat->S_2_R[i];
    1386     }
    1387     strat->initEcartPair(&Lp,strat->S[i],p,strat->ecartS[i],ecart);
    1388     l = strat->posInL(strat->B,strat->Bl,&Lp,strat);
    1389     enterL(&strat->B,&strat->Bl,&strat->Bmax,Lp,l);
    1390   }
     1591    posx = strat->posInL(strat->B,strat->Bl,&h,strat);
     1592  h.sev = pGetShortExpVector(h.p);
     1593  if (currRing!=strat->tailRing)
     1594    h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
     1595  #if ADIDEBUG
     1596  printf("\nThis s-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);
     1597  #endif
     1598  enterL(&strat->B,&strat->Bl,&strat->Bmax,h,posx);
     1599  #if 0
     1600  for(int i=0; i<=strat->Bl; i++)
     1601  {
     1602    printf("\n    B[%i]\n",i);
     1603    p_Write(strat->B[i].p, strat->B[i].tailRing);
     1604    p_Write(strat->B[i].p1, strat->B[i].tailRing);
     1605    p_Write(strat->B[i].p2, strat->B[i].tailRing);
     1606  }
     1607  #endif
     1608  kTest_TS(strat);
    13911609}
    13921610
Note: See TracChangeset for help on using the changeset viewer.