Changeset c25b56c in git


Ignore:
Timestamp:
Aug 6, 2013, 4:02:20 PM (11 years ago)
Author:
Adrian Popescu <adi_popescum@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
3ed6cb7c0359a1466ef15624e7b5eafdc2eb1a8e
Parents:
537733fc1137fef8870804ba8fd5021dbcafa68d
git-author:
Adrian Popescu <adi_popescum@yahoo.de>2013-08-06 16:02:20+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-08-06 17:24:42+02:00
Message:
SB over rings with local ordering

add: new tests
Files:
6 added
9 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r537733f rc25b56c  
    24872487  rComplete(R);
    24882488
    2489 #ifdef HAVE_RINGS
     2489/*#ifdef HAVE_RINGS
    24902490// currently, coefficients which are ring elements require a global ordering:
    24912491  if (rField_is_Ring(R) && (R->OrdSgn==-1))
     
    24942494    goto rCompose_err;
    24952495  }
    2496 #endif
     2496#endif*/
    24972497
    24982498
     
    53295329    goto rInitError;
    53305330
    5331 #ifdef HAVE_RINGS
     5331/*#ifdef HAVE_RINGS
    53325332// currently, coefficients which are ring elements require a global ordering:
    53335333  if (rField_is_Ring(R) && (R->OrdSgn==-1))
     
    53365336    goto rInitError;
    53375337  }
    5338 #endif
     5338#endif*/
    53395339
    53405340  rTest(R);
  • Tst/New.lst

    r537733f rc25b56c  
    3535New/std_prot.tst
    3636New/interred_prot.tst
     37New/ringlocal.tst
     38New/hilblocinhom.tst
  • kernel/hdegree.cc

    r537733f rc25b56c  
    985985  int  i;
    986986  int  k = ak;
     987 
     988  #if HAVE_RINGS
     989  if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1))
     990  {
     991  //consider just monic generators (over rings with zero-divisors)
     992  ideal SS=id_Copy(S,tailRing);
     993  for(i=0;i<=idElem(SS);i++)
     994        {
     995        if(pIsPurePower(SS->m[i])==0)
     996                p_Delete(&SS->m[i],tailRing);
     997        }
     998        S=id_Copy(SS,tailRing);
     999  }
     1000  #endif
     1001
    9871002  hNvar = (currRing->N);
    9881003  hexist = hInit(S, Q, &hNexist, tailRing);
  • kernel/kInline.h

    r537733f rc25b56c  
    10041004// get m1 = LCM(LM(p1), LM(p2))/LM(p1)
    10051005//     m2 = LCM(LM(p1), LM(p2))/LM(p2)   in tailRing
    1006 //    lcm = LCM(LM(p1), LM(p2)           in leadRing
     1006//    lcm = LCM(LM(p1), LM(p2))          in leadRing
    10071007KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
    10081008                               poly &m1, poly &m2, poly &lcm, const ring tailRing)
  • kernel/kstd1.cc

    r537733f rc25b56c  
    1919# define MYTEST 0
    2020#endif /* ifndef NDEBUG */
     21
     22#define ADIDEBUG 0
     23#define ADIDEBUG_NF 0
    2124
    2225
     
    355358}
    356359
     360int redRiloc (LObject* h,kStrategy strat)
     361{
     362  int i,at,ei,li,ii;
     363  int j = 0;
     364  int pass = 0;
     365  long d,reddeg;
     366 
     367 
     368        #if ADIDEBUG_NF
     369        int iii;
     370        PrintLn();
     371        PrintS("---------------------------- NEW REDRILOC COMPUTATION ----------------------------");
     372        PrintLn();
     373        PrintS("                The pair h : "); PrintLn(); PrintLn();
     374        PrintS("                        p1 = "); p_Write(h->p1,strat->tailRing); PrintLn();
     375        PrintS("                        p2 = "); p_Write(h->p2,strat->tailRing); PrintLn();
     376        PrintS("                        p  = "); p_Write(h->p,strat->tailRing); PrintLn();
     377        PrintLn();
     378        PrintS("                The actual reducer T is: ");
     379        if(strat->tl<0)
     380                {PrintS(" Empty.");PrintLn();}
     381        else
     382        for (iii=0;iii<=strat->tl;iii++)
     383                {
     384                PrintLn();
     385                PrintS("                        T[");printf("%i",iii);PrintS("] = ");p_Write(strat->T[iii].p,strat->tailRing);
     386                PrintLn();
     387                }
     388        #endif /* ADIDEBUG_NF */
     389       
     390  d = h->GetpFDeg()+ h->ecart;
     391  reddeg = strat->LazyDegree+d;
     392  h->SetShortExpVector();
     393  #if ADIDEBUG_NF
     394        PrintLn();
     395  PrintS("      Searching for a poly in T that divides h (of ecart ");
     396  printf("%i",h->ecart);PrintS(") ...");
     397  PrintLn();
     398  #endif
     399  loop
     400  {
     401    j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     402    #if ADIDEBUG_NF
     403        if(j != -1)
     404                {
     405                ei = strat->T[j].ecart;
     406                PrintLn();
     407                PrintS("                Found one: T[");printf("%i",j);
     408                PrintS("] of ecart ");printf("%i",ei);
     409                PrintS(": ");p_Write(strat->T[j].p,strat->tailRing);
     410                PrintLn();
     411                PrintS("                Try to find another with smaller ecart:");
     412                PrintLn();
     413                }
     414          else
     415                {
     416                PrintLn();
     417                PrintS("                No poly in T divides h.");
     418                PrintLn();
     419                }
     420         #endif
     421    if (j < 0)
     422    {
     423      if (strat->honey) h->SetLength(strat->length_pLength);
     424      return 1;
     425    }
     426
     427    ei = strat->T[j].ecart;
     428    ii = j;
     429                #if ADIDEBUG_NF
     430                iii=ii;
     431                #endif
     432    if (ei > h->ecart && ii < strat->tl)
     433    {
     434        li = strat->T[j].length;
     435      // the polynomial to reduce with (up to the moment) is;
     436      // pi with ecart ei and length li
     437      // look for one with smaller ecart
     438      i = j;
     439      loop
     440      {
     441        /*- takes the first possible with respect to ecart -*/
     442        i++;
     443#if 1
     444        if (i > strat->tl) break;
     445        if ((strat->T[i].ecart < ei || (strat->T[i].ecart == ei &&
     446                                        strat->T[i].length < li))
     447            &&
     448            p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], h->GetLmTailRing(), ~h->sev, strat->tailRing))
     449#else
     450          j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h, i);
     451        if (j < 0) break;
     452        i = j;
     453        if (strat->T[i].ecart < ei || (strat->T[i].ecart == ei &&
     454                                        strat->T[i].length < li))
     455#endif
     456        {
     457          // the polynomial to reduce with is now
     458          ii = i;
     459          ei = strat->T[i].ecart;
     460          if (ei <= h->ecart) break;
     461          li = strat->T[i].length;
     462        }
     463      }
     464   
     465   
     466    #if ADIDEBUG_NF
     467    if(iii == ii)
     468        {
     469        PrintLn();
     470        PrintS("                None was found.");
     471        PrintLn();
     472        }
     473    else
     474        {
     475        PrintLn();
     476        PrintS("                A better one (ecart = ");printf("%i",ei);PrintS("): T[");
     477        printf("%i] = ",ii);p_Write(strat->T[ii].p,strat->tailRing);
     478        PrintLn();
     479        }
     480    #endif
     481   
     482    }
     483
     484    // end of search: have to reduce with pi
     485    if (ei > h->ecart)
     486    {
     487      // It is not possible to reduce h with smaller ecart;
     488      // if possible h goes to the lazy-set L,i.e
     489      // if its position in L would be not the last one
     490      strat->fromT = TRUE;
     491      if (!TEST_OPT_REDTHROUGH && strat->Ll >= 0) /*- L is not empty -*/
     492      {
     493        h->SetLmCurrRing();
     494        if (strat->honey && strat->posInLDependsOnLength)
     495          h->SetLength(strat->length_pLength);
     496        assume(h->FDeg == h->pFDeg());
     497        at = strat->posInL(strat->L,strat->Ll,h,strat);
     498        if (at <= strat->Ll)
     499        {
     500          /*- h will not become the next element to reduce -*/
     501          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     502#ifdef KDEBUG
     503          if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at);
     504#endif
     505          h->Clear();
     506          strat->fromT = FALSE;
     507          return -1;
     508        }
     509      }
     510    }
     511
     512    // now we finally can reduce
     513    doRed(h,&(strat->T[ii]),strat->fromT,strat);
     514    #if ADIDEBUG_NF
     515    PrintLn();
     516          PrintS("      Partial Reduced h = ");p_Write(h->p,strat->tailRing);
     517          PrintLn();
     518          #endif
     519    strat->fromT=FALSE;
     520
     521    // are we done ???
     522    if (h->IsNull())
     523    {
     524      if (h->lcm!=NULL) pLmFree(h->lcm);
     525      h->Clear();
     526      return 0;
     527    }
     528
     529    // NO!
     530    h->SetShortExpVector();
     531    h->SetpFDeg();
     532    if (strat->honey)
     533    {
     534      if (ei <= h->ecart)
     535        h->ecart = d-h->GetpFDeg();
     536      else
     537        h->ecart = d-h->GetpFDeg()+ei-h->ecart;
     538    }
     539    else
     540      // this has the side effect of setting h->length
     541      h->ecart = h->pLDeg(strat->LDegLast) - h->GetpFDeg();
     542
     543    /*- try to reduce the s-polynomial -*/
     544    pass++;
     545    d = h->GetpFDeg()+h->ecart;
     546    /*
     547     *test whether the polynomial should go to the lazyset L
     548     *-if the degree jumps
     549     *-if the number of pre-defined reductions jumps
     550     */
     551    if (!TEST_OPT_REDTHROUGH && (strat->Ll >= 0)
     552        && ((d >= reddeg) || (pass > strat->LazyPass)))
     553    {
     554      h->SetLmCurrRing();
     555      if (strat->honey && strat->posInLDependsOnLength)
     556        h->SetLength(strat->length_pLength);
     557      assume(h->FDeg == h->pFDeg());
     558      at = strat->posInL(strat->L,strat->Ll,h,strat);
     559      if (at <= strat->Ll)
     560      {
     561        int dummy=strat->sl;
     562        if (kFindDivisibleByInS(strat, &dummy, h) < 0)
     563        {
     564          if (strat->honey && !strat->posInLDependsOnLength)
     565            h->SetLength(strat->length_pLength);
     566          return 1;
     567        }
     568        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     569#ifdef KDEBUG
     570        if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
     571#endif
     572        h->Clear();
     573        return -1;
     574      }
     575    }
     576    else if ((TEST_OPT_PROT) && (strat->Ll < 0) && (d >= reddeg))
     577    {
     578      Print(".%ld",d);mflush();
     579      reddeg = d+1;
     580      if (h->pTotalDeg()+h->ecart >= strat->tailRing->bitmask)
     581      {
     582        strat->overflow=TRUE;
     583        //Print("OVERFLOW in redEcart d=%ld, max=%ld",d,strat->tailRing->bitmask);
     584        h->GetP();
     585        at = strat->posInL(strat->L,strat->Ll,h,strat);
     586        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     587        h->Clear();
     588        return -1;
     589      }
     590    }
     591  }
     592}
     593
    357594/*2
    358595*reduces h with elements from T choosing  the first possible
     
    8401077void updateLHC(kStrategy strat)
    8411078{
     1079
    8421080  int i = 0;
    8431081  assume(kTest_TS(strat));
     
    9041142  while (i <= strat->tl)
    9051143  {
    906     p = strat->T[i];
     1144        p = strat->T[i];
    9071145    deleteHC(&p,strat, TRUE);
    9081146    /*- tries to cancel a unit: -*/
     
    9571195    if (TEST_OPT_FINDET)
    9581196      return;
     1197     
     1198#ifndef HAVE_RINGS
    9591199    strat->red = redFirst;
    9601200    strat->use_buckets = kMoraUseBucket(strat);
     1201#else
     1202        if ( (!rField_is_Ring(currRing)) || (currRing->OrdSgn != -1))
     1203                {
     1204                strat->red = redFirst;
     1205        strat->use_buckets = kMoraUseBucket(strat);
     1206        }
     1207#endif
     1208   
    9611209    updateT(strat);
     1210   
     1211#ifndef HAVE_RINGS
    9621212    strat->posInT = posInT2;
    9631213    reorderT(strat);
     1214#else
     1215        if ( (!rField_is_Ring(currRing)) || (currRing->OrdSgn != -1))
     1216                {
     1217                strat->posInT = posInT2;
     1218            reorderT(strat);
     1219        }
     1220#endif
    9641221  }
    9651222  assume(kTest_TS(strat));
     
    9991256      if (TEST_OPT_FINDET)
    10001257        return;
     1258       
    10011259      /*- cuts elements in L above noether and reorders L -*/
    10021260      updateLHC(strat);
     
    11151373    strat->red2 = redHomog;
    11161374  }
    1117 #ifdef HAVE_RINGS //TODO Oliver
     1375#ifdef HAVE_RINGS || HAVE_RINGS_LOC //TODO Oliver
    11181376  if (rField_is_Ring(currRing))
    11191377  {
    1120     strat->red2 = redRing;
     1378    if(currRing->OrdSgn == -1)
     1379                {strat->red = redRiloc;}
     1380        else   
     1381        {strat->red2 = redRing;}
    11211382  }
    11221383#endif
     
    11921453    strat->HCord = 32000;/*- very large -*/
    11931454  }
     1455 
     1456    #ifdef HAVE_RINGS
     1457        if (rField_is_Ring(currRing))
     1458                strat->red = redRiloc;
     1459  #endif
     1460
     1461   /*reads the ecartWeights used for Graebes method from the
    11941462  /*reads the ecartWeights used for Graebes method from the
    11951463   *intvec ecart and set ecartWeights
     
    12251493ideal mora (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat)
    12261494{
     1495#ifdef HAVE_RINGS
     1496#if ADIDEBUG
     1497int loop_count;
     1498loop_count = 1;
     1499#endif
     1500#endif
    12271501#ifdef HAVE_ASSUME
    12281502  mora_count++;
     
    12771551  kStratInitChangeTailRing(strat);
    12781552#endif
     1553
    12791554  if (BVERBOSE(23))
    12801555  {
     
    13121587      else strat->noClearS=TRUE;
    13131588    }
     1589   
     1590        #if ADIDEBUG
     1591                #ifdef KDEBUG
     1592               
     1593                PrintLn();
     1594                PrintS("-------------------------------- LOOP ");printf("%d",loop_count);
     1595                PrintS(" ---------------------------------------");
     1596                PrintLn();
     1597                //print the list L: (p1,p2,p)
     1598                PrintLn();
     1599                PrintS("                The pair list L -- in loop ");
     1600                printf("%d",loop_count);PrintS(" -- is: "); PrintLn();
     1601                for(int iii=0;iii<=strat->Ll;iii++)
     1602                        {
     1603                        PrintLn();
     1604                        PrintS("                L[");printf("%d",iii);Print("]: ");
     1605                        PrintLn();
     1606                        PrintS("                    ");p_Write(strat->L[iii].p1,strat->tailRing);
     1607                        PrintS("                    ");p_Write(strat->L[iii].p2,strat->tailRing);
     1608                        PrintS("                    ");p_Write(strat->L[iii].p,strat->tailRing);
     1609                        }
     1610                PrintLn();
     1611                #endif
     1612                #endif
     1613
     1614   
    13141615    strat->P = strat->L[strat->Ll];/*- picks the last element from the lazyset L -*/
    13151616    if (strat->Ll==0) strat->interpt=TRUE;
    13161617    strat->Ll--;
     1618
     1619                #if ADIDEBUG
     1620                #ifdef KDEBUG   
     1621                PrintS("                My new pair P = (p1,p2,p) is: "); PrintLn();
     1622                PrintS("                        p1 = "); p_Write(strat->P.p1,strat->tailRing);PrintLn();
     1623                PrintS("                        p2 = "); p_Write(strat->P.p2,strat->tailRing);PrintLn();
     1624                PrintS("                        p = "); p_Write(strat->P.p,strat->tailRing); PrintLn();
     1625                PrintLn();
     1626                PrintS("                The old reducer list T -- at the beg of loop ");
     1627                printf("%d",loop_count);PrintS(" -- is :");
     1628                if(strat->tl<0)
     1629                        {PrintS(" Empty.");PrintLn();}
     1630                else
     1631                for(int iii=0;iii<=strat->tl;iii++)
     1632                        {               
     1633                                PrintLn();
     1634                                PrintS("                T[");printf("%d",iii);PrintS("]:");
     1635                                p_Write(strat->T[iii].p,strat->T->tailRing);
     1636                        }
     1637                PrintLn();
     1638               
     1639                #endif /* ADIDEBUG */   
     1640                #endif
    13171641
    13181642    // create the real Spoly
     
    13801704      enterT(strat->P,strat);
    13811705      // build new pairs
    1382 #ifdef HAVE_RINGS_LOC
     1706#ifdef HAVE_RINGS
    13831707      if (rField_is_Ring(currRing))
    1384         superenterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
     1708      {
     1709        superenterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
     1710       
     1711        #if ADIDEBUG
     1712        PrintLn();
     1713                PrintS("                The new pair list L -- after superenterpairs in loop ");
     1714                printf("%d",loop_count);PrintS(" -- is: "); PrintLn();
     1715                for(int iii=0;iii<=strat->Ll;iii++)
     1716                {
     1717                PrintLn();
     1718                PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     1719                PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     1720                PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     1721                PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     1722                }
     1723                #endif
     1724      }
     1725     
    13851726      else
    13861727#endif
     
    13961737      // clear strat->P
    13971738      if (strat->P.lcm!=NULL)
    1398 #ifdef HAVE_RINGS_LOC
     1739#ifdef HAVE_RINGS || HAVE_RINGS_LOC
    13991740        pLmDelete(strat->P.lcm);
    14001741#else
     
    14251766    }
    14261767    assume(kTest_TS(strat));
     1768   
     1769        #if ADIDEBUG
     1770        PrintLn();
     1771        PrintS("                The new reducer list T -- at the end of loop ");
     1772        printf("%d",loop_count);PrintS(" -- is "); PrintLn();
     1773        for(int iii=0;iii<=strat->tl;iii++)
     1774                {
     1775                PrintLn();
     1776                PrintS("                T[");printf("%d",iii);PrintS("]:");
     1777                p_Write(strat->T[iii].p,strat->tailRing);
     1778                }
     1779        PrintLn();
     1780       
     1781        loop_count++;
     1782        #endif /* ADIDEBUG */   
    14271783  }
    14281784  /*- complete reduction of the standard basis------------------------ -*/
     
    15441900    enterT(h,strat);
    15451901  }
     1902#ifdef KDEBUG
     1903//      kDebugPrint(strat);
     1904#endif
    15461905  /*- compute------------------------------------------- -*/
    15471906  p = pCopy(q);
     
    18492208#ifdef HAVE_RINGS
    18502209  if (rField_is_Ring(currRing))
    1851     r=bba(F,Q,NULL,hilb,strat);
     2210    {
     2211    if(currRing->OrdSgn == -1)
     2212                r=mora(F,Q,NULL,hilb,strat);
     2213        else
     2214        r=bba(F,Q,NULL,hilb,strat);
     2215    }
    18522216  else
    18532217#endif
     
    28053169  else
    28063170  {
    2807     assume(strat->red == redEcart);
     3171    assume(strat->red == redEcart || strat->red == redRiloc);
    28083172    if (strat->honey && (strat->syzComp==0))
    28093173      return TRUE;
  • kernel/kutil.cc

    r537733f rc25b56c  
    8484#endif
    8585
     86#define ADIDEBUG 0
     87
    8688denominator_list DENOMINATOR_LIST=NULL;
    8789
     
    266268    while (pNext(p1)!=NULL)
    267269    {
    268       if (p_LmCmp(pNext(p1), strat->kNoetherTail(), L->tailRing) == -1)
     270    if (p_LmCmp(pNext(p1), strat->kNoetherTail(), L->tailRing) == -1)
    269271      {
    270272        p_Delete(&pNext(p1), L->tailRing);
     
    331333  int  i;
    332334  poly h;
     335  number lc;
    333336
    334337  if(rHasGlobalOrdering (currRing)) return;
     
    337340  ring r = L->tailRing;
    338341  poly p = L->GetLmTailRing();
     342 
     343#ifdef HAVE_RINGS
     344    if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1)) 
     345                lc = p_GetCoeff(p,r); 
     346#endif
    339347
    340348#ifdef HAVE_RINGS_LOC
     
    350358//    }
    351359  h = pNext(p);
     360 
    352361  loop
    353362  {
     
    357366      if (!inNF)
    358367      {
    359         number eins=nInit(1);
    360         if (L->p != NULL)  pSetCoeff(L->p,eins);
     368        number eins;
     369        #ifdef HAVE_RINGS
     370        if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1))
     371                        eins = nCopy(lc);
     372                    else
     373                #endif
     374        eins=nInit(1);
     375              if (L->p != NULL)  pSetCoeff(L->p,eins);
    361376        else if (L->t_p != NULL) nDelete(&pGetCoeff(L->t_p));
    362377        if (L->t_p != NULL) pSetCoeff0(L->t_p,eins);
     
    372387      if (L->p != NULL && pNext(L->p) != NULL)
    373388        pNext(L->p) = NULL;
     389               
    374390      return;
    375391    }
     
    379395      i++;
    380396      if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide
     397      #ifdef HAVE_RINGS
     398      ///should check also if the lc is a zero divisor, if it divides all the others
     399      if (rField_is_Ring(currRing) && currRing->OrdSgn == -1)
     400        if(n_DivBy(p_GetCoeff(h,r->cf),lc,r->cf) == 0)
     401                return;
     402      #endif
    381403      if (i == r->N) break; // does divide, try next monom
    382404    }
     
    11451167  Lp.lcm = pInit();
    11461168  pSetCoeff0(Lp.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
     1169 
     1170  #if ADIDEBUG
     1171  PrintS("\nLp.lcm (lc) = ");pWrite(Lp.lcm);
     1172  #endif
     1173 
    11471174  // Lp.lcm == 0
    11481175  if (nIsZero(pGetCoeff(Lp.lcm)))
     
    11651192  // basic product criterion
    11661193  pLcm(p,strat->S[i],Lp.lcm);
     1194 
     1195  #if ADIDEBUG
     1196  PrintS("\nLp.lcm (lcm) = ");pWrite(Lp.lcm);
     1197  #endif
     1198 
    11671199  pSetm(Lp.lcm);
    11681200  assume(!strat->sugarCrit);
     
    27242756        for (j=0; j<=k; j++)
    27252757        {
     2758        #if ADIDEBUG
     2759        PrintS("\n initenterpairs: \n");
     2760        PrintS("                ");p_Write(h, strat->tailRing);
     2761        PrintS("                ");p_Write(strat->S[j],strat->tailRing);
     2762        #endif
    27262763          strat->enterOnePair(j,h,ecart,isFromQ,strat, atR);
    27272764          //Print("j:%d, Ll:%d\n",j,strat->Ll);
     
    35373574void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR)
    35383575{
     3576        #if ADIDEBUG
     3577        PrintLn();
     3578        PrintS("Enter superenterpairs");
     3579        PrintLn();
     3580        int iii = strat->Ll;
     3581        #endif
    35393582    assume (rField_is_Ring(currRing));
    35403583    // enter also zero divisor * poly, if this is non zero and of smaller degree
    35413584    if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat);
     3585     #if ADIDEBUG
     3586    if(iii==strat->Ll)
     3587        {
     3588        PrintLn();
     3589        PrintS("                enterExtendedSpoly has not changed the list L.");
     3590        PrintLn();
     3591        }
     3592    else
     3593    {
     3594        PrintLn();
     3595        PrintS("                enterExtendedSpoly changed the list L: ");
     3596        PrintLn();   
     3597        for(iii=0;iii<=strat->Ll;iii++)
     3598                        {
     3599                        PrintLn();
     3600                        PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     3601                        PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     3602                        PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     3603                        PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     3604                        }
     3605        }
     3606        iii = strat->Ll;
     3607    #endif
    35423608    initenterpairs(h, k, ecart, 0, strat, atR);
     3609    #if ADIDEBUG
     3610    if(iii==strat->Ll)
     3611        {
     3612        PrintLn();
     3613        PrintS("                initenterpairs has not changed the list L.");
     3614        PrintLn();
     3615        }
     3616    else
     3617    {
     3618        PrintLn();
     3619        PrintS("                initenterpairs changed the list L: ");
     3620        PrintLn();   
     3621        for(iii=0;iii<=strat->Ll;iii++)
     3622                        {
     3623                        PrintLn();
     3624                        PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     3625                        PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     3626                        PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     3627                        PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     3628                        }
     3629        }
     3630        iii = strat->Ll;
     3631    #endif
    35433632    initenterstrongPairs(h, k, ecart, 0, strat, atR);
    3544     clearSbatch(h, k, pos, strat);
     3633    #if ADIDEBUG
     3634    if(iii==strat->Ll)
     3635        {
     3636        PrintLn();
     3637        PrintS("                initenterstrongPairs has not changed the list L.");
     3638        PrintLn();
     3639        }
     3640    else
     3641    {
     3642        PrintLn();
     3643        PrintS("                initenterstrongPairs changed the list L: ");
     3644        PrintLn();   
     3645        for(iii=0;iii<=strat->Ll;iii++)
     3646                        {
     3647                        PrintLn();
     3648                        PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     3649                        PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     3650                        PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     3651                        PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     3652                        }
     3653        }
     3654        PrintLn();
     3655        PrintS("End of superenterpairs");
     3656        PrintLn();
     3657        #endif
     3658        clearSbatch(h, k, pos, strat);
    35453659}
    35463660#endif
     
    56525766      if (currRing->OrdSgn==-1)
    56535767      {
     5768                /*#ifdef HAVE_RINGS
     5769                        if (rField_is_Ring(currRing))
     5770                        {
     5771                        h.pCleardenom();
     5772                        }
     5773                        else
     5774                                #endif*/
    56545775        cancelunit(&h);  /*- tries to cancel a unit -*/
    56555776        deleteHC(&h, strat);
     
    78747995  newNoether = pLmInit(strat->kHEdge);
    78757996  j = p_FDeg(newNoether,currRing);
     7997/*  #ifdef HAVE_RINGS
     7998  if (!rField_is_Ring(currRing))
     7999  #endif */
    78768000  for (i=1; i<=(currRing->N); i++)
    78778001  {
     
    79838107#ifdef HAVE_RINGS
    79848108                                  (strat->homog && currRing->pFDeg == p_Deg && !(rField_is_Ring(currRing))), // TODO Oliver
     8109                                 
     8110                                 
    79858111#else
    79868112                                  (strat->homog && currRing->pFDeg == p_Deg), // omit_degree
     
    79898115                                  expbound); // exp_limit
    79908116
    7991   if (new_tailRing == currRing) return TRUE;
     8117if (new_tailRing == currRing) return TRUE;
    79928118
    79938119  strat->pOrigFDeg_TailRing = new_tailRing->pFDeg;
  • kernel/kutil.h

    r537733f rc25b56c  
    473473#ifdef HAVE_RINGS
    474474int redRing (LObject* h,kStrategy strat);
     475int redRiloc (LObject* h,kStrategy strat);
    475476void enterExtendedSpoly(poly h,kStrategy strat);
    476477void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR = -1);
     
    626627/***************************************************************
    627628 *
    628  * From kSpolys.cc
     629 * From kspoly.cc
    629630 *
    630631 ***************************************************************/
  • libpolys/polys/monomials/p_polys.cc

    r537733f rc25b56c  
    6060#include "clapsing.h"
    6161#endif
     62
     63#define ADIDEBUG 0
    6264
    6365/*
     
    12331235int p_IsPurePower(const poly p, const ring r)
    12341236{
     1237#ifdef HAVE_RINGS
     1238  if (rField_is_Ring(r))
     1239        {
     1240        if (p == NULL) return 0;
     1241        if (!n_IsUnit(pGetCoeff(p), r->cf)) return 0;
     1242        }
     1243#endif
    12351244  int i,k=0;
    12361245
     
    28222831  {
    28232832    p_Content(ph,r);
    2824     assume( n_GreaterZero(pGetCoeff(ph),C) );
    28252833    if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r);
     2834        assume( n_GreaterZero(pGetCoeff(ph),C) );
    28262835    return;
    28272836  }
  • libpolys/polys/templates/pp_Mult_mm_Noether__T.cc

    r537733f rc25b56c  
    2929  spolyrec rp;
    3030  poly q = &rp, r;
     31  number n;
    3132  const unsigned long *spNoether_exp = spNoether->exp;
    3233  number ln = pGetCoeff(m);
     
    5253
    5354    Continue:
    54     l++;
    55     q = pNext(q) = r;
    56     pSetCoeff0(q, n_Mult__T(ln, pGetCoeff(p), ri));
    57     pIter(p);
     55     
     56    n = n_Mult__T(ln, pGetCoeff(p), ri);
     57     
     58    #ifdef HAVE_RINGS
     59    if(n_IsZero__T(n, ri))
     60    {
     61      n_Delete__T(&n, ri);
     62      p_FreeBinAddr(r, ri);       
     63    } else     
     64    #endif
     65    {
     66      l++;
     67      q = pNext(q) = r;
     68      pSetCoeff0(q, n);
     69    }
     70     
     71    pIter(p);       
     72   
    5873  } while (p != NULL);
    5974
Note: See TracChangeset for help on using the changeset viewer.