Changeset 9f17c9 in git


Ignore:
Timestamp:
Apr 23, 2009, 7:28:07 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
06f49a74058e21b60e4d16caee96019a21543062
Parents:
822aa3ad9062852dd98789a4bd54970e85327ef2
Message:
*hannes: which to red. in completeReduce


git-svn-id: file:///usr/local/Singular/svn/trunk@11746 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/kutil.cc

    r822aa3a r9f17c9  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.134 2009-04-10 19:01:11 motsak Exp $ */
     4/* $Id: kutil.cc,v 1.135 2009-04-23 17:28:07 Singular Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    169169                           q,currRing,
    170170                           currRing->real_var_start, currRing->real_var_end))
    171         return 0; 
     171        return 0;
    172172      return pLmCmp(q,p); // ONLY FOR GLOBAL ORDER!
    173173    }
     
    15571557        else
    15581558        {
    1559           Lp.p = // nc_CreateSpoly(strat->S[i],p,currRing); 
     1559          Lp.p = // nc_CreateSpoly(strat->S[i],p,currRing);
    15601560                nc_CreateShortSpoly(strat->S[i], p, currRing);
    15611561
    1562           assume(pNext(Lp.p)==NULL); // TODO: this may be violated whenever ext.prod.crit. for Lie alg. is used   
     1562          assume(pNext(Lp.p)==NULL); // TODO: this may be violated whenever ext.prod.crit. for Lie alg. is used
    15631563          pNext(Lp.p) = strat->tail; // !!!
    15641564        }
     
    15661566      else
    15671567      {
    1568         Lp.p = // nc_CreateSpoly(strat->S[i],p,currRing); 
     1568        Lp.p = // nc_CreateSpoly(strat->S[i],p,currRing);
    15691569              nc_CreateShortSpoly(strat->S[i], p, currRing);
    15701570
    1571         assume(pNext(Lp.p)==NULL); // TODO: this may be violated whenever ext.prod.crit. for Lie alg. is used   
     1571        assume(pNext(Lp.p)==NULL); // TODO: this may be violated whenever ext.prod.crit. for Lie alg. is used
    15721572        pNext(Lp.p) = strat->tail; // !!!
    15731573
    15741574      }
    15751575
    1576      
     1576
    15771577#if MYTEST
    15781578      if (TEST_OPT_DEBUG)
     
    15821582        PrintS("SPoly: "); pWrite(Lp.p);
    15831583      }
    1584 #endif     
    1585      
     1584#endif
     1585
    15861586    }
    15871587    else
     
    15971597        PrintS("commutative SPoly: "); pWrite(Lp.p);
    15981598      }
    1599 #endif     
     1599#endif
    16001600
    16011601      }
     
    16271627    if (
    16281628        (!rIsPluralRing(currRing))
    1629 //      ||  (rIsPluralRing(currRing) && (ncRingType(currRing) != nc_lie))         
     1629//      ||  (rIsPluralRing(currRing) && (ncRingType(currRing) != nc_lie))
    16301630       )
    16311631    {
    1632       assume(pNext(Lp.p)==NULL); // TODO: this may be violated whenever ext.prod.crit. for Lie alg. is used   
     1632      assume(pNext(Lp.p)==NULL); // TODO: this may be violated whenever ext.prod.crit. for Lie alg. is used
    16331633      pNext(Lp.p) = strat->tail; // !!!
    16341634    }
     
    20062006              if(TEST_OPT_DEBUG)
    20072007              {
    2008                  Print("chain-crit-part: S[%d]=",j); 
     2008                 Print("chain-crit-part: S[%d]=",j);
    20092009                 p_wrp(strat->S[j],currRing);
    20102010                 Print(" divide B[%d].lcm=",i);
     
    20412041              if(TEST_OPT_DEBUG)
    20422042              {
    2043                  PrintS("chain-crit-part: pCompareChainPart p="); 
     2043                 PrintS("chain-crit-part: pCompareChainPart p=");
    20442044                 p_wrp(p,currRing);
    20452045                 Print(" delete L[%d]",j);
     
    20722072              if(TEST_OPT_DEBUG)
    20732073              {
    2074                  Print("chain-crit-part: sugar B[%d].lcm=",j); 
     2074                 Print("chain-crit-part: sugar B[%d].lcm=",j);
    20752075                 p_wrp(strat->B[j].lcm,currRing);
    20762076                 Print(" delete B[%d]",i);
     
    20852085              if(TEST_OPT_DEBUG)
    20862086              {
    2087                  Print("chain-crit-part: sugar B[%d].lcm=",i); 
     2087                 Print("chain-crit-part: sugar B[%d].lcm=",i);
    20882088                 p_wrp(strat->B[i].lcm,currRing);
    20892089                 Print(" delete B[%d]",j);
     
    21152115              if(TEST_OPT_DEBUG)
    21162116              {
    2117                  PrintS("chain-crit-part: sugar:pCompareChainPart p="); 
     2117                 PrintS("chain-crit-part: sugar:pCompareChainPart p=");
    21182118                 p_wrp(p,currRing);
    21192119                 Print(" delete L[%d]",j);
     
    21412141              if(TEST_OPT_DEBUG)
    21422142              {
    2143                  Print("chain-crit-part: equal lcm B[%d].lcm=",j); 
     2143                 Print("chain-crit-part: equal lcm B[%d].lcm=",j);
    21442144                 p_wrp(strat->B[j].lcm,currRing);
    21452145                 Print(" delete B[%d]\n",i);
     
    21682168              if(TEST_OPT_DEBUG)
    21692169              {
    2170                  PrintS("chain-crit-part: pCompareChainPart p="); 
     2170                 PrintS("chain-crit-part: pCompareChainPart p=");
    21712171                 p_wrp(p,currRing);
    21722172                 Print(" delete L[%d]",j);
     
    22322232              if(TEST_OPT_DEBUG)
    22332233              {
    2234                  PrintS("chain-crit-part: divisible_by p="); 
     2234                 PrintS("chain-crit-part: divisible_by p=");
    22352235                 p_wrp(p,currRing);
    22362236                 Print(" delete L[%d]",l);
     
    22452245              if(TEST_OPT_DEBUG)
    22462246              {
    2247                  PrintS("chain-crit-part: divisible_by(2) p="); 
     2247                 PrintS("chain-crit-part: divisible_by(2) p=");
    22482248                 p_wrp(p,currRing);
    22492249                 Print(" delete L[%d]",i);
     
    23202320    }
    23212321
    2322     if (new_pair) 
     2322    if (new_pair)
    23232323    {
    23242324#ifdef HAVE_RATGRING
     
    31123112
    31133113  if (strat->noClearS) return;
    3114  
     3114
    31153115//   #ifdef HAVE_PLURAL
    31163116/*
     
    31283128        k--;
    31293129      }
    3130      
     3130
    31313131      j++;
    31323132    }
    3133   }   
     3133  }
    31343134  else
    3135 */ 
    3136 //   #endif // ??? Why was the following cancelation disabled for non-commutative rings? 
    3137   { 
     3135*/
     3136//   #endif // ??? Why was the following cancelation disabled for non-commutative rings?
     3137  {
    31383138    j=pos;
    31393139    loop
     
    45424542      if (cnt==0)
    45434543      {
    4544         cnt=REDTAIL_CANONICALIZE; 
    4545         poly tmp=Ln.CanonicalizeP(); 
    4546         if (normalize) 
     4544        cnt=REDTAIL_CANONICALIZE;
     4545        poly tmp=Ln.CanonicalizeP();
     4546        if (normalize)
    45474547        {
    45484548          Ln.Normalize();
     
    48874887  /*- test, if a unit is in F -*/
    48884888
    4889   if ((strat->Ll>=0) 
     4889  if ((strat->Ll>=0)
    48904890#ifdef HAVE_RINGS
    48914891       && nIsUnit(pGetCoeff(strat->L[strat->Ll].p))
     
    55245524  assume(!p.is_normalized || nIsOne(pGetCoeff(p.p)));
    55255525
    5526 #ifdef KDEBUG 
     5526#ifdef KDEBUG
    55275527  // do not put an LObject twice into T:
    55285528  for(i=strat->tl;i>=0;i--)
    55295529  {
    5530     if (p.p==strat->T[i].p) 
     5530    if (p.p==strat->T[i].p)
    55315531    {
    55325532      printf("already in T at pos %d of %d, atT=%d\n",i,strat->tl,atT);
     
    55345534    }
    55355535  }
    5536 #endif 
     5536#endif
    55375537  strat->newt = TRUE;
    55385538  if (atT < 0)
     
    59435943{
    59445944  int i;
    5945   int low = (pOrdSgn == 1 ? 1 : 0);
     5945  int low = (((pOrdSgn==1) && (strat->fromQ==NULL) ? 1 : 0);
    59465946  LObject L;
    59475947
     
    59645964  for (i=strat->sl; i>=low; i--)
    59655965  {
     5966    int end_pos=strat->sl;
     5967    if ((strat->fromQ!=NULL) && (strat->fromQ[i])) continue; // do not reduce Q_i
     5968    if (strat->ak==0) end_pos=i-1;
    59665969    TObject* T_j = strat->s_2_t(i);
    59675970    if (T_j != NULL)
     
    59705973      poly p;
    59715974      if (pOrdSgn == 1)
    5972         strat->S[i] = redtailBba(&L, i-1, strat, withT);
     5975        strat->S[i] = redtailBba(&L, end_pos, strat, withT);
    59735976      else
    59745977        strat->S[i] = redtail(&L, strat->sl, strat);
     
    59895992      assume(currRing == strat->tailRing);
    59905993      if (pOrdSgn == 1)
    5991         strat->S[i] = redtailBba(strat->S[i], i-1, strat, withT);
     5994        strat->S[i] = redtailBba(strat->S[i], end_pos, strat, withT);
    59925995      else
    59935996        strat->S[i] = redtail(strat->S[i], strat->sl, strat);
     
    60196022  else
    60206023    scComputeHCw(strat->Shdl,NULL,strat->ak,strat->kHEdge, strat->tailRing);
    6021 #else   
     6024#else
    60226025  scComputeHC(strat->Shdl,NULL,strat->ak,strat->kHEdge, strat->tailRing);
    6023 #endif 
     6026#endif
    60246027  if (strat->t_kHEdge != NULL) p_LmFree(strat->t_kHEdge, strat->tailRing);
    60256028  if (strat->tailRing != currRing)
     
    65166519{
    65176520  /* assume: p is completely in currRing */
    6518   /* produces an object with LM in curring 
     6521  /* produces an object with LM in curring
    65196522     and TAIL in tailring */
    65206523  if (pNext(p)!=NULL)
     
    65856588    /* creates LObject from the poly in currRing */
    65866589  /* actually put p into L.p and make L.t_p=NULL : does not work */
    6587  
     6590
    65886591//}
    65896592
     
    66156618//     {
    66166619//       p = p_ShallowCopyDelete(h.p, (strat->tailRing != NULL ? strat->tailRing : currRing), strat->tailBin);
    6617 //     } 
     6620//     }
    66186621//     return(p);
    66196622//   }
     
    67736776  /* these vars hold for all shifts of s[i] */
    67746777  int ecartq = 0; //Hans says it's ok; we're in the homog case, no ecart
    6775  
     6778
    67766779  int qfromQ;
    67776780  if (strat->fromQ != NULL)
    67786781  {
    6779     qfromQ = strat->fromQ[i]; 
     6782    qfromQ = strat->fromQ[i];
    67806783  }
    67816784  else
     
    67916794  enterOnePairShift(qq, p, ecart, isFromQ, strat, -1, ecartq, qfromQ, j, i, uptodeg, lV);
    67926795
    6793   for (j=1; j<= toInsert; j++) 
     6796  for (j=1; j<= toInsert; j++)
    67946797  {
    67956798    //    q = pLPshift(strat->S[i],j,uptodeg,lV);
    6796     q = p_LPshiftT(qq, j, uptodeg, lV, strat, currRing); 
     6799    q = p_LPshiftT(qq, j, uptodeg, lV, strat, currRing);
    67976800    //    q = p_mLPshift(qq,j,uptodeg,lV,currRing); // lm in currRing, shift this monomial
    67986801    //    s = p_LPshift(pNext(qq), j, uptodeg, lV, strat->tailRing); // from tailRing
     
    68536856  /* these vars hold for all shifts of s[i] */
    68546857  int ecartq = 0; //Hans says it's ok; we're in the homog case, no ecart
    6855   int qfromQ = 0; // strat->fromQ[i]; 
     6858  int qfromQ = 0; // strat->fromQ[i];
    68566859
    68576860  for (; j<= toInsert; j++)
     
    68986901//       wrp(q); //      wrp(pHead(q));
    68996902//       PrintS(", p = ");
    6900 //       wrp(p); //wrp(pHead(p)); 
     6903//       wrp(p); //wrp(pHead(p));
    69016904//       PrintLn();
    69026905    }
     
    69336936      wrp(q); //      wrp(pHead(q));
    69346937      PrintS(", p = ");
    6935       wrp(p); //wrp(pHead(p)); 
     6938      wrp(p); //wrp(pHead(p));
    69366939      PrintLn();
    69376940    }
     
    71087111//     else
    71097112//     {
    7110    
     7113
    71117114    /* ksCreateShortSpoly needs two Lobject-kind presentations */
    71127115    /* p is already in this form, so convert q */
     
    71397142    /*- the pair (S[i],p) enters B -*/
    71407143    /* both of them should have their LM in currRing and TAIL in tailring */
    7141     Lp.p1 = q;  // already in the needed form 
    7142     Lp.p2 = p; // already in the needed form 
     7144    Lp.p1 = q;  // already in the needed form
     7145    Lp.p2 = p; // already in the needed form
    71437146
    71447147    if ( !rIsPluralRing(currRing) )
     
    71497152    if ( (atR >= 0) && (shiftcount==0) && (ifromS >=0) )
    71507153    {
    7151       Lp.i_r1 = kFindInT(Lp.p1,strat); //strat->S_2_R[ifromS]; 
     7154      Lp.i_r1 = kFindInT(Lp.p1,strat); //strat->S_2_R[ifromS];
    71527155      Lp.i_r2 = atR;
    71537156    }
     
    73007303  if (atT < 0)
    73017304    atT = strat->posInT(strat->T, strat->tl, p);
    7302  
     7305
    73037306  /* can call enterT in a sequence, e.g. */
    73047307
     
    73097312  {
    73107313    qq      = p; //qq.Copy();
    7311     qq.p    = NULL; 
     7314    qq.p    = NULL;
    73127315    qq.max  = NULL;
    73137316    qq.t_p = p_LPshift(p_Copy(p.t_p,strat->tailRing), i, uptodeg, lV, strat->tailRing); // direct shift
Note: See TracChangeset for help on using the changeset viewer.