Changeset a725dae in git for kernel/kutil.cc


Ignore:
Timestamp:
Jan 22, 2006, 5:29:37 AM (18 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
Children:
76a71142ba90e62cb5e72eedf1029c5f98235e46
Parents:
7f06ccaffa6e5a520078549a3e37d7d51d338274
Message:
kutil.h:
---> krude twoPow Funktion

kutil.cc:
---> krude two Pow Funktion
---> alle Kriterien in HAVE_RING2TOM reaktiviert
---> krit. Element durch Multiplikation mit Nullteiler erzeugen (in enterpairs)
      ---> Protokollausgabe Z

kstd2.cc:
---> Fehler in kFindZeroPoly behoben
---> Protokollausgabe z (für ZeroPolynom)


git-svn-id: file:///usr/local/Singular/svn/trunk@8912 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/kutil.cc

    r7f06cca ra725dae  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.15 2006-01-20 01:15:07 wienand Exp $ */
     4/* $Id: kutil.cc,v 1.16 2006-01-22 04:29:37 wienand Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    10051005  pLcm(p,strat->S[i],Lp.lcm);
    10061006  pSetm(Lp.lcm);
    1007 #ifdef HAVE_RING2TOM
     1007#ifdef HAVE_RING2TOM_DEACT
    10081008  if (strat->sugarCrit && currRing->cring == 0)
    10091009#else
     
    10791079  else /*sugarcrit*/
    10801080  {
    1081 #ifdef HAVE_RING2TOM
     1081#ifdef HAVE_RING2TOM_DEACT
    10821082    if (currRing->cring == 0) {
    10831083#endif
     
    11441144  }
    11451145#endif
    1146 #ifdef HAVE_RING2TOM
     1146#ifdef HAVE_RING2TOM_DEACT
    11471147  }
    11481148#endif
     
    15951595}
    15961596
     1597long twoPow(long arg) {
     1598  long t = arg;
     1599  long result = 1;
     1600  while (t > 0) {
     1601    result = 2 * result;
     1602    t--;
     1603  }
     1604  return result;
     1605}
     1606
    15971607/*2
    15981608*(s[0],h),...,(s[k],h) will be put to the pairset L(via initenterpairs)
     
    16011611void enterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR)
    16021612{
     1613#ifdef HAVE_RING2TOM
     1614  // enter also zero divisor * poly, if this is non zero and of smaller degree
     1615  if (currRing->cring == 1)
     1616  {
     1617    if (((long) ((h)->coef)) % 2 == 0)
     1618    {
     1619      long a = ((long) ((h)->coef)) / 2;
     1620      long b = currRing->ch - 1;
     1621      poly p = p_Copy(h->next, strat->tailRing);
     1622      while (a % 2 == 0)
     1623      {
     1624        a = a / 2;
     1625        b--;
     1626      }
     1627      p = p_Mult_nn(p, (number) twoPow(b), strat->tailRing);
     1628
     1629      if (p != NULL)
     1630      {
     1631        if (TEST_OPT_PROT)
     1632        {
     1633          PrintS("Z");
     1634        }
     1635        poly tmp = p_ISet((long) ((p)->coef), currRing);
     1636        for (int i = 1; i <= currRing->N; i++) {
     1637          pSetExp(tmp, i, p_GetExp(p, i, strat->tailRing));
     1638        }
     1639        p_Setm(tmp, currRing);
     1640        p = p_LmDeleteAndNext(p, strat->tailRing);
     1641        pNext(tmp) = p;
     1642
     1643        LObject h;
     1644        h.p = tmp;
     1645        h.tailRing = strat->tailRing;
     1646        if (TEST_OPT_INTSTRATEGY)
     1647        {
     1648          //pContent(h.p);
     1649          h.pCleardenom(); // also does a pContent
     1650        }
     1651        else
     1652        {
     1653          h.pNorm();
     1654        }
     1655        strat->initEcart(&h);
     1656        int posx;
     1657        if (h.p!=NULL)
     1658        {
     1659          if (strat->Ll==-1)
     1660            posx =0;
     1661          else
     1662              posx = strat->posInL(strat->L,strat->Ll,&h,strat);
     1663          h.sev = pGetShortExpVector(h.p);
     1664          h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
     1665          enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
     1666        }
     1667      }
     1668    }
     1669  }
     1670#endif
    16031671  int j=pos;
    16041672
     
    32783346          pos =0;
    32793347        else
    3280             pos = strat->posInL(strat->L,strat->Ll,&h,strat);
     3348          pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    32813349        h.sev = pGetShortExpVector(h.p);
    32823350        enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
Note: See TracChangeset for help on using the changeset viewer.