Changeset a725dae in git


Ignore:
Timestamp:
Jan 22, 2006, 5:29:37 AM (18 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
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
Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/kstd2.cc

    r7f06cca ra725dae  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.8 2006-01-20 01:15:07 wienand Exp $ */
     4/* $Id: kstd2.cc,v 1.9 2006-01-22 04:29:37 wienand Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    164164*/
    165165
     166/* now in kutil.cc
    166167long twoPow(long arg) {
    167168  long t = arg;
     
    173174  return result;
    174175}
     176*/
    175177
    176178long factorial(long arg)
     
    242244    tmp2 = p_ISet((long) pGetCoeff(zeroPoly), leadRing);
    243245    for (int i = 1; i <= leadRing->N; i++) {
    244       pSetExp(tmp2, i, p_GetExp(zeroPoly, i, leadRing));
     246      pSetExp(tmp2, i, p_GetExp(zeroPoly, i, tailRing));
    245247    }
    246248    p_Setm(tmp2, leadRing);
     
    269271    tmp2 = p_ISet((long) pGetCoeff(zeroPoly), leadRing);
    270272    for (int i = 1; i <= leadRing->N; i++) {
    271       pSetExp(tmp2, i, p_GetExp(zeroPoly, i, leadRing));
     273      pSetExp(tmp2, i, p_GetExp(zeroPoly, i, tailRing));
    272274    }
    273275    p_Setm(tmp2, leadRing);
     
    311313//#endif
    312314
    313   h->SetShortExpVector();
     315  h->SetShortExpVector(); 
    314316  loop
    315317  {
    316     zeroPoly = NULL;// kFindDivisibleByZeroPoly(h);
     318    zeroPoly = kFindDivisibleByZeroPoly(h);
    317319    if (zeroPoly != NULL)
    318320    {
     321      if (TEST_OPT_PROT)
     322      {
     323        PrintS("z");
     324      }
    319325#ifdef KDEBUG
    320326      if (TEST_OPT_DEBUG)
     
    331337      tmp_h.sev = pGetShortExpVector(tmp_h.p);
    332338      tmp_h.SetpFDeg();
     339/*      if (TEST_OPT_PROT)
     340      {
     341        tstcount ++;
     342        if (tstcount > 49)
     343        {
     344          PrintLn();
     345          p_wrp(zeroPoly,currRing);
     346          PrintLn();
     347          tstcount = 0;
     348        }
     349      } */
    333350
    334351      enterT(tmp_h, strat, strat->tl + 1);
  • 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);
  • kernel/kutil.h

    r7f06cca ra725dae  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.10 2006-01-16 03:27:10 wienand Exp $ */
     6/* $Id: kutil.h,v 1.11 2006-01-22 04:29:37 wienand Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    391391#ifdef HAVE_RING2TOM
    392392int redRing2toM (LObject* h,kStrategy strat);
     393long twoPow(long arg);
    393394#endif
    394395int redLazy (LObject* h,kStrategy strat);
Note: See TracChangeset for help on using the changeset viewer.