Changeset 2537fa0 in git for factory/facFqBivar.cc
 Timestamp:
 Mar 19, 2013, 2:31:03 PM (10 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
 Children:
 2d35fe77fb45655052d739f5e90e572b52fe709f
 Parents:
 5e4636810908842f714d87ac378a9aa9c48ec33f
 gitauthor:
 Martin Lee <martinlee84@web.de>20130319 14:31:03+01:00
 gitcommitter:
 Martin Lee <martinlee84@web.de>20130322 15:53:08+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/facFqBivar.cc
r5e4636 r2537fa0 481 481 CFList 482 482 factorRecombination (CFList& factors, CanonicalForm& F, 483 const CanonicalForm& N, DegreePattern& degs, int s, 484 int thres, const modpk& b, const CanonicalForm& den 483 const CanonicalForm& N, DegreePattern& degs, const 484 CanonicalForm& eval, int s, int thres, const modpk& b, 485 const CanonicalForm& den 485 486 ) 486 487 { … … 492 493 if (F.inCoeffDomain()) 493 494 return CFList(); 495 Variable y= Variable (2); 494 496 if (degs.getLength() <= 1  factors.length() == 1) 495 497 { 496 CFList result= CFList (F );498 CFList result= CFList (F(yeval,y)); 497 499 F= 1; 498 500 return result; … … 513 515 T= factors; 514 516 CFList result; 515 Variable y= Variable (2);516 517 Variable x= Variable (1); 517 518 CanonicalForm denom= den, denQuot; … … 550 551 g= b(g); 551 552 T.removeFirst(); 552 result.append (g/content (g, x)); 553 g /= content (g,x); 554 result.append (g(yeval,y)); 553 555 F= 1; 554 556 return result; … … 556 558 else 557 559 { 558 result= CFList (F );560 result= CFList (F(yeval,y)); 559 561 F= 1; 560 562 return result; … … 610 612 denom *= abs (lc (g)); 611 613 recombination= true; 612 result.append (g );614 result.append (g (yeval,y)); 613 615 if (b.getp() != 0) 614 616 { … … 638 640 if (recombination) 639 641 { 640 result.append (buf );642 result.append (buf (yeval,y)); 641 643 F= 1; 642 644 return result; … … 644 646 else 645 647 { 646 result= CFList (F );648 result= CFList (F (yeval,y)); 647 649 F= 1; 648 650 return result; … … 664 666 if (recombination) 665 667 { 666 result.append (buf );668 result.append (buf(yeval,y)); 667 669 F= 1; 668 670 return result; … … 670 672 else 671 673 { 672 result= CFList (F );674 result= CFList (F(yeval,y)); 673 675 F= 1; 674 676 return result; … … 682 684 if (T.length() < 2*s) 683 685 { 684 result.append (F );686 result.append (F(yeval,y)); 685 687 F= 1; 686 688 return result; … … 735 737 earlyFactorDetection (CFList& reconstructedFactors, CanonicalForm& F, CFList& 736 738 factors, int& adaptedLiftBound, int*& factorsFoundIndex, 737 DegreePattern& degs, bool& success, int deg, 738 const modpk& b, CanonicalForm& den)739 DegreePattern& degs, bool& success, int deg, const 740 CanonicalForm& eval, const modpk& b, CanonicalForm& den) 739 741 { 740 742 DegreePattern bufDegs1= degs; … … 743 745 CanonicalForm buf= F; 744 746 Variable x= Variable (1); 747 Variable y= Variable (2); 745 748 CanonicalForm g, quot; 746 749 CanonicalForm M= power (F.mvar(), deg); … … 798 801 { 799 802 den *= abs (lc (g)); 800 reconstructedFactors.append (g );803 reconstructedFactors.append (g (yeval,y)); 801 804 factorsFoundIndex[l]= 1; 802 805 if (b.getp() != 0) … … 827 830 if (!buf.inCoeffDomain()) 828 831 { 829 reconstructedFactors.append (buf );832 reconstructedFactors.append (buf (yeval,y)); 830 833 F= 1; 831 834 } … … 852 855 earlyFactorDetection (CFList& reconstructedFactors, CanonicalForm& F, CFList& 853 856 factors, int& adaptedLiftBound, int*& factorsFoundIndex, 854 DegreePattern& degs, bool& success, int deg, 855 const modpk& b)857 DegreePattern& degs, bool& success, int deg, const 858 CanonicalForm& eval, const modpk& b) 856 859 { 857 860 CanonicalForm den= 1; 858 earlyFactorDetection (reconstructedFactors, F, factors, adaptedLiftBound, factorsFoundIndex, degs, success, deg,b, den); 861 earlyFactorDetection (reconstructedFactors, F, factors, adaptedLiftBound, 862 factorsFoundIndex, degs, success, deg, eval, b, den); 859 863 } 860 864 … … 1127 1131 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1128 1132 factorsFoundIndex, degs, earlySuccess, 1129 smallFactorDeg, b, den);1133 smallFactorDeg, eval, b, den); 1130 1134 else 1131 1135 earlyFactorDetection(earlyFactors, bufA, bufBufUniFactors, newLiftBound, 1132 1136 factorsFoundIndex, degs, earlySuccess, 1133 smallFactorDeg, b, den);1137 smallFactorDeg, eval, b, den); 1134 1138 } 1135 1139 else … … 1156 1160 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1157 1161 factorsFoundIndex, degs, earlySuccess, 1158 liftPre[sizeOfLiftPre1] + 1, b, den);1162 liftPre[sizeOfLiftPre1] + 1, eval, b, den); 1159 1163 else 1160 1164 earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound, 1161 1165 factorsFoundIndex, degs, earlySuccess, 1162 liftPre[sizeOfLiftPre1] + 1, b, den);1166 liftPre[sizeOfLiftPre1] + 1, eval, b, den); 1163 1167 } 1164 1168 else … … 1190 1194 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1191 1195 factorsFoundIndex, degs, earlySuccess, 1192 liftPre[i1] + 1, b, den);1196 liftPre[i1] + 1, eval, b, den); 1193 1197 else 1194 1198 earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound, 1195 1199 factorsFoundIndex, degs, earlySuccess, 1196 liftPre[i1] + 1, b, den);1200 liftPre[i1] + 1, eval, b, den); 1197 1201 } 1198 1202 else … … 1233 1237 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1234 1238 factorsFoundIndex, degs, earlySuccess, 1235 smallFactorDeg, b, den);1239 smallFactorDeg, eval, b, den); 1236 1240 else 1237 1241 earlyFactorDetection (earlyFactors, bufA, bufBufUniFactors, newLiftBound, 1238 1242 factorsFoundIndex, degs, earlySuccess, 1239 smallFactorDeg, b, den);1243 smallFactorDeg, eval, b, den); 1240 1244 } 1241 1245 else … … 1262 1266 if (v==alpha) 1263 1267 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1264 factorsFoundIndex, degs, earlySuccess, dummy, b,1265 den);1268 factorsFoundIndex, degs, earlySuccess, dummy,eval, 1269 b, den); 1266 1270 else 1267 1271 earlyFactorDetection (earlyFactors, bufA,bufBufUniFactors, newLiftBound, 1268 factorsFoundIndex, degs, earlySuccess, dummy, b,1269 den);1272 factorsFoundIndex, degs, earlySuccess, dummy,eval, 1273 b, den); 1270 1274 } 1271 1275 else … … 1292 1296 if (v==alpha) 1293 1297 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1294 factorsFoundIndex, degs, earlySuccess, dummy, b,1295 den);1298 factorsFoundIndex, degs, earlySuccess, dummy, 1299 eval, b, den); 1296 1300 else 1297 1301 earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound, 1298 factorsFoundIndex, degs, earlySuccess, dummy, b,1299 den);1302 factorsFoundIndex, degs, earlySuccess, dummy, 1303 eval, b, den); 1300 1304 } 1301 1305 else … … 1471 1475 reconstructionTry (CFList& reconstructedFactors, CanonicalForm& F, const CFList& 1472 1476 factors, const int liftBound, int& factorsFound, int*& 1473 factorsFoundIndex, mat_zz_pE& N, bool beenInThres 1477 factorsFoundIndex, mat_zz_pE& N, const CanonicalForm& eval, 1478 bool beenInThres 1474 1479 ) 1475 1480 { … … 1477 1482 Variable x= Variable (1); 1478 1483 CanonicalForm yToL= power (y, liftBound); 1484 CanonicalForm bufF= F (yeval, y); 1479 1485 if (factors.length() == 2) 1480 1486 { … … 1484 1490 tmp1= mulMod2 (tmp1, LC (F,x), yToL); 1485 1491 tmp1 /= content (tmp1, x); 1492 tmp1= tmp1 (yeval, y); 1486 1493 tmp2= mulMod2 (tmp2, LC (F,x), yToL); 1487 1494 tmp2 /= content (tmp2, x); 1495 tmp2= tmp2 (yeval, y); 1488 1496 tmp3 = tmp1*tmp2; 1489 if (tmp3/Lc (tmp3) == F/Lc (F))1497 if (tmp3/Lc (tmp3) == bufF/Lc (bufF)) 1490 1498 { 1491 1499 factorsFound++; … … 1524 1532 buf= mulMod2 (buf, LC (F,x), yToL); 1525 1533 buf /= content (buf, x); 1526 if (fdivides (buf, F, quot)) 1534 buf= buf (yeval,y); 1535 if (fdivides (buf, bufF, quot)) 1527 1536 { 1528 1537 factorsFoundIndex[i  1]= 1; 1529 1538 factorsFound++; 1530 F= quot;1531 F /= Lc (F);1539 bufF= quot; 1540 bufF /= Lc (bufF); 1532 1541 reconstructedFactors.append (buf); 1533 1542 } 1534 if (degree ( F) <= 0)1543 if (degree (bufF) <= 0) 1535 1544 return; 1536 1545 if (factorsFound + 1 == N.NumCols()) 1537 1546 { 1538 reconstructedFactors.append (F); 1547 reconstructedFactors.append (bufF); 1548 F= 1; 1539 1549 return; 1540 1550 } 1541 1551 } 1552 if (reconstructedFactors.length() != 0) 1553 F= bufF (y+eval,y); 1542 1554 } 1543 1555 … … 1545 1557 reconstructionTry (CFList& reconstructedFactors, CanonicalForm& F, const CFList& 1546 1558 factors, const int liftBound, int& factorsFound, int*& 1547 factorsFoundIndex, mat_zz_p& N, bool beenInThres 1559 factorsFoundIndex, mat_zz_p& N, const CanonicalForm& eval, 1560 bool beenInThres 1548 1561 ) 1549 1562 { … … 1551 1564 Variable x= Variable (1); 1552 1565 CanonicalForm yToL= power (y, liftBound); 1566 CanonicalForm bufF= F (yeval, y); 1553 1567 if (factors.length() == 2) 1554 1568 { … … 1558 1572 tmp1= mulMod2 (tmp1, LC (F,x), yToL); 1559 1573 tmp1 /= content (tmp1, x); 1574 tmp1= tmp1 (yeval, y); 1560 1575 tmp2= mulMod2 (tmp2, LC (F,x), yToL); 1561 1576 tmp2 /= content (tmp2, x); 1577 tmp2= tmp2 (yeval,y); 1562 1578 tmp3 = tmp1*tmp2; 1563 if (tmp3/Lc (tmp3) == F/Lc (F))1579 if (tmp3/Lc (tmp3) == bufF/Lc (bufF)) 1564 1580 { 1565 1581 factorsFound++; … … 1598 1614 buf= mulMod2 (buf, LC (F,x), yToL); 1599 1615 buf /= content (buf, x); 1600 if (fdivides (buf, F, quot)) 1616 buf= buf (yeval,y); 1617 if (fdivides (buf, bufF, quot)) 1601 1618 { 1602 1619 factorsFoundIndex[i  1]= 1; 1603 1620 factorsFound++; 1604 F= quot;1605 F /= Lc (F);1621 bufF= quot; 1622 bufF /= Lc (bufF); 1606 1623 reconstructedFactors.append (buf); 1607 1624 } 1608 if (degree ( F) <= 0)1625 if (degree (bufF) <= 0) 1609 1626 return; 1610 1627 if (factorsFound + 1 == N.NumCols()) 1611 1628 { 1612 reconstructedFactors.append (F); 1629 reconstructedFactors.append (bufF); 1630 F=1; 1613 1631 return; 1614 1632 } 1615 1633 } 1634 if (reconstructedFactors.length() != 0) 1635 F= bufF (y+eval,y); 1616 1636 } 1617 1637 … … 1620 1640 reconstructionTry (CFList& reconstructedFactors, CanonicalForm& F, const CFList& 1621 1641 factors, const int liftBound, int& factorsFound, int*& 1622 factorsFoundIndex, nmod_mat_t N, bool beenInThres 1642 factorsFoundIndex, nmod_mat_t N, const CanonicalForm& eval, 1643 bool beenInThres 1623 1644 ) 1624 1645 { … … 1626 1647 Variable x= Variable (1); 1627 1648 CanonicalForm yToL= power (y, liftBound); 1649 CanonicalForm bufF= F (yeval, y); 1628 1650 if (factors.length() == 2) 1629 1651 { … … 1633 1655 tmp1= mulMod2 (tmp1, LC (F,x), yToL); 1634 1656 tmp1 /= content (tmp1, x); 1657 tmp1= tmp1 (yeval, y); 1635 1658 tmp2= mulMod2 (tmp2, LC (F,x), yToL); 1636 1659 tmp2 /= content (tmp2, x); 1660 tmp2= tmp2 (yeval, y); 1637 1661 tmp3 = tmp1*tmp2; 1638 if (tmp3/Lc (tmp3) == F/Lc (F))1662 if (tmp3/Lc (tmp3) == bufF/Lc (bufF)) 1639 1663 { 1640 1664 factorsFound++; … … 1673 1697 buf= mulMod2 (buf, LC (F,x), yToL); 1674 1698 buf /= content (buf, x); 1675 if (fdivides (buf, F, quot)) 1699 buf= buf (yeval,y); 1700 if (fdivides (buf, bufF, quot)) 1676 1701 { 1677 1702 factorsFoundIndex[i]= 1; 1678 1703 factorsFound++; 1679 F= quot;1680 F /= Lc (F);1704 bufF= quot; 1705 bufF /= Lc (bufF); 1681 1706 reconstructedFactors.append (buf); 1682 1707 } … … 1685 1710 if (factorsFound + 1 == nmod_mat_ncols (N)) 1686 1711 { 1687 reconstructedFactors.append (F); 1712 F= 1; 1713 reconstructedFactors.append (bufF); 1688 1714 return; 1689 1715 } 1690 1716 } 1717 if (reconstructedFactors.length() != 0) 1718 F= bufF (y+eval,y); 1691 1719 } 1692 1720 #endif … … 1694 1722 CFList 1695 1723 reconstruction (CanonicalForm& G, CFList& factors, int* zeroOneVecs, int 1696 precision, const mat_zz_pE& N 1724 precision, const mat_zz_pE& N, const CanonicalForm& eval 1697 1725 ) 1698 1726 { … … 1726 1754 F= quot; 1727 1755 F /= Lc (F); 1728 result.append (buf );1756 result.append (buf (yeval,y)); 1729 1757 bufFactors= Difference (bufFactors, factorsConsidered); 1730 1758 } … … 1954 1982 CFList 1955 1983 reconstruction (CanonicalForm& G, CFList& factors, int* zeroOneVecs, 1956 int precision, const mat_zz_p& N )1984 int precision, const mat_zz_p& N, const CanonicalForm& eval) 1957 1985 { 1958 1986 Variable y= Variable (2); … … 1986 2014 F= quot; 1987 2015 F /= Lc (F); 1988 result.append (buf );2016 result.append (buf (yeval,y)); 1989 2017 bufFactors= Difference (bufFactors, factorsConsidered); 1990 2018 } … … 2004 2032 CFList 2005 2033 reconstruction (CanonicalForm& G, CFList& factors, int* zeroOneVecs, 2006 int precision, const nmod_mat_t N )2034 int precision, const nmod_mat_t N, const CanonicalForm& eval) 2007 2035 { 2008 2036 Variable y= Variable (2); … … 2036 2064 F= quot; 2037 2065 F /= Lc (F); 2038 result.append (buf );2066 result.append (buf (yeval,y)); 2039 2067 bufFactors= Difference (bufFactors, factorsConsidered); 2040 2068 } … … 3255 3283 CFList 3256 3284 increasePrecision (CanonicalForm& F, CFList& factors, int factorsFound, 3257 int oldNumCols, int oldL, int precision 3285 int oldNumCols, int oldL, int precision, 3286 const CanonicalForm& eval 3258 3287 ) 3259 3288 { … … 3261 3290 bool isIrreducible= false; 3262 3291 int* bounds= computeBounds (F, d, isIrreducible); 3292 Variable y= F.mvar(); 3263 3293 if (isIrreducible) 3264 3294 { … … 3266 3296 CanonicalForm G= F; 3267 3297 F= 1; 3268 return CFList (G );3298 return CFList (G (yeval, y)); 3269 3299 } 3270 3300 CFArray * A= new CFArray [factors.length()]; … … 3299 3329 mat_zz_p* NTLC, NTLK; 3300 3330 #endif 3301 Variable y= F.mvar();3302 3331 CanonicalForm truncF; 3303 3332 while (l <= precision) … … 3372 3401 CanonicalForm G= F; 3373 3402 F= 1; 3374 return CFList (G );3403 return CFList (G (yeval,y)); 3375 3404 } 3376 3405 } … … 3398 3427 #ifdef HAVE_FLINT 3399 3428 reconstructionTry (result, bufF, factors, degree (F) + 1, factorsFound2, 3400 factorsFoundIndex, FLINTN, false3429 factorsFoundIndex, FLINTN, eval, false 3401 3430 ); 3402 3431 if (result.length() == nmod_mat_ncols (FLINTN)) … … 3405 3434 #else 3406 3435 reconstructionTry (result, bufF, factors, degree (F) + 1, factorsFound2, 3407 factorsFoundIndex, NTLN, false3436 factorsFoundIndex, NTLN, eval, false 3408 3437 ); 3409 3438 if (result.length() == NTLN.NumCols()) … … 3423 3452 #ifdef HAVE_FLINT 3424 3453 int * zeroOne= extractZeroOneVecs (FLINTN); 3425 CFList result= reconstruction (bufF,factors,zeroOne,precision,FLINTN );3454 CFList result= reconstruction (bufF,factors,zeroOne,precision,FLINTN, eval); 3426 3455 nmod_mat_clear (FLINTN); 3427 3456 #else 3428 3457 int * zeroOne= extractZeroOneVecs (NTLN); 3429 CFList result= reconstruction (bufF, factors, zeroOne, precision, NTLN );3458 CFList result= reconstruction (bufF, factors, zeroOne, precision, NTLN, eval); 3430 3459 #endif 3431 3460 F= bufF; … … 3461 3490 increasePrecision (CanonicalForm& F, CFList& factors, int factorsFound, 3462 3491 int oldNumCols, int oldL, const Variable&, 3463 int precision 3492 int precision, const CanonicalForm& eval 3464 3493 ) 3465 3494 { 3466 3495 int d; 3467 3496 bool isIrreducible= false; 3497 Variable y= F.mvar(); 3468 3498 int* bounds= computeBounds (F, d, isIrreducible); 3469 3499 if (isIrreducible) … … 3472 3502 CanonicalForm G= F; 3473 3503 F= 1; 3474 return CFList (G );3504 return CFList (G (yeval,y)); 3475 3505 } 3476 3506 CFArray * A= new CFArray [factors.length()]; … … 3493 3523 mat_zz_pE* NTLC, NTLK; 3494 3524 CFArray buf; 3495 Variable y= F.mvar();3496 3525 CanonicalForm truncF; 3497 3526 while (l <= precision) … … 3538 3567 CanonicalForm G= F; 3539 3568 F= 1; 3540 return CFList (G );3569 return CFList (G (yeval,y)); 3541 3570 } 3542 3571 } … … 3554 3583 CanonicalForm bufF= F; 3555 3584 reconstructionTry (result, bufF, factors, degree (F) + 1, factorsFound2, 3556 factorsFoundIndex, NTLN, false);3585 factorsFoundIndex, NTLN, eval, false); 3557 3586 if (result.length() == NTLN.NumCols()) 3558 3587 { … … 3569 3598 CanonicalForm bufF= F; 3570 3599 int * zeroOne= extractZeroOneVecs (NTLN); 3571 CFList result= reconstruction (bufF, factors, zeroOne, precision, NTLN );3600 CFList result= reconstruction (bufF, factors, zeroOne, precision, NTLN, eval); 3572 3601 F= bufF; 3573 3602 delete [] zeroOne; … … 3937 3966 increasePrecisionFq2Fp (CanonicalForm& F, CFList& factors, int factorsFound, 3938 3967 int oldNumCols, int oldL, const Variable& alpha, 3939 int precision 3968 int precision, const CanonicalForm& eval 3940 3969 ) 3941 3970 { 3942 3971 int d; 3943 3972 bool isIrreducible= false; 3973 Variable y= F.mvar(); 3944 3974 int* bounds= computeBounds (F, d, isIrreducible); 3945 3975 if (isIrreducible) … … 3948 3978 CanonicalForm G= F; 3949 3979 F= 1; 3950 return CFList (G );3980 return CFList (G (yeval,y)); 3951 3981 } 3952 3982 int extensionDeg= degree (getMipo (alpha)); … … 3982 4012 #endif 3983 4013 CFArray buf; 3984 Variable y= F.mvar();3985 4014 CanonicalForm truncF; 3986 4015 while (l <= precision) … … 4055 4084 CanonicalForm G= F; 4056 4085 F= 1; 4057 return CFList (G );4086 return CFList (G (yeval,y)); 4058 4087 } 4059 4088 } … … 4081 4110 #ifdef HAVE_FLINT 4082 4111 reconstructionTry (result, bufF, factors, degree (F) + 1, factorsFound2, 4083 factorsFoundIndex, FLINTN, false4112 factorsFoundIndex, FLINTN, eval, false 4084 4113 ); 4085 4114 if (result.length() == nmod_mat_ncols (FLINTN)) … … 4088 4117 #else 4089 4118 reconstructionTry (result, bufF, factors, degree (F) + 1, factorsFound2, 4090 factorsFoundIndex, NTLN, false4119 factorsFoundIndex, NTLN, eval, false 4091 4120 ); 4092 4121 if (result.length() == NTLN.NumCols()) … … 4106 4135 #ifdef HAVE_FLINT 4107 4136 int * zeroOne= extractZeroOneVecs (FLINTN); 4108 CFList result= reconstruction (bufF,factors,zeroOne,precision,FLINTN );4137 CFList result= reconstruction (bufF,factors,zeroOne,precision,FLINTN, eval); 4109 4138 nmod_mat_clear (FLINTN); 4110 4139 #else 4111 4140 int * zeroOne= extractZeroOneVecs (NTLN); 4112 CFList result= reconstruction (bufF, factors, zeroOne, precision, NTLN );4141 CFList result= reconstruction (bufF, factors, zeroOne, precision, NTLN, eval); 4113 4142 #endif 4114 4143 F= bufF; … … 4144 4173 CFList 4145 4174 increasePrecision (CanonicalForm& F, CFList& factors, int oldL, int 4146 l, int d, int* bounds, CFArray& bufQ, nmod_mat_t FLINTN 4175 l, int d, int* bounds, CFArray& bufQ, nmod_mat_t FLINTN, 4176 const CanonicalForm& eval 4147 4177 ) 4148 4178 #else 4149 4179 CFList 4150 4180 increasePrecision (CanonicalForm& F, CFList& factors, int oldL, int 4151 l, int d, int* bounds, CFArray& bufQ, mat_zz_p& NTLN 4181 l, int d, int* bounds, CFArray& bufQ, mat_zz_p& NTLN, 4182 const CanonicalForm& eval 4152 4183 ) 4153 4184 #endif … … 4253 4284 { 4254 4285 delete [] A; 4255 return CFList (F );4286 return CFList (F (yeval,y)); 4256 4287 } 4257 4288 } … … 4264 4295 { 4265 4296 delete [] A; 4266 return CFList (F );4297 return CFList (F (yeval,y)); 4267 4298 } 4268 4299 int * zeroOneVecs; … … 4275 4306 bufUniFactors= factors; 4276 4307 #ifdef HAVE_FLINT 4277 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, FLINTN );4278 #else 4279 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, NTLN );4308 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, FLINTN, eval); 4309 #else 4310 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, NTLN, eval); 4280 4311 #endif 4281 4312 delete [] zeroOneVecs; … … 4308 4339 CFList 4309 4340 increasePrecision (CanonicalForm& F, CFList& factors, int oldL, int 4310 l, int d, int* bounds, CFArray& bufQ, mat_zz_pE& NTLN 4341 l, int d, int* bounds, CFArray& bufQ, mat_zz_pE& NTLN, 4342 const CanonicalForm& eval 4311 4343 ) 4312 4344 { … … 4366 4398 { 4367 4399 delete [] A; 4368 return CFList (F );4400 return CFList (F (yeval,y)); 4369 4401 } 4370 4402 } … … 4373 4405 { 4374 4406 delete [] A; 4375 return CFList (F );4407 return CFList (F (yeval,y)); 4376 4408 } 4377 4409 … … 4380 4412 bufF= F; 4381 4413 bufUniFactors= factors; 4382 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, NTLN );4414 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, NTLN, eval); 4383 4415 delete [] zeroOneVecs; 4384 4416 if (degree (bufF) + 1 + degree (LC (bufF, 1)) < l && result.length() > 0) … … 4583 4615 increasePrecisionFq2Fp (CanonicalForm& F, CFList& factors, int oldL, int l, 4584 4616 int d, int* bounds, CFArray& bufQ, nmod_mat_t FLINTN, 4585 const Variable& alpha 4617 const Variable& alpha, const CanonicalForm& eval 4586 4618 ) 4587 4619 #else … … 4589 4621 increasePrecisionFq2Fp (CanonicalForm& F, CFList& factors, int oldL, int l, 4590 4622 int d, int* bounds, CFArray& bufQ, mat_zz_p& NTLN, 4591 const Variable& alpha 4623 const Variable& alpha, const CanonicalForm& eval 4592 4624 ) 4593 4625 #endif … … 4690 4722 { 4691 4723 delete [] A; 4692 return CFList (F );4724 return CFList (F(yeval,y)); 4693 4725 } 4694 4726 } … … 4705 4737 bufUniFactors= factors; 4706 4738 #ifdef HAVE_FLINT 4707 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, FLINTN );4708 #else 4709 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, NTLN );4739 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, FLINTN, eval); 4740 #else 4741 result= reconstruction (bufF, bufUniFactors, zeroOneVecs, oldL, NTLN, eval); 4710 4742 #endif 4711 4743 delete [] zeroOneVecs; … … 4741 4773 factors, int l, int liftBound, int d, int* 4742 4774 bounds, nmod_mat_t FLINTN, CFList& diophant, 4743 CFMatrix& M, CFArray& Pi, CFArray& bufQ 4775 CFMatrix& M, CFArray& Pi, CFArray& bufQ, 4776 const CanonicalForm& eval 4744 4777 ) 4745 4778 #else … … 4748 4781 factors, int l, int liftBound, int d, int* 4749 4782 bounds, mat_zz_p& NTLN, CFList& diophant, 4750 CFMatrix& M, CFArray& Pi, CFArray& bufQ 4783 CFMatrix& M, CFArray& Pi, CFArray& bufQ, 4784 const CanonicalForm& eval 4751 4785 ) 4752 4786 #endif … … 4875 4909 bufF= F; 4876 4910 #ifdef HAVE_FLINT 4877 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, FLINTN );4878 #else 4879 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, NTLN );4911 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, FLINTN, eval); 4912 #else 4913 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, NTLN, eval); 4880 4914 #endif 4881 4915 delete [] zeroOneVecs; … … 4907 4941 if (l < liftBound) 4908 4942 reconstructionTry (result, bufF, bufFactors, l, factorsFound, 4909 factorsFoundIndex, FLINTN, false4943 factorsFoundIndex, FLINTN, eval, false 4910 4944 ); 4911 4945 else 4912 4946 reconstructionTry (result, bufF, bufFactors, degree (bufF) + 1 + 4913 4947 degree (LCF), factorsFound, factorsFoundIndex, 4914 FLINTN, false4948 FLINTN, eval, false 4915 4949 ); 4916 4950 … … 4919 4953 if (l < liftBound) 4920 4954 reconstructionTry (result, bufF, bufFactors, l, factorsFound, 4921 factorsFoundIndex, NTLN, false4955 factorsFoundIndex, NTLN, eval, false 4922 4956 ); 4923 4957 else 4924 4958 reconstructionTry (result, bufF, bufFactors, degree (bufF) + 1 + 4925 4959 degree (LCF), factorsFound, factorsFoundIndex, 4926 NTLN, false4960 NTLN, eval, false 4927 4961 ); 4928 4962 … … 4954 4988 { 4955 4989 delete [] A; 4956 return CFList (F );4990 return CFList (F (yeval,y)); 4957 4991 } 4958 4992 delete [] A; … … 4966 5000 factors, int l, int liftBound, int d, int* 4967 5001 bounds, mat_zz_pE& NTLN, CFList& diophant, 4968 CFMatrix& M, CFArray& Pi, CFArray& bufQ 5002 CFMatrix& M, CFArray& Pi, CFArray& bufQ, 5003 const CanonicalForm& eval 4969 5004 ) 4970 5005 { … … 5038 5073 int * zeroOneVecs= extractZeroOneVecs (NTLN); 5039 5074 bufF= F; 5040 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, NTLN );5075 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, NTLN, eval); 5041 5076 delete [] zeroOneVecs; 5042 5077 if (result.length() > 0 && degree (bufF) + 1 + degree (LC (bufF, 1)) <= l) … … 5057 5092 if (l < liftBound) 5058 5093 reconstructionTry (result, bufF, bufFactors, l, factorsFound, 5059 factorsFoundIndex, NTLN, false5094 factorsFoundIndex, NTLN, eval, false 5060 5095 ); 5061 5096 else 5062 5097 reconstructionTry (result, bufF, bufFactors, degree (bufF) + 1 + 5063 5098 degree (LCF), factorsFound, factorsFoundIndex, 5064 NTLN, false5099 NTLN, eval, false 5065 5100 ); 5066 5101 if (NTLN.NumCols() == result.length()) … … 5090 5125 { 5091 5126 delete [] A; 5092 return CFList (F );5127 return CFList (F (yeval,y)); 5093 5128 } 5094 5129 delete [] A; … … 5306 5341 nmod_mat_t FLINTN, CFList& diophant, 5307 5342 CFMatrix& M, CFArray& Pi, CFArray& bufQ, 5308 const Variable& alpha 5343 const Variable& alpha, 5344 const CanonicalForm& eval 5309 5345 ) 5310 5346 #else … … 5314 5350 mat_zz_p& NTLN, CFList& diophant, 5315 5351 CFMatrix& M, CFArray& Pi, CFArray& bufQ, 5316 const Variable& alpha 5352 const Variable& alpha, 5353 const CanonicalForm& eval 5317 5354 ) 5318 5355 #endif … … 5439 5476 CanonicalForm bufF= F; 5440 5477 #ifdef HAVE_FLINT 5441 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, FLINTN );5442 #else 5443 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, NTLN );5478 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, FLINTN, eval); 5479 #else 5480 result= reconstruction (bufF, bufFactors, zeroOneVecs, l, NTLN, eval); 5444 5481 #endif 5445 5482 delete [] zeroOneVecs; … … 5471 5508 if (l < degree (bufF) + 1 + degree (LCF)) 5472 5509 reconstructionTry (result, bufF, bufFactors, l, factorsFound, 5473 factorsFoundIndex, FLINTN, false5510 factorsFoundIndex, FLINTN, eval, false 5474 5511 ); 5475 5512 else 5476 5513 reconstructionTry (result, bufF, bufFactors, degree (bufF) + 1 + 5477 5514 degree (LCF), factorsFound, factorsFoundIndex, 5478 FLINTN, false5515 FLINTN, eval, false 5479 5516 ); 5480 5517 if (nmod_mat_ncols (FLINTN) == result.length()) … … 5482 5519 if (l < degree (bufF) + 1 + degree (LCF)) 5483 5520 reconstructionTry (result, bufF, bufFactors, l, factorsFound, 5484 factorsFoundIndex, NTLN, false5521 factorsFoundIndex, NTLN, eval, false 5485 5522 ); 5486 5523 else 5487 5524 reconstructionTry (result, bufF, bufFactors, degree (bufF) + 1 + 5488 5525 degree (LCF), factorsFound, factorsFoundIndex, 5489 NTLN, false5526 NTLN, eval, false 5490 5527 ); 5491 5528 if (NTLN.NumCols() == result.length()) … … 5516 5553 { 5517 5554 delete [] A; 5518 return CFList (F );5555 return CFList (F (yeval,y)); 5519 5556 } 5520 5557 delete [] A; … … 5663 5700 #ifdef HAVE_FLINT 5664 5701 reconstructionTry (result, bufF, factors, smallFactorDeg, factorsFound, 5665 factorsFoundIndex, FLINTN, beenInThres5702 factorsFoundIndex, FLINTN, evaluation, beenInThres 5666 5703 ); 5667 5704 if (result.length() == nmod_mat_ncols (FLINTN)) … … 5670 5707 #else 5671 5708 reconstructionTry (result, bufF, factors, smallFactorDeg, factorsFound, 5672 factorsFoundIndex, NTLN, beenInThres5709 factorsFoundIndex, NTLN, evaluation, beenInThres 5673 5710 ); 5674 5711 if (result.length() == NTLN.NumCols()) … … 5701 5738 #ifdef HAVE_FLINT 5702 5739 reconstructionTry (result, bufF, factors, l, factorsFound, 5703 factorsFoundIndex, FLINTN, beenInThres5740 factorsFoundIndex, FLINTN, evaluation, beenInThres 5704 5741 ); 5705 5742 if (result.length() == nmod_mat_ncols (FLINTN)) … … 5708 5745 #else 5709 5746 reconstructionTry (result, bufF, factors, l, factorsFound, 5710 factorsFoundIndex, NTLN, beenInThres5747 factorsFoundIndex, NTLN, evaluation, beenInThres 5711 5748 ); 5712 5749 if (result.length() == NTLN.NumCols()) … … 5728 5765 { 5729 5766 dummy= tmin (degree (F,y)+1, ((degree (F,y)/4)+1)*i+4); 5767 if (l < dummy) 5768 { 5769 factors.insert (LCF); 5770 henselLiftResume12 (F, factors, l, dummy, Pi, diophant, M); 5771 l= dummy; 5772 if (i == 1 && degree (F)%4==0 && symmetric && factors.length() == 2 && 5773 LC (F,1).inCoeffDomain() && 5774 (degree (factors.getFirst(), 1) == degree (factors.getLast(),1))) 5775 { 5776 Variable x= Variable (1); 5777 CanonicalForm g, h, gg, hh, multiplier1, multiplier2, check1, check2; 5778 int m= degree (F)/4+1; 5779 g= factors.getFirst(); 5780 h= factors.getLast(); 5781 g= mod (g, power (y,m)); 5782 h= mod (h, power (y,m)); 5783 g= g (yevaluation, y); 5784 h= h (yevaluation, y); 5785 gg= mod (swapvar (g,x,y),power (x,m)); 5786 gg= gg (y + evaluation, y); 5787 multiplier1= factors.getLast()[m1][0]/gg[m1][0]; 5788 gg= div (gg, power (y,m)); 5789 gg= gg*power (y,m); 5790 hh= mod (swapvar (h,x,y),power (x,m)); 5791 hh= hh (y + evaluation, y); 5792 multiplier2= factors.getFirst()[m1][0]/hh[m1][0]; 5793 hh= div (hh, power (y,m)); 5794 hh= hh*power (y,m); 5795 gg= multiplier1*gg+mod (factors.getLast(), power (y,m)); 5796 hh= multiplier2*hh+mod (factors.getFirst(), power (y,m)); 5797 check1= gg (yevaluation,y); 5798 check2= hh (yevaluation,y); 5799 CanonicalForm oldcheck1= check1; 5800 check1= swapvar (check1, x, y); 5801 if (check1/Lc (check1) == check2/Lc (check2)) 5802 { 5803 #ifdef HAVE_FLINT 5804 nmod_mat_clear (FLINTN); 5805 #endif 5806 result.append (oldcheck1); 5807 result.append (check2); 5808 delete [] liftPre; 5809 delete [] factorsFoundIndex; 5810 return result; 5811 } 5812 } 5813 } 5814 else 5815 { 5816 i++; 5817 if (i < 5) 5818 continue; 5819 } 5820 #ifdef HAVE_FLINT 5821 reconstructionTry (result, bufF, factors, l, factorsFound, 5822 factorsFoundIndex, FLINTN, evaluation, beenInThres 5823 ); 5824 if (result.length() == nmod_mat_ncols (FLINTN)) 5825 { 5826 nmod_mat_clear (FLINTN); 5827 #else 5828 reconstructionTry (result, bufF, factors, l, factorsFound, 5829 factorsFoundIndex, NTLN, evaluation, beenInThres 5830 ); 5831 if (result.length() == NTLN.NumCols()) 5832 { 5833 #endif 5834 delete [] liftPre; 5835 delete [] factorsFoundIndex; 5836 return result; 5837 } 5838 i++; 5839 } 5840 } 5841 5842 #ifdef HAVE_FLINT 5843 nmod_mat_clear (FLINTN); 5844 #endif 5845 delete [] liftPre; 5846 delete [] factorsFoundIndex; 5847 return result; 5848 } 5849 5850 CFList 5851 earlyReconstructionAndLifting (const CanonicalForm& F, const mat_zz_pE& N, 5852 CanonicalForm& bufF, CFList& factors, int& l, 5853 int& factorsFound, bool beenInThres, CFMatrix& M, 5854 CFArray& Pi, CFList& diophant, bool symmetric, 5855 const CanonicalForm& evaluation 5856 ) 5857 { 5858 int sizeOfLiftPre; 5859 int * liftPre= getLiftPrecisions (F, sizeOfLiftPre, degree (LC (F, 1), 2)); 5860 Variable y= F.mvar(); 5861 factorsFound= 0; 5862 CanonicalForm LCF= LC (F, 1); 5863 CFList result; 5864 int smallFactorDeg= 11; 5865 mat_zz_pE NTLN= N; 5866 int * factorsFoundIndex= new int [NTLN.NumCols()]; 5867 for (long i= 0; i < NTLN.NumCols(); i++) 5868 factorsFoundIndex [i]= 0; 5869 5870 if (degree (F) + 1 > smallFactorDeg) 5871 { 5872 if (l < smallFactorDeg) 5873 { 5874 factors.insert (LCF); 5875 henselLiftResume12 (F, factors, l, smallFactorDeg, Pi, diophant, M); 5876 l= smallFactorDeg; 5877 } 5878 reconstructionTry (result, bufF, factors, smallFactorDeg, factorsFound, 5879 factorsFoundIndex, NTLN, evaluation, beenInThres 5880 ); 5881 if (result.length() == NTLN.NumCols()) 5882 { 5883 delete [] liftPre; 5884 delete [] factorsFoundIndex; 5885 return result; 5886 } 5887 } 5888 5889 int i= sizeOfLiftPre  1; 5890 int dummy= 1; 5891 if (sizeOfLiftPre > 1 && sizeOfLiftPre < 30) 5892 { 5893 while (i > 0) 5894 { 5895 if (l < liftPre[i1] + 1) 5896 { 5897 factors.insert (LCF); 5898 henselLiftResume12 (F, factors, l, liftPre[i1] + 1, Pi, diophant, M); 5899 l= liftPre[i1] + 1; 5900 } 5901 else 5902 { 5903 i; 5904 if (i != 0) 5905 continue; 5906 } 5907 reconstructionTry (result, bufF, factors, l, factorsFound, 5908 factorsFoundIndex, NTLN, evaluation, beenInThres 5909 ); 5910 if (result.length() == NTLN.NumCols()) 5911 { 5912 delete [] liftPre; 5913 delete [] factorsFoundIndex; 5914 return result; 5915 } 5916 i; 5917 } 5918 } 5919 else 5920 { 5921 i= 1; 5922 while ((degree (F,y)/4+1)*i + 4 <= smallFactorDeg) 5923 i++; 5924 while (i < 5) 5925 { 5926 dummy= tmin (degree (F,y)+1, (degree (F,y)/4+1)*i+4); 5730 5927 if (l < dummy) 5731 5928 { … … 5763 5960 if (check1/Lc (check1) == check2/Lc (check2)) 5764 5961 { 5765 #ifdef HAVE_FLINT 5766 nmod_mat_clear (FLINTN); 5767 #endif 5768 result.append (gg); 5769 result.append (hh); 5962 result.append (check1); 5963 result.append (check2); 5770 5964 delete [] liftPre; 5771 5965 delete [] factorsFoundIndex; … … 5780 5974 continue; 5781 5975 } 5782 #ifdef HAVE_FLINT5783 5976 reconstructionTry (result, bufF, factors, l, factorsFound, 5784 factorsFoundIndex, FLINTN, beenInThres 5785 ); 5786 if (result.length() == nmod_mat_ncols (FLINTN)) 5787 { 5788 nmod_mat_clear (FLINTN); 5789 #else 5790 reconstructionTry (result, bufF, factors, l, factorsFound, 5791 factorsFoundIndex, NTLN, beenInThres 5792 ); 5793 if (result.length() == NTLN.NumCols()) 5794 { 5795 #endif 5796 delete [] liftPre; 5797 delete [] factorsFoundIndex; 5798 return result; 5799 } 5800 i++; 5801 } 5802 } 5803 5804 #ifdef HAVE_FLINT 5805 nmod_mat_clear (FLINTN); 5806 #endif 5807 delete [] liftPre; 5808 delete [] factorsFoundIndex; 5809 return result; 5810 } 5811 5812 CFList 5813 earlyReconstructionAndLifting (const CanonicalForm& F, const mat_zz_pE& N, 5814 CanonicalForm& bufF, CFList& factors, int& l, 5815 int& factorsFound, bool beenInThres, CFMatrix& M, 5816 CFArray& Pi, CFList& diophant, bool symmetric, 5817 const CanonicalForm& evaluation 5818 ) 5819 { 5820 int sizeOfLiftPre; 5821 int * liftPre= getLiftPrecisions (F, sizeOfLiftPre, degree (LC (F, 1), 2)); 5822 Variable y= F.mvar(); 5823 factorsFound= 0; 5824 CanonicalForm LCF= LC (F, 1); 5825 CFList result; 5826 int smallFactorDeg= 11; 5827 mat_zz_pE NTLN= N; 5828 int * factorsFoundIndex= new int [NTLN.NumCols()]; 5829 for (long i= 0; i < NTLN.NumCols(); i++) 5830 factorsFoundIndex [i]= 0; 5831 5832 if (degree (F) + 1 > smallFactorDeg) 5833 { 5834 if (l < smallFactorDeg) 5835 { 5836 factors.insert (LCF); 5837 henselLiftResume12 (F, factors, l, smallFactorDeg, Pi, diophant, M); 5838 l= smallFactorDeg; 5839 } 5840 reconstructionTry (result, bufF, factors, smallFactorDeg, factorsFound, 5841 factorsFoundIndex, NTLN, beenInThres 5842 ); 5843 if (result.length() == NTLN.NumCols()) 5844 { 5845 delete [] liftPre; 5846 delete [] factorsFoundIndex; 5847 return result; 5848 } 5849 } 5850 5851 int i= sizeOfLiftPre  1; 5852 int dummy= 1; 5853 if (sizeOfLiftPre > 1 && sizeOfLiftPre < 30) 5854 { 5855 while (i > 0) 5856 { 5857 if (l < liftPre[i1] + 1) 5858 { 5859 factors.insert (LCF); 5860 henselLiftResume12 (F, factors, l, liftPre[i1] + 1, Pi, diophant, M); 5861 l= liftPre[i1] + 1; 5862 } 5863 else 5864 { 5865 i; 5866 if (i != 0) 5867 continue; 5868 } 5869 reconstructionTry (result, bufF, factors, l, factorsFound, 5870 factorsFoundIndex, NTLN, beenInThres 5871 ); 5872 if (result.length() == NTLN.NumCols()) 5873 { 5874 delete [] liftPre; 5875 delete [] factorsFoundIndex; 5876 return result; 5877 } 5878 i; 5879 } 5880 } 5881 else 5882 { 5883 i= 1; 5884 while ((degree (F,y)/4+1)*i + 4 <= smallFactorDeg) 5885 i++; 5886 while (i < 5) 5887 { 5888 dummy= tmin (degree (F,y)+1, (degree (F,y)/4+1)*i+4); 5889 if (l < dummy) 5890 { 5891 factors.insert (LCF); 5892 henselLiftResume12 (F, factors, l, dummy, Pi, diophant, M); 5893 l= dummy; 5894 if (i == 1 && degree (F)%4==0 && symmetric && factors.length() == 2 && 5895 LC (F,1).inCoeffDomain() && 5896 (degree (factors.getFirst(), 1) == degree (factors.getLast(),1))) 5897 { 5898 Variable x= Variable (1); 5899 CanonicalForm g, h, gg, hh, multiplier1, multiplier2, check1, check2; 5900 int m= degree (F)/4+1; 5901 g= factors.getFirst(); 5902 h= factors.getLast(); 5903 g= mod (g, power (y,m)); 5904 h= mod (h, power (y,m)); 5905 g= g (yevaluation, y); 5906 h= h (yevaluation, y); 5907 gg= mod (swapvar (g,x,y),power (x,m)); 5908 gg= gg (y + evaluation, y); 5909 multiplier1= factors.getLast()[m1][0]/gg[m1][0]; 5910 gg= div (gg, power (y,m)); 5911 gg= gg*power (y,m); 5912 hh= mod (swapvar (h,x,y),power (x,m)); 5913 hh= hh (y + evaluation, y); 5914 multiplier2= factors.getFirst()[m1][0]/hh[m1][0]; 5915 hh= div (hh, power (y,m)); 5916 hh= hh*power (y,m); 5917 gg= multiplier1*gg+mod (factors.getLast(), power (y,m)); 5918 hh= multiplier2*hh+mod (factors.getFirst(), power (y,m)); 5919 check1= gg (yevaluation,y); 5920 check2= hh (yevaluation,y); 5921 check1= swapvar (check1, x, y); 5922 if (check1/Lc (check1) == check2/Lc (check2)) 5923 { 5924 result.append (gg); 5925 result.append (hh); 5926 delete [] liftPre; 5927 delete [] factorsFoundIndex; 5928 return result; 5929 } 5930 } 5931 } 5932 else 5933 { 5934 i++; 5935 if (i < 5) 5936 continue; 5937 } 5938 reconstructionTry (result, bufF, factors, l, factorsFound, 5939 factorsFoundIndex, NTLN, beenInThres 5977 factorsFoundIndex, NTLN, evaluation, beenInThres 5940 5978 ); 5941 5979 if (result.length() == NTLN.NumCols()) … … 6069 6107 sieveSmallFactors (const CanonicalForm& G, CFList& uniFactors, DegreePattern& 6070 6108 degPat, CanonicalForm& H, CFList& diophant, CFArray& Pi, 6071 CFMatrix& M, bool& success, int d 6109 CFMatrix& M, bool& success, int d, const CanonicalForm& eval 6072 6110 ) 6073 6111 { … … 6085 6123 CFList earlyFactors; 6086 6124 earlyFactorDetection (earlyFactors, F, bufUniFactors, adaptedLiftBound, 6087 factorsFoundIndex, degs, success, smallFactorDeg );6125 factorsFoundIndex, degs, success, smallFactorDeg, eval); 6088 6126 delete [] factorsFoundIndex; 6089 6127 if (degs.getLength() == 1) … … 6162 6200 henselLiftAndLatticeRecombi (const CanonicalForm& G, const CFList& uniFactors, 6163 6201 const Variable& alpha, const DegreePattern& degPat, 6164 bool symmetric, const CanonicalForm& eval uation6202 bool symmetric, const CanonicalForm& eval 6165 6203 ) 6166 6204 { … … 6195 6233 bool success= false; 6196 6234 smallFactors= sieveSmallFactors (F, bufUniFactors, degs, H, diophant, Pi, M, 6197 success, minBound + 1 6235 success, minBound + 1, eval 6198 6236 ); 6199 6237 … … 6205 6243 { 6206 6244 delete [] bounds; 6207 return CFList (G );6245 return CFList (G (yeval,y)); 6208 6246 } 6209 6247 } … … 6220 6258 { 6221 6259 index= 1; 6222 tmp1= mod (i.getItem(),y );6260 tmp1= mod (i.getItem(),yeval); 6223 6261 tmp1 /= Lc (tmp1); 6224 6262 for (CFListIterator j= bufUniFactors; j.hasItem(); j++, index++) … … 6248 6286 if (isIrreducible) 6249 6287 { 6250 smallFactors.append (F );6288 smallFactors.append (F (yeval,y)); 6251 6289 delete [] bounds; 6252 6290 return smallFactors; … … 6269 6307 if (degs.getLength() <= 1) 6270 6308 { 6271 smallFactors.append (F );6309 smallFactors.append (F (yeval,y)); 6272 6310 delete [] bounds; 6273 6311 return smallFactors; … … 6400 6438 factorRecombination (bufUniFactors, F, 6401 6439 power (y, degree (F) + 1), 6402 degs, 1, bufUniFactors.length()/26440 degs, eval, 1, bufUniFactors.length()/2 6403 6441 ) 6404 6442 ); … … 6413 6451 #endif 6414 6452 delete [] bounds; 6415 return Union (CFList (F ), smallFactors);6453 return Union (CFList (F(yeval,y)), smallFactors); 6416 6454 } 6417 6455 … … 6444 6482 reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1, 6445 6483 #ifdef HAVE_FLINT 6446 factorsFound, factorsFoundIndex, FLINTN, false6447 #else 6448 factorsFound, factorsFoundIndex, NTLN, false6484 factorsFound, factorsFoundIndex, FLINTN, eval, false 6485 #else 6486 factorsFound, factorsFoundIndex, NTLN, eval, false 6449 6487 #endif 6450 6488 ); 6451 6489 else 6452 6490 reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1, 6453 factorsFound, factorsFoundIndex, NTLNe, false6491 factorsFound, factorsFoundIndex, NTLNe, eval, false 6454 6492 ); 6455 6493 if (alpha.level() == 1  (alpha.level() != 1 && reduceFq2Fp)) … … 6505 6543 reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1, 6506 6544 #ifdef HAVE_FLINT 6507 factorsFound, factorsFoundIndex, FLINTN, false6508 #else 6509 factorsFound, factorsFoundIndex, NTLN, false6545 factorsFound, factorsFoundIndex, FLINTN, eval, false 6546 #else 6547 factorsFound, factorsFoundIndex, NTLN, eval, false 6510 6548 #endif 6511 6549 ); 6512 6550 else 6513 6551 reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1, 6514 factorsFound, factorsFoundIndex, NTLNe, false6552 factorsFound, factorsFoundIndex, NTLNe, eval, false 6515 6553 ); 6516 6554 if (alpha.level() == 1  (alpha.level() != 1 && reduceFq2Fp)) … … 6584 6622 #endif 6585 6623 factorsFound, beenInThres, M, Pi, 6586 diophant, symmetric, eval uation6624 diophant, symmetric, eval 6587 6625 ); 6588 6626 … … 6603 6641 result= earlyReconstructionAndLifting (F, NTLNe, bufF, bufUniFactors, l, 6604 6642 factorsFound, beenInThres, M, Pi, 6605 diophant, symmetric, eval uation6643 diophant, symmetric, eval 6606 6644 ); 6607 6645 … … 6621 6659 { 6622 6660 index= 1; 6623 tmp1= mod (i.getItem(), y );6661 tmp1= mod (i.getItem(), yeval); 6624 6662 tmp1 /= Lc (tmp1); 6625 6663 for (CFListIterator j= bufUniFactors; j.hasItem(); j++, index++) … … 6696 6734 for (iter2= result; iter2.hasItem(); iter2++) 6697 6735 { 6698 tmp= mod (iter2.getItem(), y );6736 tmp= mod (iter2.getItem(), yeval); 6699 6737 tmp /= Lc (tmp); 6700 6738 if (tmp == buf) … … 6721 6759 #endif 6722 6760 resultBufF= increasePrecision (bufF, bufUniFactors, factorsFound, 6723 oldNumCols, oldL, l 6761 oldNumCols, oldL, l, eval 6724 6762 ); 6725 6763 } … … 6735 6773 6736 6774 resultBufF= increasePrecisionFq2Fp (bufF, bufUniFactors, factorsFound, 6737 oldNumCols, oldL, alpha, l 6775 oldNumCols, oldL, alpha, l, eval 6738 6776 ); 6739 6777 } … … 6743 6781 6744 6782 resultBufF= increasePrecision (bufF, bufUniFactors, factorsFound, 6745 oldNumCols, oldL, alpha,l6783 oldNumCols, oldL, alpha, l, eval 6746 6784 ); 6747 6785 } … … 6774 6812 nmod_mat_clear (FLINTN); 6775 6813 #endif 6776 result.append (bufF );6814 result.append (bufF (yeval,y)); 6777 6815 return result; 6778 6816 } … … 6783 6821 return Union (result, henselLiftAndLatticeRecombi (bufF, bufUniFactors, 6784 6822 alpha, degs, symmetric, 6785 eval uation6823 eval 6786 6824 ) 6787 6825 ); … … 6794 6832 result=increasePrecision (F, bufUniFactors, oldL, l, d, bounds, bufQ, 6795 6833 #ifdef HAVE_FLINT 6796 FLINTN 6797 #else 6798 NTLN 6834 FLINTN, eval 6835 #else 6836 NTLN, eval 6799 6837 #endif 6800 6838 ); … … 6806 6844 result=increasePrecisionFq2Fp (F, bufUniFactors, oldL, l, d, bounds, 6807 6845 #ifdef HAVE_FLINT 6808 bufQ, FLINTN, alpha 6809 #else 6810 bufQ, NTLN, alpha 6846 bufQ, FLINTN, alpha, eval 6847 #else 6848 bufQ, NTLN, alpha, eval 6811 6849 #endif 6812 6850 ); … … 6815 6853 { 6816 6854 result=increasePrecision (F, bufUniFactors, oldL, l, d, bounds, bufQ, 6817 NTLNe 6855 NTLNe, eval 6818 6856 ); 6819 6857 } … … 6853 6891 liftBound, d, bounds, NTLN, 6854 6892 #endif 6855 diophant, M, Pi, bufQ 6893 diophant, M, Pi, bufQ, eval 6856 6894 ); 6857 6895 else … … 6865 6903 NTLN, diophant, M, 6866 6904 #endif 6867 Pi, bufQ, alpha 6905 Pi, bufQ, alpha, eval 6868 6906 ); 6869 6907 else … … 6871 6909 liftBound, d, bounds, 6872 6910 NTLNe, diophant, M, 6873 Pi, bufQ 6911 Pi, bufQ, eval 6874 6912 ); 6875 6913 } … … 6918 6956 delete [] bounds; 6919 6957 result= Union (result, smallFactors); 6920 result.append (F );6958 result.append (F (yeval,y)); 6921 6959 return result; 6922 6960 } … … 6933 6971 CanonicalForm MODl= power (y, degree (F) + 1); 6934 6972 delete [] bounds; 6935 return Union (result, factorRecombination (bufUniFactors, F, MODl, degs, 1,6936 bufUniFactors.length()/26973 return Union (result, factorRecombination (bufUniFactors, F, MODl, degs, 6974 eval, 1, bufUniFactors.length()/2 6937 6975 ) 6938 6976 ); … … 6945 6983 delete [] bounds; 6946 6984 return Union (result, henselLiftAndLatticeRecombi (F, bufUniFactors, alpha, 6947 degs,symmetric, eval uation6985 degs,symmetric, eval 6948 6986 ) 6949 6987 ); … … 7906 7944 evaluation, 1, uniFactors.length()/2); 7907 7945 else 7908 factors= factorRecombination (uniFactors, A, MODl, degs, 1,7946 factors= factorRecombination (uniFactors, A, MODl, degs, evaluation, 1, 7909 7947 uniFactors.length()/2); 7910 7948 TIMING_END_AND_PRINT (fac_fq_bi_factor_recombination, … … 7958 7996 { 7959 7997 TIMING_START (fac_fq_bi_factor_recombination); 7960 factors= factorRecombination (uniFactors, A, MODl, degs, 1, 3);7998 factors= factorRecombination (uniFactors, A, MODl, degs, evaluation, 1, 3); 7961 7999 TIMING_END_AND_PRINT (fac_fq_bi_factor_recombination, 7962 8000 "time for small subset naive recombi over Fq: "); … … 7969 8007 if (alpha.level() == 1) 7970 8008 tmp= increasePrecision (A, uniFactors, 0, uniFactors.length(), 1, 7971 liftBound 8009 liftBound, evaluation 7972 8010 ); 7973 8011 else … … 7975 8013 if (degree (A) > getCharacteristic()) 7976 8014 tmp= increasePrecisionFq2Fp (A, uniFactors, 0, uniFactors.length(), 7977 1, alpha, liftBound 8015 1, alpha, liftBound, evaluation 7978 8016 ); 7979 8017 else 7980 8018 tmp= increasePrecision (A, uniFactors, 0, uniFactors.length(), 1, 7981 alpha, liftBound 8019 alpha, liftBound, evaluation 7982 8020 ); 7983 8021 } … … 7993 8031 degs.refine (); 7994 8032 factors= Union (factors, factorRecombination (uniFactors, A, MODl, 7995 degs, 4,8033 degs, evaluation, 4, 7996 8034 uniFactors.length()/2 7997 8035 ) … … 8072 8110 delete [] bounds2; 8073 8111 delete [] bounds; 8074 if (!extension)8075 {8076 for (CFListIterator i= factors; i.hasItem(); i++)8077 i.getItem()= i.getItem() (y  evaluation, y);8078 }8079 8112 8080 8113 appendSwapDecompress (factors, contentAxFactors, contentAyFactors,
Note: See TracChangeset
for help on using the changeset viewer.