Changeset f489c7b in git for libpolys/polys/monomials/p_polys.cc
- Timestamp:
- Feb 27, 2018, 5:37:19 PM (6 years ago)
- Branches:
- (u'spielwiese', 'd0474371d8c5d8068ab70bfb42719c97936b18a6')
- Children:
- dab4204fd4f4fe227449dacf9c07d0f7f036bdd8
- Parents:
- 617c8e724541d5f5c39e8ee6708e0e2d8905d332
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/p_polys.cc
r617c8e7 rf489c7b 624 624 case ringorder_am: 625 625 b1=si_min(b1,r->N); 626 626 /* no break, continue as ringorder_a*/ 627 627 case ringorder_a: 628 628 for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++) … … 2239 2239 { 2240 2240 if (ph==NULL) return; 2241 const coeffs cf=r->cf; 2241 2242 if (pNext(ph)==NULL) 2242 2243 { 2243 p_SetCoeff(ph,n_Init(1, r->cf),r);2244 } 2245 if ( r->cf->cfSubringGcd==ndGcd) /* trivial gcd*/ return;2244 p_SetCoeff(ph,n_Init(1,cf),r); 2245 } 2246 if (cf->cfSubringGcd==ndGcd) /* trivial gcd*/ return; 2246 2247 number h=p_InitContent(ph,r); /* first guess of a gcd of all coeffs */ 2247 poly p=ph; 2248 poly p; 2249 if(n_IsOne(h,cf)) 2250 { 2251 goto content_finish; 2252 } 2253 p=ph; 2248 2254 // take the SubringGcd of all coeffs 2249 2255 while (p!=NULL) 2250 2256 { 2251 n_Normalize(pGetCoeff(p), r->cf);2252 number d=n_SubringGcd(h,pGetCoeff(p), r->cf);2253 n_Delete(&h, r->cf);2257 n_Normalize(pGetCoeff(p),cf); 2258 number d=n_SubringGcd(h,pGetCoeff(p),cf); 2259 n_Delete(&h,cf); 2254 2260 h = d; 2255 if(n_IsOne(h, r->cf))2256 { 2257 break;2261 if(n_IsOne(h,cf)) 2262 { 2263 goto content_finish; 2258 2264 } 2259 2265 pIter(p); 2260 2266 } 2261 // if foundi<>1, divide by it 2262 if(!n_IsOne(h,r->cf)) 2263 { 2264 p = ph; 2265 while (p!=NULL) 2266 { 2267 number d = n_ExactDiv(pGetCoeff(p),h,r->cf); 2268 p_SetCoeff(p,d,r); 2269 pIter(p); 2270 } 2271 } 2267 // if found<>1, divide by it 2268 p = ph; 2269 while (p!=NULL) 2270 { 2271 number d = n_ExactDiv(pGetCoeff(p),h,cf); 2272 p_SetCoeff(p,d,r); 2273 pIter(p); 2274 } 2275 content_finish: 2272 2276 n_Delete(&h,r->cf); 2273 2277 // and last: check leading sign:
Note: See TracChangeset
for help on using the changeset viewer.