| 260 | } |
| 261 | |
| 262 | CFAFList absFactorize (const CanonicalForm& G |
| 263 | ) |
| 264 | { |
| 265 | //TODO handle homogeneous input, is already done in LIB interface but still... |
| 266 | ASSERT (getCharacteristic() == 0, "expected poly over Q"); |
| 267 | |
| 268 | CanonicalForm F= G; |
| 269 | |
| 270 | CanonicalForm LcF= Lc (F); |
| 271 | bool isRat= isOn (SW_RATIONAL); |
| 272 | if (isRat) |
| 273 | F *= bCommonDen (F); |
| 274 | |
| 275 | Off (SW_RATIONAL); |
| 276 | F /= icontent (F); |
| 277 | if (isRat) |
| 278 | On (SW_RATIONAL); |
| 279 | |
| 280 | CFFList rationalFactors= factorize (F); |
| 281 | |
| 282 | CFAFList result, resultBuf; |
| 283 | |
| 284 | CFAFListIterator iter; |
| 285 | CFFListIterator i= rationalFactors; |
| 286 | i++; |
| 287 | for (; i.hasItem(); i++) |
| 288 | { |
| 289 | resultBuf= absFactorizeMain (i.getItem().factor()); |
| 290 | for (iter= resultBuf; iter.hasItem(); iter++) |
| 291 | iter.getItem()= CFAFactor (iter.getItem().factor(), |
| 292 | iter.getItem().minpoly(), i.getItem().exp()); |
| 293 | result= Union (result, resultBuf); |
| 294 | } |
| 295 | |
| 296 | if (isRat) |
| 297 | normalize (result); |
| 298 | result.insert (CFAFactor (LcF, 1, 1)); |
| 299 | |
| 300 | return result; |
| 301 | } |
| 302 | |
| 303 | CFAFList absFactorizeMain (const CanonicalForm& G) |
| 304 | { |
no test coverage detected