Changeset 601105 in git for kernel/kutil.cc


Ignore:
Timestamp:
Nov 19, 2013, 6:39:47 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
448b6571955b81192b53dc7300bb54a1984142e3
Parents:
9d864add8f262ed66a3af97f514c37d01844334c
Message:
chg: use syzComp in initenterstrongPairs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/kutil.cc

    r9d864a r601105  
    340340  ring r = L->tailRing;
    341341  poly p = L->GetLmTailRing();
    342  
     342
    343343#ifdef HAVE_RINGS
    344     if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1)) 
    345                 lc = p_GetCoeff(p,r); 
    346 #endif 
     344    if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1))
     345                  lc = p_GetCoeff(p,r);
     346#endif
    347347
    348348#ifdef HAVE_RINGS_LOC
     
    358358//    }
    359359  h = pNext(p);
    360  
     360
    361361  loop
    362362  {
     
    366366      if (!inNF)
    367367      {
    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);
     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);
    376376        else if (L->t_p != NULL) nDelete(&pGetCoeff(L->t_p));
    377377        if (L->t_p != NULL) pSetCoeff0(L->t_p,eins);
     
    387387      if (L->p != NULL && pNext(L->p) != NULL)
    388388        pNext(L->p) = NULL;
    389                
     389
    390390      return;
    391391    }
     
    398398      ///should check also if the lc is a zero divisor, if it divides all the others
    399399      if (rField_is_Ring(currRing) && currRing->OrdSgn == -1)
    400         if(n_DivBy(p_GetCoeff(h,r->cf),lc,r->cf) == 0)
    401                 return;
     400              if(n_DivBy(p_GetCoeff(h,r->cf),lc,r->cf) == 0)
     401                      return;
    402402      #endif
    403403      if (i == r->N) break; // does divide, try next monom
     
    11671167  Lp.lcm = pInit();
    11681168  pSetCoeff0(Lp.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
    1169  
     1169
    11701170  #if ADIDEBUG
    11711171  PrintS("\nLp.lcm (lc) = ");pWrite(Lp.lcm);
    11721172  #endif
    1173  
     1173
    11741174  // Lp.lcm == 0
    11751175  if (nIsZero(pGetCoeff(Lp.lcm)))
     
    11921192  // basic product criterion
    11931193  pLcm(p,strat->S[i],Lp.lcm);
    1194  
     1194
    11951195  #if ADIDEBUG
    11961196  PrintS("\nLp.lcm (lcm) = ");pWrite(Lp.lcm);
    11971197  #endif
    1198  
     1198
    11991199  pSetm(Lp.lcm);
    12001200  assume(!strat->sugarCrit);
     
    27722772        #if ADIDEBUG
    27732773        PrintS("\n initenterpairs: \n");
    2774         PrintS("                ");p_Write(h, strat->tailRing);
    2775         PrintS("                ");p_Write(strat->S[j],strat->tailRing);
     2774        PrintS("                ");p_Write(h, strat->tailRing);
     2775        PrintS("                ");p_Write(strat->S[j],strat->tailRing);
    27762776        #endif
    27772777          strat->enterOnePair(j,h,ecart,isFromQ,strat, atR);
     
    34533453//      if (((unsigned long) pGetCoeff(h) % (unsigned long) pGetCoeff(strat->S[j]) != 0) &&
    34543454//         ((unsigned long) pGetCoeff(strat->S[j]) % (unsigned long) pGetCoeff(h) != 0))
    3455       if ((iCompH == pGetComp(strat->S[j]))
     3455      if (((iCompH == pGetComp(strat->S[j]))
    34563456      || (0 == pGetComp(strat->S[j])))
     3457      && ((iCompH<=strat->syzComp)||(strat->syzComp==0)))
    34573458      {
    34583459        enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR);
     
    35883589void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR)
    35893590{
    3590         #if ADIDEBUG
    3591         PrintLn();
    3592         PrintS("Enter superenterpairs");
    3593         PrintLn();
    3594         int iii = strat->Ll;
    3595         #endif
    3596     assume (rField_is_Ring(currRing));
    3597     // enter also zero divisor * poly, if this is non zero and of smaller degree
    3598     if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat);
    3599      #if ADIDEBUG
    3600     if(iii==strat->Ll)
    3601         {
    3602         PrintLn();
    3603         PrintS("                enterExtendedSpoly has not changed the list L.");
    3604         PrintLn();
    3605         }
    3606     else
    3607     {
    3608         PrintLn();
    3609         PrintS("                enterExtendedSpoly changed the list L: ");
    3610         PrintLn();   
    3611         for(iii=0;iii<=strat->Ll;iii++)
    3612                         {
    3613                         PrintLn();
    3614                         PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
    3615                         PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
    3616                         PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
    3617                         PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
    3618                         }
    3619         }
    3620         iii = strat->Ll;
    3621     #endif
    3622     initenterpairs(h, k, ecart, 0, strat, atR);
    3623     #if ADIDEBUG
    3624     if(iii==strat->Ll)
    3625         {
    3626         PrintLn();
    3627         PrintS("                initenterpairs has not changed the list L.");
    3628         PrintLn();
    3629         }
    3630     else
    3631     {
    3632         PrintLn();
    3633         PrintS("                initenterpairs changed the list L: ");
    3634         PrintLn();   
    3635         for(iii=0;iii<=strat->Ll;iii++)
    3636                         {
    3637                         PrintLn();
    3638                         PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
    3639                         PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
    3640                         PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
    3641                         PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
    3642                         }
    3643         }
    3644         iii = strat->Ll;
    3645     #endif
    3646     initenterstrongPairs(h, k, ecart, 0, strat, atR);
    3647     #if ADIDEBUG
    3648     if(iii==strat->Ll)
    3649         {
    3650         PrintLn();
    3651         PrintS("                initenterstrongPairs has not changed the list L.");
    3652         PrintLn();
    3653         }
    3654     else
    3655     {
    3656         PrintLn();
    3657         PrintS("                initenterstrongPairs changed the list L: ");
    3658         PrintLn();   
    3659         for(iii=0;iii<=strat->Ll;iii++)
    3660                         {
    3661                         PrintLn();
    3662                         PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
    3663                         PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
    3664                         PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
    3665                         PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
    3666                         }
    3667         }
    3668         PrintLn();
    3669         PrintS("End of superenterpairs");
    3670         PrintLn();
    3671         #endif
    3672         clearSbatch(h, k, pos, strat);
     3591  #if ADIDEBUG
     3592  PrintLn();
     3593  PrintS("Enter superenterpairs");
     3594  PrintLn();
     3595  int iii = strat->Ll;
     3596  #endif
     3597  assume (rField_is_Ring(currRing));
     3598  // enter also zero divisor * poly, if this is non zero and of smaller degree
     3599  if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat);
     3600   #if ADIDEBUG
     3601  if(iii==strat->Ll)
     3602  {
     3603    PrintLn();
     3604    PrintS("                enterExtendedSpoly has not changed the list L.");
     3605    PrintLn();
     3606  }
     3607  else
     3608  {
     3609    PrintLn();
     3610    PrintS("                enterExtendedSpoly changed the list L: ");
     3611    PrintLn();
     3612    for(iii=0;iii<=strat->Ll;iii++)
     3613    {
     3614      PrintLn();
     3615      PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     3616      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     3617      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     3618      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     3619    }
     3620  }
     3621  iii = strat->Ll;
     3622  #endif
     3623  initenterpairs(h, k, ecart, 0, strat, atR);
     3624  #if ADIDEBUG
     3625  if(iii==strat->Ll)
     3626  {
     3627    PrintLn();
     3628    PrintS("                initenterpairs has not changed the list L.");
     3629    PrintLn();
     3630  }
     3631  else
     3632  {
     3633    PrintLn();
     3634    PrintS("                initenterpairs changed the list L: ");
     3635    PrintLn();
     3636    for(iii=0;iii<=strat->Ll;iii++)
     3637    {
     3638      PrintLn();
     3639      PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     3640      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     3641      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     3642      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     3643    }
     3644  }
     3645  iii = strat->Ll;
     3646  #endif
     3647  initenterstrongPairs(h, k, ecart, 0, strat, atR);
     3648  #if ADIDEBUG
     3649  if(iii==strat->Ll)
     3650  {
     3651    PrintLn();
     3652    PrintS("                initenterstrongPairs has not changed the list L.");
     3653    PrintLn();
     3654  }
     3655  else
     3656  {
     3657    PrintLn();
     3658    PrintS("                initenterstrongPairs changed the list L: ");
     3659    PrintLn();
     3660    for(iii=0;iii<=strat->Ll;iii++)
     3661    {
     3662      PrintLn();
     3663      PrintS("                L[");printf("%d",iii);PrintS("]:");PrintLn();
     3664      PrintS("                     ");p_Write(strat->L[iii].p1,strat->tailRing);
     3665      PrintS("                     ");p_Write(strat->L[iii].p2,strat->tailRing);
     3666      PrintS("                     ");p_Write(strat->L[iii].p,strat->tailRing);
     3667    }
     3668  }
     3669  PrintLn();
     3670  PrintS("End of superenterpairs");
     3671  PrintLn();
     3672  #endif
     3673  clearSbatch(h, k, pos, strat);
    36733674}
    36743675#endif
     
    57805781      if (currRing->OrdSgn==-1)
    57815782      {
    5782                 /*#ifdef HAVE_RINGS
    5783                         if (rField_is_Ring(currRing))
    5784                         {
    5785                         h.pCleardenom();
    5786                         }
    5787                         else
    5788                                 #endif*/
     5783                    /*#ifdef HAVE_RINGS
     5784                          if (rField_is_Ring(currRing))
     5785                            {
     5786                            h.pCleardenom();
     5787                            }
     5788                          else
     5789                                #endif*/
    57895790        cancelunit(&h);  /*- tries to cancel a unit -*/
    57905791        deleteHC(&h, strat);
     
    72557256{
    72567257
    7257   //if the ordering is local, then hilb criterion 
     7258  //if the ordering is local, then hilb criterion
    72587259  //can be used also if tzhe ideal is not homogenous
    72597260  if((currRing->OrdSgn == -1) && (currRing->MixedOrder == 0 ))
     
    72617262  {
    72627263  if(rField_is_Ring(currRing))
    7263         *hilb=NULL;
     7264          *hilb=NULL;
    72647265  else
    7265         return;
     7266           return;
    72667267  }
    72677268#endif
     
    80238024/*  #ifdef HAVE_RINGS
    80248025  if (!rField_is_Ring(currRing))
    8025   #endif */ 
     8026  #endif */
    80268027  for (i=1; i<=(currRing->N); i++)
    80278028  {
     
    81298130  strat->overflow=FALSE;
    81308131  ring new_tailRing = rModifyRing(currRing,
    8131                                   // Hmmm .. the condition pFDeg == p_Deg
    8132                                   // might be too strong
     8132  // Hmmm .. the condition pFDeg == p_Deg
     8133  // might be too strong
    81338134#ifdef HAVE_RINGS
    8134                                   (strat->homog && currRing->pFDeg == p_Deg && !(rField_is_Ring(currRing))), // TODO Oliver
    8135                                  
    8136                                  
     8135  (strat->homog && currRing->pFDeg == p_Deg && !(rField_is_Ring(currRing))), // TODO Oliver
    81378136#else
    8138                                   (strat->homog && currRing->pFDeg == p_Deg), // omit_degree
    8139 #endif
    8140                                   (strat->ak==0), // omit_comp if the input is an ideal
    8141                                   expbound); // exp_limit
    8142 
    8143 if (new_tailRing == currRing) return TRUE;
     8137  (strat->homog && currRing->pFDeg == p_Deg), // omit_degree
     8138#endif
     8139  (strat->ak==0), // omit_comp if the input is an ideal
     8140  expbound); // exp_limit
     8141
     8142  if (new_tailRing == currRing) return TRUE;
    81448143
    81458144  strat->pOrigFDeg_TailRing = new_tailRing->pFDeg;
     
    87168715       PrintS("ecartWeights: ");
    87178716       for (int i = rVar(currRing); i > 0; i--)
    8718         Print("%hd ", ecartWeights[i]);
     8717        Print("%hd ", ecartWeights[i]);
    87198718       PrintLn();
    87208719       assume( TEST_OPT_WEIGHTM );
Note: See TracChangeset for help on using the changeset viewer.