| 511 | |
| 512 | #if defined(HAVE_NTL) || defined(HAVE_FLINT) |
| 513 | int |
| 514 | extLiftBoundAdaption (const CanonicalForm& F, const CFList& factors, bool& |
| 515 | success, const ExtensionInfo& info, const CFList& eval, |
| 516 | const int deg, const CFList& MOD, const int bound) |
| 517 | { |
| 518 | Variable alpha= info.getAlpha(); |
| 519 | Variable beta= info.getBeta(); |
| 520 | CanonicalForm gamma= info.getGamma(); |
| 521 | CanonicalForm delta= info.getDelta(); |
| 522 | int k= info.getGFDegree(); |
| 523 | int adaptedLiftBound= 0; |
| 524 | CanonicalForm buf= F; |
| 525 | Variable y= F.mvar(); |
| 526 | Variable x= Variable (1); |
| 527 | CanonicalForm LCBuf= LC (buf, x); |
| 528 | CanonicalForm g, gg, quot; |
| 529 | CFList M= MOD; |
| 530 | M.append (power (y, deg)); |
| 531 | adaptedLiftBound= 0; |
| 532 | int d= bound; |
| 533 | int e= 0; |
| 534 | int nBuf; |
| 535 | int degMipoBeta= 1; |
| 536 | if (!k && beta.level() != 1) |
| 537 | degMipoBeta= degree (getMipo (beta)); |
| 538 | |
| 539 | CFList source, dest; |
| 540 | for (CFListIterator i= factors; i.hasItem(); i++) |
| 541 | { |
| 542 | g= mulMod (i.getItem(), LCBuf, M); |
| 543 | g /= myContent (g); |
| 544 | if (fdivides (g, buf, quot)) |
| 545 | { |
| 546 | gg= reverseShift (g, eval); |
| 547 | gg /= Lc (gg); |
| 548 | if (!k && beta == x) |
| 549 | { |
| 550 | if (degree (gg, alpha) < degMipoBeta) |
| 551 | { |
| 552 | buf= quot; |
| 553 | nBuf= degree (g, y) + degree (LC (g, x), y); |
| 554 | d -= nBuf; |
| 555 | e= tmax (e, nBuf); |
| 556 | LCBuf= LC (buf, x); |
| 557 | } |
| 558 | } |
| 559 | else |
| 560 | { |
| 561 | if (!isInExtension (gg, gamma, k, delta, source, dest)) |
| 562 | { |
| 563 | buf= quot; |
| 564 | nBuf= degree (g, y) + degree (LC (g, x), y); |
| 565 | d -= nBuf; |
| 566 | e= tmax (e, nBuf); |
| 567 | LCBuf= LC (buf, x); |
| 568 | } |
| 569 | } |
| 570 | } |
no test coverage detected