Changeset ac4ff44 in git


Ignore:
Timestamp:
Oct 12, 2018, 2:44:21 PM (6 years ago)
Author:
Christian Eder
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
194f79909c91c263131614aafc678fe53c3c3d4a
Parents:
a9ff57e7b34bc7d0865159255fc179055cdfc745
Message:
removes more useless code, fixes parameter handling of replacement function
Location:
kernel/GBEngine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd2.cc

    ra9ff57 rac4ff44  
    645645        redtailBbaAlsoLC_Z(&h2, j, strat);
    646646        /* replace h2 for tj in L (already generated pairs with tj), S and T */
    647         replaceInLAndSAndT(h2, strat, j);
     647        replaceInLAndSAndT(h2, strat);
    648648      }
    649649    } else {
  • kernel/GBEngine/kutil.cc

    ra9ff57 rac4ff44  
    15001500  enterL(&strat->B,&strat->Bl,&strat->Bmax,h,posx);
    15011501  kTest_TS(strat);
    1502 }
    1503 
    1504 
    1505 int replaceOneSPoly (poly psi,poly p,kStrategy strat, int posInL)
    1506 {
    1507   assume(p!=NULL);
    1508   int      j,compare,compareCoeff;
    1509   LObject  h;
    1510 
    1511 #ifdef KDEBUG
    1512   h.ecart=0; h.length=0;
    1513 #endif
    1514   /*- computes the lcm(s[i],p) -*/
    1515   if(pHasNotCF(p, psi))
    1516   {
    1517       strat->cp++;
    1518       return 0;
    1519   }
    1520   h.lcm = p_Lcm(p, psi, currRing);
    1521   pSetCoeff0(h.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(psi), currRing->cf));
    1522   if (nIsZero(pGetCoeff(h.lcm)))
    1523   {
    1524       strat->cp++;
    1525       pLmDelete(h.lcm);
    1526       return 0;
    1527   }
    1528   number s, t;
    1529   poly m1, m2, gcd = NULL;
    1530   s = pGetCoeff(psi);
    1531   t = pGetCoeff(p);
    1532   k_GetLeadTerms(p, psi, currRing, m1, m2, currRing);
    1533   ksCheckCoeff(&s, &t, currRing->cf);
    1534   pSetCoeff0(m1, s);
    1535   pSetCoeff0(m2, t);
    1536   m2 = pNeg(m2);
    1537   p_Test(m1,strat->tailRing);
    1538   p_Test(m2,strat->tailRing);
    1539   poly si = pCopy(psi);
    1540   poly pm1 = pp_Mult_mm(pNext(p), m1, strat->tailRing);
    1541   poly sim2 = pp_Mult_mm(pNext(si), m2, strat->tailRing);
    1542   pDelete(&si);
    1543   p_LmDelete(m1, currRing);
    1544   p_LmDelete(m2, currRing);
    1545   if(sim2 == NULL)
    1546   {
    1547     if(pm1 == NULL)
    1548     {
    1549       if(h.lcm != NULL)
    1550       {
    1551         pLmDelete(h.lcm);
    1552         h.lcm=NULL;
    1553       }
    1554       return 0;
    1555     }
    1556     else
    1557     {
    1558       gcd = pm1;
    1559       pm1 = NULL;
    1560     }
    1561   }
    1562   else
    1563   {
    1564     if((pGetComp(psi) == 0) && (0 != pGetComp(p)))
    1565     {
    1566       p_SetCompP(sim2, pGetComp(p), strat->tailRing);
    1567       pSetmComp(sim2);
    1568     }
    1569     gcd = p_Add_q(pm1, sim2, strat->tailRing);
    1570   }
    1571   p_Test(gcd, strat->tailRing);
    1572 #ifdef KDEBUG
    1573   if (TEST_OPT_DEBUG)
    1574   {
    1575     wrp(gcd);
    1576     PrintLn();
    1577   }
    1578 #endif
    1579   h.p = gcd;
    1580   h.i_r = -1;
    1581   h.tailRing = strat->tailRing;
    1582   int posx;
    1583   strat->initEcart(&h);
    1584   #if 1
    1585   h.p1 = psi;
    1586   h.p2 = p;
    1587   #endif
    1588   h.i_r1 = strat->L[posInL].i_r1;
    1589   h.i_r2 = strat->L[posInL].i_r2;
    1590   if (currRing!=strat->tailRing)
    1591     h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
    1592   /* delete old and add new pair */
    1593   if (strat->L[posInL].lcm != NULL)
    1594   {
    1595       kDeleteLcm(&(strat->L[posInL]));
    1596   }
    1597   if (strat->L[posInL].p!=NULL)
    1598   {
    1599     if (pNext(strat->L[posInL].p) == strat->tail)
    1600     {
    1601 #ifdef HAVE_RINGS
    1602       if (pGetCoeff(strat->L[posInL].p) != NULL)
    1603         pLmDelete(strat->L[posInL].p);
    1604       else
    1605 #endif
    1606         pLmFree(strat->L[posInL].p);
    1607       /*- tail belongs to several int spolys -*/
    1608     }
    1609     else
    1610     {
    1611       // search p in T, if it is there, do not delete it
    1612       if (rHasGlobalOrdering(currRing) || (kFindInT(strat->L[posInL].p, strat) < 0))
    1613       {
    1614         // assure that for global orderings kFindInT fails
    1615         //assume((rHasLocalOrMixedOrdering(currRing)) && (kFindInT(strat->L[posInL].p, strat) >= 0));
    1616         strat->L[posInL].Delete();
    1617       }
    1618     }
    1619   }
    1620   strat->L[posInL]  = h;
    1621   return 1;
    1622 }
    1623 
    1624 int replaceOneStrongPoly (poly si,poly p,kStrategy strat, int posInL)
    1625 {
    1626   number d, s, t;
    1627   poly m1, m2, gcd;
    1628   //printf("\n--------------------------------\n");
    1629   //pWrite(p);pWrite(si);
    1630   d = n_ExtGcd(pGetCoeff(p), pGetCoeff(si), &s, &t, currRing->cf);
    1631 
    1632   if (nIsZero(s) || nIsZero(t))  // evtl. durch divBy tests ersetzen
    1633   {
    1634     nDelete(&d);
    1635     nDelete(&s);
    1636     nDelete(&t);
    1637     /* we can delete the strong spoly, it is no needed due
    1638      * to the smaller lead coefficient in p.p */
    1639     deleteInL(strat->L, &strat->Ll, posInL, strat);
    1640     return 0;
    1641   }
    1642 
    1643   k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing);
    1644 
    1645   if (!rHasMixedOrdering(currRing)) {
    1646     unsigned long sev = pGetShortExpVector(gcd);
    1647   }
    1648 
    1649   pSetCoeff0(m1, s);
    1650   pSetCoeff0(m2, t);
    1651   pSetCoeff0(gcd, d);
    1652   p_Test(m1,strat->tailRing);
    1653   p_Test(m2,strat->tailRing);
    1654 
    1655   pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(si), m2, strat->tailRing), strat->tailRing);
    1656   p_LmDelete(m1, strat->tailRing);
    1657   p_LmDelete(m2, strat->tailRing);
    1658 #ifdef KDEBUG
    1659   if (TEST_OPT_DEBUG)
    1660   {
    1661     wrp(gcd);
    1662     PrintLn();
    1663   }
    1664 #endif
    1665 
    1666   LObject h;
    1667   h.p = gcd;
    1668   h.tailRing = strat->tailRing;
    1669   int posx;
    1670   h.pCleardenom();
    1671   strat->initEcart(&h);
    1672   h.sev = pGetShortExpVector(h.p);
    1673   h.i_r1 = -1;h.i_r2 = -1;
    1674   if (currRing!=strat->tailRing)
    1675     h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
    1676   #if 1
    1677   h.p1 = si;
    1678   h.p2 = p;
    1679   #endif
    1680   h.i_r1 = strat->L[posInL].i_r1;
    1681   h.i_r2 = strat->L[posInL].i_r2;
    1682 
    1683   /* delete old and add new pair */
    1684   if (strat->L[posInL].lcm != NULL)
    1685   {
    1686       kDeleteLcm(&(strat->L[posInL]));
    1687   }
    1688   if (strat->L[posInL].p!=NULL)
    1689   {
    1690     if (pNext(strat->L[posInL].p) == strat->tail)
    1691     {
    1692 #ifdef HAVE_RINGS
    1693       if (pGetCoeff(strat->L[posInL].p) != NULL)
    1694         pLmDelete(strat->L[posInL].p);
    1695       else
    1696 #endif
    1697         pLmFree(strat->L[posInL].p);
    1698       /*- tail belongs to several int spolys -*/
    1699     }
    1700     else
    1701     {
    1702       // search p in T, if it is there, do not delete it
    1703       if (rHasGlobalOrdering(currRing) || (kFindInT(strat->L[posInL].p, strat) < 0))
    1704       {
    1705         // assure that for global orderings kFindInT fails
    1706         //assume((rHasLocalOrMixedOrdering(currRing)) && (kFindInT(strat->L[posInL].p, strat) >= 0));
    1707         strat->L[posInL].Delete();
    1708       }
    1709     }
    1710   }
    1711   strat->L[posInL]  = h;
    1712 
    1713   return 1;
    17141502}
    17151503
     
    96569444* puts p to the set T at position atT
    96579445*/
    9658 void replaceInLAndSAndT(LObject &p, kStrategy strat, int pos)
     9446void replaceInLAndSAndT(LObject &p, kStrategy strat)
    96599447{
    96609448  p.GetP(strat->lmBin);
  • kernel/GBEngine/kutil.h

    ra9ff57 rac4ff44  
    556556void enterSyz (LObject &p,kStrategy strat, int atT);
    557557void enterT (LObject &p,kStrategy strat, int atT = -1);
    558 void replaceInLAndSAndT(LObject &p, kStrategy strat, int pos);
    559 int replaceOneStrongPoly (poly si,poly p,kStrategy strat, int posInL);
    560 int replaceOneSPoly (poly si,poly p,kStrategy strat, int posInL);
     558void replaceInLAndSAndT(LObject &p, kStrategy strat);
    561559#ifdef HAVE_RINGS
    562560void enterT_strong (LObject &p,kStrategy strat, int atT = -1);
Note: See TracChangeset for help on using the changeset viewer.