| 418 | } |
| 419 | |
| 420 | static inline |
| 421 | Variable chooseExtension (const Variable & alpha) |
| 422 | { |
| 423 | int i, m; |
| 424 | // extension of F_p needed |
| 425 | if (alpha.level() == 1) |
| 426 | { |
| 427 | i= 1; |
| 428 | m= 2; |
| 429 | } //extension of F_p(alpha) |
| 430 | if (alpha.level() != 1) |
| 431 | { |
| 432 | i= 4; |
| 433 | m= degree (getMipo (alpha)); |
| 434 | } |
| 435 | #ifdef HAVE_FLINT |
| 436 | nmod_poly_t Irredpoly; |
| 437 | nmod_poly_init(Irredpoly,getCharacteristic()); |
| 438 | nmod_poly_randtest_monic_irreducible(Irredpoly, FLINTrandom, i*m+1); |
| 439 | CanonicalForm newMipo=convertnmod_poly_t2FacCF(Irredpoly,Variable(1)); |
| 440 | nmod_poly_clear(Irredpoly); |
| 441 | #else |
| 442 | if (fac_NTL_char != getCharacteristic()) |
| 443 | { |
| 444 | fac_NTL_char= getCharacteristic(); |
| 445 | zz_p::init (getCharacteristic()); |
| 446 | } |
| 447 | zz_pX NTLIrredpoly; |
| 448 | BuildIrred (NTLIrredpoly, i*m); |
| 449 | CanonicalForm newMipo= convertNTLzzpX2CF (NTLIrredpoly, Variable (1)); |
| 450 | #endif |
| 451 | return rootOf (newMipo); |
| 452 | } |
| 453 | |
| 454 | #if defined(HAVE_NTL) || defined(HAVE_FLINT) |
| 455 | CanonicalForm |
no test coverage detected