Changeset 17c315 in git
- Timestamp:
- Mar 13, 2017, 4:42:06 PM (7 years ago)
- 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
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kutil.cc
ra0707f8 r17c315 1322 1322 #endif 1323 1323 /*- computes the lcm(s[i],p) -*/ 1324 h.lcm = p Init();1324 h.lcm = p_Lcm(p,strat->S[i],currRing); 1325 1325 pSetCoeff0(h.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf)); 1326 1326 if (nIsZero(pGetCoeff(h.lcm))) … … 1331 1331 } 1332 1332 // basic chain criterion 1333 pLcm(p,strat->S[i],h.lcm); 1334 pSetm(h.lcm); 1335 /* 1333 /* 1336 1334 *the set B collects the pairs of type (S[j],p) 1337 1335 *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p) != lcm(r,p) … … 1970 1968 #elif defined(HAVE_RATGRING) 1971 1969 if (rIsRatGRing(currRing)) 1972 pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift1970 pLcmRat(p,strat->S[i],Lp.lcm, currRing->real_var_start); // int rat_shift 1973 1971 else 1974 pLcm(p,strat->S[i],Lp.lcm);1972 pLcm(p,strat->S[i],Lp.lcm); 1975 1973 #endif 1976 1974 pSetm(Lp.lcm); … … 2238 2236 assume(i<=strat->sl); 2239 2237 2238 if ((strat->S[i]==NULL) || (p==NULL)) 2239 return; 2240 2240 2241 int l,j,compare; 2241 2242 LObject Lp; … … 2246 2247 #endif 2247 2248 /*- 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); 2252 2250 2253 2251 if (strat->sugarCrit) … … 2377 2375 pNorm(p); 2378 2376 2379 if ((strat->S[i]==NULL) || (p==NULL))2380 return;2381 2382 2377 if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0)) 2383 2378 Lp.p=NULL; … … 2466 2461 pLcm(p,strat->S[i],Lp.lcm); 2467 2462 #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); 2470 2467 #endif 2471 2468 pSetm(Lp.lcm); … … 2742 2739 pLcm(p,strat->S[i],Lp.lcm); 2743 2740 #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); 2746 2745 #endif 2747 2746 pSetm(Lp.lcm); … … 3156 3155 Lp.i_r = -1; 3157 3156 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); 3161 3158 /*- compute the short s-polynomial -*/ 3162 3159 … … 4239 4236 #endif 4240 4237 /*- 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); 4245 4239 pSetCoeff(Lp.lcm, nLcm(pGetCoeff(p), pGetCoeff(f), currRing)); 4246 4240 assume(!strat->sugarCrit); … … 12350 12344 #endif 12351 12345 /*- 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 12356 12347 12357 12348 /* apply the V criterion */ -
libpolys/polys/monomials/p_polys.cc
ra0707f8 r17c315 1614 1614 void p_Lcm(const poly a, const poly b, poly m, const ring r) 1615 1615 { 1616 for (int i=r Var(r); i; --i)1616 for (int i=r->N; i; --i) 1617 1617 p_SetExp(m,i, si_max( p_GetExp(a,i,r), p_GetExp(b,i,r)),r); 1618 1618 … … 1621 1621 } 1622 1622 1623 1623 poly 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 } 1624 1630 1625 1631 #ifdef HAVE_RATGRING -
libpolys/polys/monomials/p_polys.h
ra0707f8 r17c315 1936 1936 poly p_Div_nn(poly p, const number n, const ring r); 1937 1937 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 1939 1939 void 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 1941 poly p_Lcm(const poly a, const poly b, const ring r); 1940 1942 1941 1943 #ifdef HAVE_RATGRING -
libpolys/polys/nc/nc.h
ra0707f8 r17c315 324 324 ring curr, 325 325 bool dummy_ring = false 326 326 /* allow to create a nc-ring with 1 variable*/); 327 327 328 328 … … 337 337 poly pOppose(ring Rop_src, poly p, const ring Rop_dst); 338 338 ideal 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 component343 // 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 & b347 // 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 353 339 354 340 const int GENERICMASK = 0x000; // gnc... must do its dirty job first! -
libpolys/polys/nc/old.gring.cc
ra0707f8 r17c315 150 150 // poly nc_p_Plus_mm_Mult_qq (poly p, const poly m, const poly q, int &lp, int lq, const ring r); 151 151 #endif 152 153 154 155 /*2156 * returns the LCM of the head terms of a and b157 * 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 PDEBUG179 // p_Test(m,r);180 #endif181 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 PDEBUG190 p_Test(a, r);191 p_Test(b, r);192 #endif193 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 PDEBUG200 // p_Test(m,r);201 #endif202 return(m);203 }204 205 152 206 153 … … 1964 1911 #endif 1965 1912 { 1966 m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2),r);1913 m = p_Lcm(p1, p2, r); 1967 1914 } 1968 1915 -
libpolys/polys/nc/sca.cc
ra0707f8 r17c315 766 766 } 767 767 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) ) 769 769 770 770 poly m1 = p_One( r);
Note: See TracChangeset
for help on using the changeset viewer.