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

Function liftBoundAdaption

factory/facFqFactorize.cc:447–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445
446#if defined(HAVE_NTL) || defined(HAVE_FLINT)
447int
448liftBoundAdaption (const CanonicalForm& F, const CFList& factors, bool&
449 success, const int deg, const CFList& MOD, const int bound)
450{
451 int adaptedLiftBound= 0;
452 CanonicalForm buf= F;
453 Variable y= F.mvar();
454 Variable x= Variable (1);
455 CanonicalForm LCBuf= LC (buf, x);
456 CanonicalForm g, quot;
457 CFList M= MOD;
458 M.append (power (y, deg));
459 int d= bound;
460 int e= 0;
461 int nBuf;
462 for (CFListIterator i= factors; i.hasItem(); i++)
463 {
464 g= mulMod (i.getItem(), LCBuf, M);
465 g /= myContent (g);
466 if (fdivides (g, buf, quot))
467 {
468 nBuf= degree (g, y) + degree (LC (g, 1), y);
469 d -= nBuf;
470 e= tmax (e, nBuf);
471 buf= quot;
472 LCBuf= LC (buf, x);
473 }
474 }
475 adaptedLiftBound= d;
476
477 if (adaptedLiftBound < deg)
478 {
479 if (adaptedLiftBound < degree (F) + 1)
480 {
481 if (d == 1)
482 {
483 if (e + 1 > deg)
484 {
485 adaptedLiftBound= deg;
486 success= false;
487 }
488 else
489 {
490 success= true;
491 if (e + 1 < degree (F) + 1)
492 adaptedLiftBound= deg;
493 else
494 adaptedLiftBound= e + 1;
495 }
496 }
497 else
498 {
499 success= true;
500 adaptedLiftBound= deg;
501 }
502 }
503 else
504 {

Callers 1

henselLiftAndEarlyFunction · 0.85

Calls 11

VariableFunction · 0.85
LCFunction · 0.85
powerFunction · 0.85
mulModFunction · 0.85
myContentFunction · 0.85
fdividesFunction · 0.85
degreeFunction · 0.85
tmaxFunction · 0.85
mvarMethod · 0.80
hasItemMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected