Changeset 06abb07 in git for kernel/GBEngine


Ignore:
Timestamp:
Sep 19, 2016, 2:23:44 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
59dca7d44c6d942796166db1c0ac9621d2a5ee39
Parents:
c4ead28a352d5f3846b80a454f239a0ef2b5af5a
Message:
chg: n_...(...,ring) -> n_....(...,coeff) for better debugging
Location:
kernel/GBEngine
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kInline.h

    rc4ead28 r06abb07  
    11301130    if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at]))
    11311131      return;
    1132     if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing))
     1132    if(!n_DivBy(pGetCoeff(strat->S[*at]), pGetCoeff(p), currRing->cf))
    11331133      return;
    11341134  }
  • kernel/GBEngine/kspoly.cc

    rc4ead28 r06abb07  
    9797  {                       // just cancel the leading term
    9898    PR->LmDeleteAndIter();
    99     if (coef != NULL) *coef = n_Init(1, tailRing);
     99    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    100100    return 0;
    101101  }
     
    123123
    124124  // take care of coef buisness
    125   if (! n_IsOne(pGetCoeff(p2), tailRing))
     125  if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
    126126  {
    127127    number bn = pGetCoeff(lm);
     
    132132      PR->Tail_Mult_nn(an);
    133133    if (coef != NULL) *coef = an;
    134     else n_Delete(&an, tailRing);
     134    else n_Delete(&an, tailRing->cf);
    135135  }
    136136  else
    137137  {
    138     if (coef != NULL) *coef = n_Init(1, tailRing);
     138    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    139139  }
    140140
     
    303303  {                       // just cancel the leading term
    304304    PR->LmDeleteAndIter();
    305     if (coef != NULL) *coef = n_Init(1, tailRing);
     305    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    306306    return 0;
    307307  }
     
    329329
    330330  // take care of coef buisness
    331   if (! n_IsOne(pGetCoeff(p2), tailRing))
     331  if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
    332332  {
    333333    number bn = pGetCoeff(lm);
     
    338338      PR->Tail_Mult_nn(an);
    339339    if (coef != NULL) *coef = an;
    340     else n_Delete(&an, tailRing);
     340    else n_Delete(&an, tailRing->cf);
    341341  }
    342342  else
    343343  {
    344     if (coef != NULL) *coef = n_Init(1, tailRing);
     344    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    345345  }
    346346
     
    553553  {                       // just cancel the leading term
    554554    PR->LmDeleteAndIter();
    555     if (coef != NULL) *coef = n_Init(1, tailRing);
     555    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    556556    return 0;
    557557  }
     
    581581  {
    582582    p_SetCoeff(lm, nDiv(pGetCoeff(lm),pGetCoeff(p2)), tailRing);
    583     if (coef != NULL) *coef = n_Init(1, tailRing);
     583    if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    584584  }
    585585  else
    586586  {
    587     if (! n_IsOne(pGetCoeff(p2), tailRing))
     587    if (! n_IsOne(pGetCoeff(p2), tailRing->cf))
    588588    {
    589589      number bn = pGetCoeff(lm);
     
    594594        PR->Tail_Mult_nn(an);
    595595      if (coef != NULL) *coef = an;
    596       else n_Delete(&an, tailRing);
    597     }
    598     else
    599     {
    600       if (coef != NULL) *coef = n_Init(1, tailRing);
     596      else n_Delete(&an, tailRing->cf);
     597    }
     598    else
     599    {
     600      if (coef != NULL) *coef = n_Init(1, tailRing->cf);
    601601    }
    602602  }
     
    772772  if (!ret)
    773773  {
    774     if (! n_IsOne(coef, currRing))
     774    if (! n_IsOne(coef, currRing->cf))
    775775    {
    776776      pNext(Current) = NULL;
     
    780780    }
    781781
    782     n_Delete(&coef, currRing);
     782    n_Delete(&coef, currRing->cf);
    783783    pNext(Current) = Red.GetLmTailRing();
    784784    if (Current == PR->p && PR->t_p != NULL)
  • kernel/GBEngine/kstd1.cc

    rc4ead28 r06abb07  
    443443            p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], h->GetLmTailRing(), ~h->sev, strat->tailRing)
    444444            &&
    445             n_DivBy(h->p->coef,strat->T[i].p->coef,strat->tailRing))
     445            n_DivBy(h->p->coef,strat->T[i].p->coef,strat->tailRing->cf))
    446446#else
    447447          j = kFindDivisibleByInT(strat, h, i);
     
    859859    #endif
    860860    if (p_LmShortDivisibleBy(strat->T[j].GetLmTailRing(), strat->sevT[j], H.GetLmTailRing(), not_sev, strat->tailRing)
    861         && (n_DivBy(H.p->coef, strat->T[j].p->coef,strat->tailRing))
     861        && (n_DivBy(H.p->coef, strat->T[j].p->coef,strat->tailRing->cf))
    862862        )
    863863    {
     
    885885        && (strat->T[j].length < li)))
    886886        && pLmShortDivisibleBy(strat->T[j].p,strat->sevT[j], H.p, not_sev)
    887         && (n_DivBy(H.p->coef, strat->T[j].p->coef,strat->tailRing))
     887        && (n_DivBy(H.p->coef, strat->T[j].p->coef,strat->tailRing->cf))
    888888        )
    889889        {
  • kernel/GBEngine/kstd2.cc

    rc4ead28 r06abb07  
    108108        if (p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r))
    109109        {
    110           if(n_DivBy(p_GetCoeff(p,r), p_GetCoeff(T[j].p,r), r))
     110          if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].p), r->cf))
    111111            return j;
    112112        }
     
    115115          p_LmDivisibleBy(T[j].p, p, r))
    116116        {
    117           if(n_DivBy(p_GetCoeff(p,r), p_GetCoeff(T[j].p,r), r))
     117          if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].p), r->cf))
    118118            return j;
    119119        }
     
    156156                               p, not_sev, r))
    157157        {
    158           if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].t_p), r))
     158          if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].t_p), r->cf))
    159159            return j;
    160160        }
     
    163163          p_LmDivisibleBy(T[j].t_p, p, r))
    164164        {
    165           if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].t_p), r))
     165          if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].t_p), r->cf))
    166166            return j;
    167167        }
     
    220220                             p, not_sev, currRing))
    221221      {
    222         if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing))
     222        if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing->cf))
    223223          return j;
    224224      }
     
    227227         p_LmDivisibleBy(strat->S[j], p, currRing))
    228228      {
    229         if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing))
     229        if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing->cf))
    230230          return j;
    231231      }
     
    278278                             p, not_sev, currRing))
    279279      {
    280         if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing))
     280        if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing->cf))
    281281          return j;
    282282      }
     
    285285         p_LmDivisibleBy(strat->S[j], p, currRing))
    286286      {
    287         if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing))
     287        if(n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), currRing->cf))
    288288          return j;
    289289      }
  • kernel/GBEngine/kutil.cc

    rc4ead28 r06abb07  
    40404040          for (i=strat->Bl; i>=0; i--)
    40414041          {
    4042             if (pDivisibleBy(strat->S[j],strat->B[i].lcm) && n_DivBy(strat->B[i].lcm->coef, strat->S[j]->coef,currRing))
     4042            if (pDivisibleBy(strat->S[j],strat->B[i].lcm) && n_DivBy(pGetCoeff(strat->B[i].lcm), pGetCoeff(strat->S[j]),currRing->cf))
    40434043            {
    40444044#ifdef KDEBUG
     
    71387138    if (p_LmShortDivisibleBy(strat->syz[k], strat->sevSyz[k], sig, not_sevSig, currRing)
    71397139    && (!rField_is_Ring(currRing) ||
    7140     (n_DivBy(pGetCoeff(sig), pGetCoeff(strat->syz[k]),currRing) && pLtCmp(sig,strat->syz[k]) == 1)))
     7140    (n_DivBy(pGetCoeff(sig), pGetCoeff(strat->syz[k]),currRing->cf) && pLtCmp(sig,strat->syz[k]) == 1)))
    71417141    {
    71427142//#if 1
     
    71957195      if (p_LmShortDivisibleBy(strat->syz[k], strat->sevSyz[k], sig, not_sevSig, currRing)
    71967196      && (!rField_is_Ring(currRing) ||
    7197       (n_DivBy(pGetCoeff(sig), pGetCoeff(strat->syz[k]),currRing) && pLtCmp(sig,strat->syz[k]) == 1)))
     7197      (n_DivBy(pGetCoeff(sig), pGetCoeff(strat->syz[k]),currRing->cf) && pLtCmp(sig,strat->syz[k]) == 1)))
    71987198      {
    71997199        #ifdef ADIDEBUG
     
    74117411  #if defined(PDEBUG) || defined(PDIV_DEBUG)
    74127412        if (strat->S[j]!= NULL && p_LmShortDivisibleBy(strat->S[j], sev[j], p, not_sev, r) &&
    7413             (ecart== LONG_MAX || ecart>= strat->ecartS[j]) && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r))
     7413            (ecart== LONG_MAX || ecart>= strat->ecartS[j]) && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r->cf))
    74147414        {
    74157415          break;
     
    74187418        if (!(sev[j] & not_sev) &&
    74197419            (ecart== LONG_MAX || ecart>= strat->ecartS[j]) &&
    7420             p_LmDivisibleBy(strat->S[j], p, r) && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r))
     7420            p_LmDivisibleBy(strat->S[j], p, r) && n_DivBy(pGetCoeff(p), pGetCoeff(strat->S[j]), r->cf))
    74217421        {
    74227422          break;
     
    74837483        assume(t != NULL && t->t_p != NULL && t->tailRing == r);
    74847484        if (p_LmShortDivisibleBy(t->t_p, sev[j], p, not_sev, r) &&
    7485             (ecart== LONG_MAX || ecart>= strat->ecartS[j]) && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r))
     7485            (ecart== LONG_MAX || ecart>= strat->ecartS[j]) && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r->cf))
    74867486        {
    74877487          return t;
     
    74927492          t = strat->S_2_T(j);
    74937493          assume(t != NULL && t->t_p != NULL && t->tailRing == r && t->p == strat->S[j]);
    7494           if (p_LmDivisibleBy(t->t_p, p, r) && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r))
     7494          if (p_LmDivisibleBy(t->t_p, p, r) && n_DivBy(pGetCoeff(p), pGetCoeff(t->t_p), r->cf))
    74957495          {
    74967496            return t;
     
    96159615                              #ifdef HAVE_RINGS
    96169616                              &&((!rField_is_Ring(currRing))
    9617                               || (n_DivBy(pGetCoeff(strat->L[cc].sig),pGetCoeff(strat->syz[atT]),currRing) && (pLtCmp(strat->L[cc].sig,strat->syz[atT])==1)))
     9617                              || (n_DivBy(pGetCoeff(strat->L[cc].sig),pGetCoeff(strat->syz[atT]),currRing->cf) && (pLtCmp(strat->L[cc].sig,strat->syz[atT])==1)))
    96189618                              #endif
    96199619                              )
     
    1035310353            &&(pLmDivisibleBy(Q->m[q],r->m[l])))
    1035410354            {
    10355               if(n_DivBy(r->m[l]->coef, Q->m[q]->coef, currRing))
     10355              if(n_DivBy(r->m[l]->coef, Q->m[q]->coef, currRing->cf))
    1035610356              {
    1035710357                if (TEST_OPT_REDSB)
     
    1041610416          for(q=IDELEMS(Q)-1; q>=0;q--)
    1041710417          {
    10418             if(n_DivBy(r->m[l]->coef, Q->m[q]->coef, currRing))
     10418            if(n_DivBy(r->m[l]->coef, Q->m[q]->coef, currRing->cf))
    1041910419            {
    1042010420              if ((Q->m[q]!=NULL)&&(pLmEqual(Q->m[q],r->m[l])) && pDivisibleBy(Q->m[q],r->m[l]))
     
    1045310453              && (r->m[q]!=NULL)
    1045410454              &&(pLmDivisibleBy(r->m[l],r->m[q]))
    10455               &&(n_DivBy(r->m[q]->coef, r->m[l]->coef, currRing))
     10455              &&(n_DivBy(r->m[q]->coef, r->m[l]->coef, currRing->cf))
    1045610456              )
    1045710457              {
    1045810458                //If they are equal then take the one with the smallest length
    1045910459                if(pLmDivisibleBy(r->m[q],r->m[l])
    10460                 && n_DivBy(r->m[q]->coef, r->m[l]->coef, currRing)
     10460                && n_DivBy(r->m[q]->coef, r->m[l]->coef, currRing->cf)
    1046110461                && (pLength(r->m[q]) < pLength(r->m[l]) ||
    1046210462                (pLength(r->m[q]) == pLength(r->m[l]) && nGreaterZero(r->m[q]->coef))))
  • kernel/GBEngine/tgb.cc

    rc4ead28 r06abb07  
    8383  else
    8484  {
    85     return n_Size (n, r);
     85    return n_Size (n, r->cf);
    8686  }
    8787}
     
    143143{
    144144  poly rc = p_Init_Special (r);
    145   pSetCoeff0 (rc, n_Init (1, r));
     145  pSetCoeff0 (rc, n_Init (1, r->cf));
    146146  return rc;
    147147}
  • kernel/GBEngine/tgbgauss.cc

    rc4ead28 r06abb07  
    510510    {
    511511      StringSetS("");
    512       n_Write(n[i][j],currRing);
     512      n_Write(n[i][j],currRing->cf);
    513513      char *s=StringEndS();
    514514      PrintS(s);
     
    711711      StringSetS("");
    712712      number n=get(i,j);
    713       n_Write(n,currRing);
     713      n_Write(n,currRing->cf);
    714714      char *s=StringEndS();
    715715      PrintS(s);
     
    842842      if (currRing==r) {nTest(m->coef);}
    843843      #endif
    844       n_Normalize(m->coef,r);
     844      n_Normalize(m->coef,r->cf);
    845845      m=m->next;
    846846    }
Note: See TracChangeset for help on using the changeset viewer.