Changeset 255be23 in git for libpolys/polys/clapsing.cc
 Timestamp:
 Jan 30, 2017, 3:18:40 PM (7 years ago)
 Branches:
 (u'fiekerDuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd25190065115c859833252500a64cfb7b11e3a50')
 Children:
 7fcc5b108e080c630a6e6190bdcccc10fca68ccd
 Parents:
 9f93d92fc5f70f3bc8c46a01416c4f0c956a723d
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libpolys/polys/clapsing.cc
r9f93d9 r255be23 57 57 assume(g!=NULL); 58 58 59 if(pNext(f)==NULL && pNext(g)==NULL) 60 { 61 poly p=p_One(r); 62 for(int i=rVar(r);i>0;i) 63 p_SetExp(p,i,si_min(p_GetExp(f,i,r),p_GetExp(g,i,r)),r); 64 if (rField_is_Ring(r)) 65 { 66 number c = p_GetCoeff(f,r); 67 number d = p_GetCoeff(g,r); 68 p_SetCoeff(p,n_Gcd(c,d,r>cf),r); 69 } 70 p_Setm(p,r); 71 return p; 72 #if 0 73 else 74 { 75 poly h=g; 76 for(int i=rVar(r);i>0;i) 77 p_SetExp(p,i,p_GetExp(f,i,r),r); 78 while(h!=NULL) 79 { 80 for(int i=rVar(r);i>0;i) 81 p_SetExp(p,i,si_min(p_GetExp(p,i,r),p_GetExp(h,i,r)),r); 82 pIter(h); 83 } 84 p_Setm(p,r); 85 return p; 86 } 87 #endif 88 } 89 #if 0 90 else if (pNext(g)==NULL) 91 { 92 poly p=p_One(r); 93 poly h=f; 94 for(int i=rVar(r);i>0;i) 95 p_SetExp(p,i,p_GetExp(g,i,r),r); 96 if (rField_is_Ring(r)) 97 { 98 number c = p_GetCoeff(f,r); 99 number d = p_GetCoeff(g,r); 100 p_SetCoeff(p,n_Gcd(c,d,r>cf),r); 101 } 102 while(h!=NULL) 103 { 104 for(int i=rVar(r);i>0;i) 105 p_SetExp(p,i,si_min(p_GetExp(p,i,r),p_GetExp(h,i,r)),r); 106 pIter(h); 107 } 108 p_Setm(p,r); 109 return p; 110 } 111 #endif 59 if(pNext(f)==NULL) 60 { 61 return p_GcdMon(f,g,r); 62 } 63 else if(pNext(g)==NULL) 64 { 65 return p_GcdMon(g,f,r); 66 } 112 67 113 68 Off(SW_RATIONAL); … … 329 284 poly res=NULL; 330 285 331 if (f!=NULL) p_Cleardenom(f, r); 332 if (g!=NULL) p_Cleardenom(g, r); 333 else return f; // g==0 => gcd=f (but do a p_Cleardenom) 334 if (f==NULL) return g; // f==0 => gcd=g (but do a p_Cleardenom) 286 if (f!=NULL) 287 { 288 //if (r>cf>has_simple_Inverse) p_Norm(f,r); 289 if (rField_is_Zp(r)) p_Norm(f,r); 290 else p_Cleardenom(f, r); 291 } 292 if (g!=NULL) 293 { 294 //if (r>cf>has_simple_Inverse) p_Norm(g,r); 295 if (rField_is_Zp(r)) p_Norm(g,r); 296 else p_Cleardenom(g, r); 297 } 298 else return f; // g==0 => gcd=f (but do a p_Cleardenom/pNorm) 299 if (f==NULL) return g; // f==0 => gcd=g (but do a p_Cleardenom/pNorm) 335 300 336 301 res=singclap_gcd_r(f,g,r);
Note: See TracChangeset
for help on using the changeset viewer.