| 36 | TIMING_DEFINE_PRINT(fac_evalpoint) |
| 37 | |
| 38 | CFAFList uniAbsFactorize (const CanonicalForm& F, bool full) |
| 39 | { |
| 40 | CFAFList result; |
| 41 | if (degree (F) == 1) |
| 42 | { |
| 43 | bool isRat= isOn (SW_RATIONAL); |
| 44 | On (SW_RATIONAL); |
| 45 | result= CFAFList (CFAFactor (F/Lc(F), 1, 1)); |
| 46 | result.insert (CFAFactor (Lc (F), 1, 1)); |
| 47 | if (!isRat) |
| 48 | Off (SW_RATIONAL); |
| 49 | return result; |
| 50 | } |
| 51 | CanonicalForm LcF= 1; |
| 52 | Variable alpha; |
| 53 | CFFList QaFactors; |
| 54 | CFFListIterator iter; |
| 55 | alpha= rootOf (F); |
| 56 | QaFactors= factorize (F, alpha); |
| 57 | iter= QaFactors; |
| 58 | if (iter.getItem().factor().inCoeffDomain()) |
| 59 | { |
| 60 | LcF = iter.getItem().factor(); |
| 61 | iter++; |
| 62 | } |
| 63 | for (;iter.hasItem(); iter++) |
| 64 | { |
| 65 | if (full) |
| 66 | result.append (CFAFactor (iter.getItem().factor(), getMipo (alpha), |
| 67 | iter.getItem().exp())); |
| 68 | if (!full && degree (iter.getItem().factor()) == 1) |
| 69 | { |
| 70 | result.append (CFAFactor (iter.getItem().factor(), getMipo (alpha), |
| 71 | iter.getItem().exp())); |
| 72 | break; |
| 73 | } |
| 74 | } |
| 75 | result.insert (CFAFactor (LcF, 1, 1)); |
| 76 | return result; |
| 77 | } |
| 78 | |
| 79 | //TODO optimize choice of p -> choose p as large as possible (better than small p since factorization mod p does not require field extension, also less lifting) |
| 80 | int |