Changeset 6f30b8 in git
- Timestamp:
- Jun 22, 2011, 2:06:03 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 368602a55ed4fcad6d7f470cbbaa9e51c309b4ea
- Parents:
- 64e7cb73f028e3866617e41d55fd0265168a395d
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/fac_sqrfree.cc
r64e7cb r6f30b8 8 8 #include "cf_defs.h" 9 9 #include "canonicalform.h" 10 #include "cf_map.h" 10 11 11 12 static int divexp = 1; … … 180 181 return F; 181 182 } 183 184 CanonicalForm 185 sqrfPart (const CanonicalForm& F) 186 { 187 if (F.inCoeffDomain()) 188 return F; 189 CFMap M; 190 CanonicalForm A= compress (F, M); 191 CanonicalForm w, v, b; 192 CanonicalForm result; 193 int i= 1; 194 for (; i <= A.level(); i++) 195 { 196 if (!deriv (A, Variable (i)).isZero()) 197 break; 198 } 199 200 w= gcd (A, deriv (A, Variable (i))); 201 b= A/w; 202 result= b; 203 if (degree (w) < 1) 204 return M (result); 205 i++; 206 for (; i <= A.level(); i++) 207 { 208 if (!deriv (w, Variable (i)).isZero()) 209 { 210 b= w; 211 w= gcd (w, deriv (w, Variable (i))); 212 b /= w; 213 if (degree (b) < 1) 214 break; 215 CanonicalForm g= gcd (b, result); 216 if (degree (g) > 0) 217 result *= b/g; 218 if (degree (g) <= 0) 219 result *= b; 220 } 221 } 222 result= M (result); 223 return result; 224 } 225 -
factory/fac_sqrfree.h
r64e7cb r6f30b8 19 19 bool isSqrFreeZ ( const CanonicalForm & f ); 20 20 21 /// squarefree part of a poly 22 CanonicalForm sqrfPart (const CanonicalForm& F ///<[in] some poly 23 ); 24 21 25 #endif /* ! INCL_FAC_SQRFREE_H */
Note: See TracChangeset
for help on using the changeset viewer.