Changeset 17c315 in git


Ignore:
Timestamp:
Mar 13, 2017, 4:42:06 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
af6ec6b981b52226441c782e44735843c61cfb5b
Parents:
a0707f8848846bae0b35b9436d54d36e5f3ccd43
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2017-03-13 16:42:06+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2017-03-13 16:44:45+01:00
Message:
p_Lcm -> p_polys.cc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    ra0707f8 r17c315  
    13221322#endif
    13231323  /*- computes the lcm(s[i],p) -*/
    1324   h.lcm = pInit();
     1324  h.lcm = p_Lcm(p,strat->S[i],currRing);
    13251325  pSetCoeff0(h.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf));
    13261326  if (nIsZero(pGetCoeff(h.lcm)))
     
    13311331  }
    13321332  // basic chain criterion
    1333   pLcm(p,strat->S[i],h.lcm);
    1334   pSetm(h.lcm);
    1335     /*
     1333  /*
    13361334  *the set B collects the pairs of type (S[j],p)
    13371335  *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p) != lcm(r,p)
     
    19701968#elif defined(HAVE_RATGRING)
    19711969  if (rIsRatGRing(currRing))
    1972   pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
     1970    pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
    19731971  else
    1974   pLcm(p,strat->S[i],Lp.lcm);
     1972    pLcm(p,strat->S[i],Lp.lcm);
    19751973#endif
    19761974  pSetm(Lp.lcm);
     
    22382236  assume(i<=strat->sl);
    22392237
     2238  if ((strat->S[i]==NULL) || (p==NULL))
     2239    return;
     2240
    22402241  int      l,j,compare;
    22412242  LObject  Lp;
     
    22462247#endif
    22472248  /*- computes the lcm(s[i],p) -*/
    2248   Lp.lcm = pInit();
    2249 
    2250   pLcm(p,strat->S[i],Lp.lcm);
    2251   pSetm(Lp.lcm);
     2249  Lp.lcm = p_Lcm(p,strat->S[i],currRing);
    22522250
    22532251  if (strat->sugarCrit)
     
    23772375    pNorm(p);
    23782376
    2379   if ((strat->S[i]==NULL) || (p==NULL))
    2380     return;
    2381 
    23822377  if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0))
    23832378    Lp.p=NULL;
     
    24662461  pLcm(p,strat->S[i],Lp.lcm);
    24672462#elif defined(HAVE_RATGRING)
    2468   //  if (rIsRatGRing(currRing))
    2469   pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
     2463  if (rIsRatGRing(currRing))
     2464    pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
     2465  else
     2466    pLcm(p,strat->S[i],Lp.lcm);
    24702467#endif
    24712468  pSetm(Lp.lcm);
     
    27422739  pLcm(p,strat->S[i],Lp.lcm);
    27432740#elif defined(HAVE_RATGRING)
    2744   //  if (rIsRatGRing(currRing))
    2745   pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
     2741  if (rIsRatGRing(currRing))
     2742    pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift
     2743  else
     2744    pLcm(p,strat->S[i],Lp.lcm);
    27462745#endif
    27472746  pSetm(Lp.lcm);
     
    31563155  Lp.i_r = -1;
    31573156
    3158   Lp.lcm = pInit();
    3159   pLcm(p,strat->S[i],Lp.lcm);
    3160   pSetm(Lp.lcm);
     3157  Lp.lcm = p_Lcm(p,strat->S[i],currRing);
    31613158  /*-  compute the short s-polynomial -*/
    31623159
     
    42394236#endif
    42404237  /*- computes the lcm(s[i],p) -*/
    4241   Lp.lcm = pInit();
    4242 
    4243   pLcm(p,f,Lp.lcm);
    4244   pSetm(Lp.lcm);
     4238  Lp.lcm = p_Lcm(p,f,Lp.lcm,currRing);
    42454239  pSetCoeff(Lp.lcm, nLcm(pGetCoeff(p), pGetCoeff(f), currRing));
    42464240  assume(!strat->sugarCrit);
     
    1235012344#endif
    1235112345  /*- computes the lcm(s[i],p) -*/
    12352   Lp.lcm = pInit();
    12353 
    12354   pLcm(p,q, Lp.lcm); // q is what was strat->S[i], so a poly in LM/TR presentation
    12355   pSetm(Lp.lcm);
     12346  Lp.lcm = p_Lcm(p,q, currRing); // q is what was strat->S[i], so a poly in LM/TR presentation
    1235612347
    1235712348  /* apply the V criterion */
  • libpolys/polys/monomials/p_polys.cc

    ra0707f8 r17c315  
    16141614void p_Lcm(const poly a, const poly b, poly m, const ring r)
    16151615{
    1616   for (int i=rVar(r); i; --i)
     1616  for (int i=r->N; i; --i)
    16171617    p_SetExp(m,i, si_max( p_GetExp(a,i,r), p_GetExp(b,i,r)),r);
    16181618
     
    16211621}
    16221622
    1623 
     1623poly p_Lcm(const poly a, const poly b, const ring r)
     1624{
     1625  poly m=p_Init(r);
     1626  p_Lcm(a, b, m, r);
     1627  p_Setm(m,r);
     1628  return(m);
     1629}
    16241630
    16251631#ifdef HAVE_RATGRING
  • libpolys/polys/monomials/p_polys.h

    ra0707f8 r17c315  
    19361936poly      p_Div_nn(poly p, const number n, const ring r);
    19371937
    1938 // returns the LCM of the head terms of a and b in *m
     1938// returns the LCM of the head terms of a and b in *m, does not p_Setm
    19391939void p_Lcm(const poly a, const poly b, poly m, const ring r);
     1940// returns the LCM of the head terms of a and b, does p_Setm
     1941poly p_Lcm(const poly a, const poly b, const ring r);
    19401942
    19411943#ifdef HAVE_RATGRING
  • libpolys/polys/nc/nc.h

    ra0707f8 r17c315  
    324324                      ring curr,
    325325                      bool dummy_ring = false
    326                       /* allow to create a nc-ring with 1 variable*/);
     326                      /* allow to create a nc-ring with 1 variable*/);
    327327
    328328
     
    337337poly pOppose(ring Rop_src, poly p, const ring Rop_dst);
    338338ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst);
    339 
    340 
    341 
    342 // returns the LCM of the head terms of a and b with the given component
    343 // NOTE: coeff will be created but remains undefined(zero?)
    344 poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r);
    345 
    346 // returns the LCM of the head terms of a and b with component = max comp. of a & b
    347 // NOTE: coeff will be created but remains undefined(zero?)
    348 poly p_Lcm(const poly a, const poly b, const ring r);
    349 
    350 
    351 
    352 
    353339
    354340const int GENERICMASK = 0x000; // gnc... must do its dirty job first!
  • libpolys/polys/nc/old.gring.cc

    ra0707f8 r17c315  
    150150//  poly nc_p_Plus_mm_Mult_qq (poly p, const poly m, const poly q, int &lp, int lq, const ring r);
    151151#endif
    152 
    153 
    154 
    155 /*2
    156 * returns the LCM of the head terms of a and b
    157 * without coefficient!!!
    158 */
    159 poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r)
    160 {
    161   poly m = // p_One( r);
    162           p_Init(r);
    163 
    164   const int pVariables = r->N;
    165 
    166   for (int i = pVariables; i!=0; i--)
    167   {
    168     const int lExpA = p_GetExp (a, i, r);
    169     const int lExpB = p_GetExp (b, i, r);
    170 
    171     p_SetExp (m, i, si_max(lExpA, lExpB), r);
    172   }
    173 
    174   p_SetComp (m, lCompM, r);
    175 
    176   p_Setm(m,r);
    177 
    178 #ifdef PDEBUG
    179 //  p_Test(m,r);
    180 #endif
    181 
    182   n_New(&(p_GetCoeff(m, r)), r);
    183 
    184   return(m);
    185 }
    186 
    187 poly p_Lcm(const poly a, const poly b, const ring r)
    188 {
    189 #ifdef PDEBUG
    190   p_Test(a, r);
    191   p_Test(b, r);
    192 #endif
    193 
    194   const long lCompP1 = p_GetComp(a, r);
    195   const long lCompP2 = p_GetComp(b, r);
    196 
    197   const poly m = p_Lcm(a, b, si_max(lCompP1, lCompP2), r);
    198 
    199 #ifdef PDEBUG
    200 //  p_Test(m,r);
    201 #endif
    202   return(m);
    203 }
    204 
    205152
    206153
     
    19641911#endif
    19651912  {
    1966     m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
     1913    m = p_Lcm(p1, p2, r);
    19671914  }
    19681915
  • libpolys/polys/nc/sca.cc

    ra0707f8 r17c315  
    766766  }
    767767
    768   poly pL = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);       // pL = lcm( lm(p1), lm(p2) )
     768  poly pL = p_Lcm(p1, p2, r);       // pL = lcm( lm(p1), lm(p2) )
    769769
    770770  poly m1 = p_One( r);
Note: See TracChangeset for help on using the changeset viewer.