Changeset 19a089f in git for kernel


Ignore:
Timestamp:
Oct 13, 2015, 4:23:20 PM (9 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
125de5072e1ff0136a3939cd8b878be9f8d71e69
Parents:
212806f6073de03851c64acb881326ea4667bad2
Message:
solved tests bugs.
Location:
kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd1.cc

    r212806 r19a089f  
    501501        assume(h->FDeg == h->pFDeg());
    502502        at = strat->posInL(strat->L,strat->Ll,h,strat);
     503        #if 0
     504        //#ifdef HAVE_RINGS
     505        if(rField_is_Ring(currRing))
     506          strat->fromT=FALSE;
     507        #endif
    503508        if (at <= strat->Ll && pLmCmp(h->p, strat->L[strat->Ll].p) != 0 && !nEqual(h->p->coef, strat->L[strat->Ll].p->coef))
    504509        {
     
    506511          /*- h will not become the next element to reduce -*/
    507512          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    508 #ifdef KDEBUG
     513          #ifdef KDEBUG
    509514          if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at);
    510 #endif
     515          #endif
    511516          h->Clear();
    512517          strat->fromT = FALSE;
    513518          return -1;
     519         
    514520        #else
    515521       
    516         LObject* h2;
    517         pWrite(h->p);
    518         h2->tailRing = h->tailRing;
    519         h2->p = pCopy(h->p);
    520         pWrite(h2->p);
    521         strat->initEcart(h2);
    522         h2->sev = h->sev;
    523         doRed(h,&(strat->T[ii]),strat->fromT,strat);
    524         #if ADIDEBUG_NF
    525         printf("\nPartial reduced (ecart = %i) h: ",h->ecart);pWrite(h->p);
    526         #endif
    527         if(h->IsNull())
    528         {
    529           if (h->lcm!=NULL)
     522          LObject* h2;
     523          pWrite(h->p);
     524          h2->tailRing = h->tailRing;
     525          h2->p = pCopy(h->p);
     526          pWrite(h2->p);
     527          strat->initEcart(h2);
     528          h2->sev = h->sev;
     529          doRed(h,&(strat->T[ii]),FALSE,strat);
     530          #if ADIDEBUG_NF
     531          printf("\nPartial reduced (ecart = %i) h: ",h->ecart);pWrite(h->p);
     532          #endif
     533          if(h->IsNull())
    530534          {
    531             pLmDelete(h->lcm);
     535            if (h->lcm!=NULL)
     536            {
     537              pLmDelete(h->lcm);
     538            }
     539            h->Clear();
     540            h2->Clear();
     541            return 0;
    532542          }
    533           h->Clear();
    534           h2->Clear();
    535           return 0;
    536         }
    537         strat->initEcart(h);
    538         h->sev = pGetShortExpVector(h->p);
    539         at = strat->posInL(strat->L,strat->Ll,h,strat);
    540         enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    541         #if ADIDEBUG_NF
    542         printf("\nThis was reduced and went to L: ");pWrite(h->p);
    543         #endif
    544         at = strat->posInL(strat->L,strat->Ll,h2,strat);
    545         enterL(&strat->L,&strat->Ll,&strat->Lmax,*h2,at);
    546         #if ADIDEBUG_NF
    547         printf("\nThis was reduced and went to L: ");pWrite(h2->p);
    548         #endif
    549         //This means the pair won't go into T
    550         return 3;
     543          strat->initEcart(h);
     544          h->sev = pGetShortExpVector(h->p);
     545          at = strat->posInL(strat->L,strat->Ll,h,strat);
     546          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     547          #if ADIDEBUG_NF
     548          printf("\nThis was reduced and went to L: ");pWrite(h->p);
     549          #endif
     550          at = strat->posInL(strat->L,strat->Ll,h2,strat);
     551          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h2,at);
     552          #if ADIDEBUG_NF
     553          printf("\nThis was reduced and went to L: ");pWrite(h2->p);
     554          #endif
     555          //This means the pair won't go into T
     556          return 3;
    551557        #endif
    552558        }
     
    870876        * we have to reduce with bad ecart: H has to enter in T
    871877        */
     878        #if ADIDEBUG_NF
     879        printf("\nHAVE TO REDUCE IT WITH BIGGER ECART\n");
     880        #endif
    872881        doRed(&H,&(strat->T[ii]),TRUE,strat);
    873882        if (H.p == NULL)
     
    910919      #if ADIDEBUG_NF
    911920      printf("\nAfter the small reduction it looks like this:\n");pWrite(H.p);
    912       //getchar();
     921      getchar();
    913922      #endif
    914923      /*- try to reduce the s-polynomial -*/
     
    13401349{
    13411350  enterSBba(p, atS, strat, atR);
    1342   //#ifdef HAVE_RINGS
    1343   //  if (rField_is_Ring(currRing))
    1344   //    return;
    1345   //#endif
    13461351  #ifdef KDEBUG
    13471352  if (TEST_OPT_DEBUG)
     
    18001805        {
    18011806            //int inittl = strat->tl;
    1802           //enterT(strat->P,strat);
    1803           enterT_strong(strat->P,strat);
     1807          enterT(strat->P,strat);
     1808          //enterT_strong(strat->P,strat);
    18041809          //strat->tl = inittl+1;
    18051810        }
     
    21582163          h.sev = strat->sevS[j];
    21592164          h.SetpFDeg();
     2165          #ifdef HAVE_RINGS
     2166          if(rField_is_Ring(currRing) && rHasLocalOrMixedOrdering(currRing))
     2167            enterT_strong(h,strat);
     2168          else
     2169          #endif
    21602170          enterT(h,strat);
    21612171        }
  • kernel/GBEngine/kstd2.cc

    r212806 r19a089f  
    1919# define MYTEST 0
    2020#endif /* ifndef SING_NDEBUG */
     21
     22#define ADIDEBUG 0
     23#define ADIDEBUG_COUNT 0
    2124
    2225#if MYTEST
     
    7275 * SBA stuff -- done
    7376***********************************************/
    74 #define ADIDEBUG 0
    75 #define ADIDEBUG_COUNT 0
    7677
    7778#include <kernel/GBEngine/kutil.h>
     
    15581559    }
    15591560    #endif
    1560     //getchar();
     1561    getchar();
    15611562    #endif
    15621563    #ifdef KDEBUG
  • kernel/GBEngine/kutil.cc

    r212806 r19a089f  
    1111
    1212#define MYTEST 0
     13
     14#define ADIDEBUG 0
    1315
    1416#include <kernel/mod2.h>
     
    7779#endif
    7880
    79 #define ADIDEBUG 0
    80 
    8181denominator_list DENOMINATOR_LIST=NULL;
    8282
     
    338338      lc = pGetCoeff(p);
    339339#endif
    340 
     340    #if ADIDEBUG
     341    printf("\n        cancelunit\n");
     342    pWrite(p);
     343    #endif
    341344#ifdef HAVE_RINGS
    342345  // Leading coef have to be a unit
     
    403406    // Note: As long as qring j forbidden if j contains integer (i.e. ground rings are
    404407    //       domains), no zerodivisor test needed  CAUTION
    405     if (rField_is_Ring(r) /*&&(rHasLocalOrMixedOrdering(r)) */)
    406       if(n_DivBy(pGetCoeff(h),lc,r->cf) == 0)
    407         return;
     408    #if ADIDEBUG
     409    pWrite(h);
     410    #endif
     411    if (rField_is_Ring(r) && !n_DivBy(pGetCoeff(h),lc,r->cf))
     412    {
     413      #if ADIDEBUG
     414      printf("\nDoes not divide\n");
     415      #endif
     416      return;
     417    }
     418    #if ADIDEBUG
     419    printf("\nDivides. Go On\n");
     420    #endif
    408421    #endif
    409422    pIter(h);
     
    14431456              pWrite(h.lcm);
    14441457              #endif
    1445         if ((n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf) == 0) && ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)))
     1458        if ((n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf)) && ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)))
    14461459        {
    14471460          strat->c3++;
     
    14651478              pWrite(h.lcm);
    14661479              #endif
    1467           if(n_DivBy( h.lcm->coef, strat->B[j].lcm->coef, currRing->cf) == 0)
     1480          if(n_DivBy( h.lcm->coef, strat->B[j].lcm->coef, currRing->cf))
    14681481          {
    14691482          #if ADIDEBUG
     
    14901503              pWrite(strat->S[i]);
    14911504              #endif
    1492         if ((n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf) == 0) && (strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     1505        if ((n_DivBy(strat->B[j].lcm->coef, h.lcm->coef, currRing->cf)) && (strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
    14931506        {
    14941507          #if ADIDEBUG
     
    15111524              pWrite(strat->B[j].p1);
    15121525              pWrite(strat->B[j].p2);
     1526              pWrite(strat->B[j].lcm);
    15131527              printf("\nh - neue Paar\n");
    15141528              pWrite(h.p);
    15151529              pWrite(p);
    15161530              pWrite(strat->S[i]);
     1531              pWrite(h.lcm);
    15171532              #endif
    1518         if(n_DivBy( h.lcm->coef, strat->B[j].lcm->coef,currRing->cf) == 0)
     1533        if(n_DivBy( h.lcm->coef, strat->B[j].lcm->coef,currRing->cf))
    15191534        {
    15201535          #if ADIDEBUG
     
    17491764    if(h.IsNull()) return FALSE;
    17501765    int red_result;
    1751     if(strat->L != NULL)
    1752     red_result = strat->red(&h,strat);
     1766    //if(strat->L != NULL)
     1767      red_result = strat->red(&h,strat);
    17531768    if(!h.IsNull())
    1754       enterT_strong(h, strat,-1);
     1769      enterT(h, strat,-1);
    17551770  }
    17561771  //#if 1
     
    80158030  assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev);
    80168031  strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev);
    8017   #if 1
    8018   #ifdef HAVE_RINGS
    8019   if(rField_is_Ring(currRing) &&
    8020   rHasLocalOrMixedOrdering(currRing) && !n_IsUnit(p.p->coef, currRing->cf))
    8021   {
    8022     #if ADIDEBUG_NF
    8023     printf("\nDas ist p:\n");pWrite(p.p);
    8024     #endif
    8025     for(i=strat->tl;i>=0;i--)
    8026     {
    8027       if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p))
    8028       {
    8029         #if ADIDEBUG_NF
    8030         printf("\nFound one: %i\n",i);pWrite(strat->T[i].p);
    8031         #endif
    8032         enterOneStrongPoly(i,p.p,p.ecart,0,strat,0 , TRUE);
    8033       }
    8034     }
    8035   }
    8036   /*
    8037   printf("\nThis is T:\n");
    8038   for(i=strat->tl;i>=0;i--)
    8039   {
    8040     pWrite(strat->T[i].p);
    8041   }
    8042   //getchar();*/
    8043 #endif
    8044 #endif
    80458032  kTest_T(&(strat->T[atT]));
    80468033}
     
    81278114  assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev);
    81288115  strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev);
    8129   #if 0
     8116  #if 1
    81308117  #ifdef HAVE_RINGS
    81318118  if(rField_is_Ring(currRing) && !n_IsUnit(p.p->coef, currRing->cf))
    81328119  {
    8133     #if ADIDEBUG_NF
     8120    #if ADIDEBUG
    81348121    printf("\nDas ist p:\n");pWrite(p.p);
    81358122    #endif
     
    81388125      if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p))
    81398126      {
    8140         #if ADIDEBUG_NF
     8127        #if ADIDEBUG
    81418128        printf("\nFound one: %i\n",i);pWrite(strat->T[i].p);
    81428129        #endif
  • kernel/combinatorics/hdegree.cc

    r212806 r19a089f  
    10101010  int  i;
    10111011  int  k = ak;
    1012 
    10131012  #if HAVE_RINGS
    10141013  if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1))
    10151014  {
    1016   //consider just monic generators (over rings with zero-divisors)
    1017   ideal SS=id_Copy(S,tailRing);
    1018   for(i=0;i<=idElem(SS);i++)
    1019         {
    1020         if(pIsPurePower(SS->m[i])==0)
    1021                 p_Delete(&SS->m[i],tailRing);
     1015    //consider just monic generators (over rings with zero-divisors)
     1016    ideal SS=id_Copy(S,tailRing);
     1017    for(i=0;i<=idElem(S);i++)
     1018    {
     1019        if(p_IsPurePower(SS->m[i],tailRing)==0)
     1020                { 
     1021                  p_Delete(&SS->m[i],tailRing);
     1022                }
    10221023        }
    10231024        S=id_Copy(SS,tailRing);
    1024   }
     1025        idSkipZeroes(S);
     1026  }
     1027  #if 0
     1028  printf("\nThis is HC:\n");
     1029  for(int ii=0;ii<=idElem(S);ii++)
     1030  {
     1031    pWrite(S->m[ii]);
     1032  }
     1033  //getchar();
    10251034  #endif
    1026 
     1035  #endif
     1036  if(idElem(S) == 0)
     1037    return;
    10271038  hNvar = (currRing->N);
    10281039  hexist = hInit(S, Q, &hNexist, tailRing); // tailRing?
Note: See TracChangeset for help on using the changeset viewer.