MCPcopy Create free account
hub / github.com/Singular/Singular / chooseExtension

Function chooseExtension

factory/cfModGcd.cc:420–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420static inline
421Variable 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)
455CanonicalForm

Callers 7

modGCDFqFunction · 0.70
modGCDFpFunction · 0.70
monicSparseInterpolFunction · 0.70
nonMonicSparseInterpolFunction · 0.70
sparseGCDFqFunction · 0.70
sparseGCDFpFunction · 0.70
extFactorizeFunction · 0.70

Calls 9

degreeFunction · 0.85
getMipoFunction · 0.85
getCharacteristicFunction · 0.85
convertnmod_poly_t2FacCFFunction · 0.85
VariableFunction · 0.85
initFunction · 0.85
convertNTLzzpX2CFFunction · 0.85
rootOfFunction · 0.85
levelMethod · 0.45

Tested by

no test coverage detected