findMinPoly
| 7657 | |
| 7658 | #ifdef HAVE_NTL // findMinPoly |
| 7659 | ExtensionInfo |
| 7660 | init4ext (const ExtensionInfo& info, const CanonicalForm& evaluation, |
| 7661 | int& degMipo |
| 7662 | ) |
| 7663 | { |
| 7664 | bool GF= (CFFactory::gettype() == GaloisFieldDomain); |
| 7665 | Variable alpha= info.getAlpha(); |
| 7666 | if (GF) |
| 7667 | { |
| 7668 | degMipo= getGFDegree(); |
| 7669 | CanonicalForm GFMipo= gf_mipo; |
| 7670 | setCharacteristic (getCharacteristic()); |
| 7671 | GFMipo.mapinto(); |
| 7672 | alpha= rootOf (GFMipo); |
| 7673 | setCharacteristic (getCharacteristic(), degMipo, info.getGFName()); |
| 7674 | } |
| 7675 | else |
| 7676 | { |
| 7677 | alpha= info.getAlpha(); |
| 7678 | degMipo= degree (getMipo (alpha)); |
| 7679 | } |
| 7680 | |
| 7681 | Variable gamma; |
| 7682 | CanonicalForm primElemAlpha, imPrimElemAlpha; |
| 7683 | if ((!GF && evaluation != alpha) || (GF && evaluation != getGFGenerator())) |
| 7684 | { |
| 7685 | CanonicalForm bufEvaluation; |
| 7686 | if (GF) |
| 7687 | { |
| 7688 | setCharacteristic (getCharacteristic()); |
| 7689 | bufEvaluation= GF2FalphaRep (evaluation, alpha); |
| 7690 | } |
| 7691 | else |
| 7692 | bufEvaluation= evaluation; |
| 7693 | CanonicalForm mipo= findMinPoly (bufEvaluation, alpha); |
| 7694 | gamma= rootOf (mipo); |
| 7695 | Variable V_buf; |
| 7696 | bool fail= false; |
| 7697 | primElemAlpha= primitiveElement (alpha, V_buf, fail); |
| 7698 | imPrimElemAlpha= map (primElemAlpha, alpha, bufEvaluation, gamma); |
| 7699 | |
| 7700 | if (GF) |
| 7701 | setCharacteristic (getCharacteristic(), degMipo, info.getGFName()); |
| 7702 | } |
| 7703 | else |
| 7704 | gamma= alpha; |
| 7705 | ExtensionInfo info2= ExtensionInfo (alpha, gamma, primElemAlpha, |
| 7706 | imPrimElemAlpha, 1, info.getGFName(), true |
| 7707 | ); |
| 7708 | |
| 7709 | return info2; |
| 7710 | } |
| 7711 | #endif |
| 7712 | |
| 7713 | #ifdef HAVE_NTL // extSieveSmallFactors,... |
no test coverage detected