Changeset c8302b in git
- Timestamp:
- May 9, 2012, 10:52:48 AM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- 75f10d0ac85a8bbe7d3c995ee023d8aaaf4a6c9b
- Parents:
- 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e68a3479934a843315e00106eafa5f39066a82124
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/DegreePattern.cc
r5c0bf0 rc8302b 34 34 int p= getCharacteristic(); 35 35 int d= 0; 36 char cGFName ;36 char cGFName= 'Z'; 37 37 if (CFFactory::gettype() == GaloisFieldDomain) 38 38 { -
factory/FLINTconvert.cc
r5c0bf0 rc8302b 265 265 { 266 266 CFFList result; 267 result.insert (CFFactor (CanonicalForm ((long) leadingCoeff), 1)); 267 if (leadingCoeff != 1) 268 result.insert (CFFactor (CanonicalForm ((long) leadingCoeff), 1)); 268 269 269 270 long i; -
factory/cfNewtonPolygon.cc
r5c0bf0 rc8302b 601 601 { 602 602 int n; 603 int ** newtonPolyg ;603 int ** newtonPolyg= NULL; 604 604 if (computeMA) 605 605 { -
factory/cf_factor.cc
r5c0bf0 rc8302b 441 441 F= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, f.mvar()); 442 442 nmod_poly_factor_clear (result); 443 nmod_poly_clear (f1); 443 444 #else 444 445 #ifdef HAVE_NTL … … 542 543 else 543 544 #endif //HAVE_NTL 544 #endif //HAVE_FLINT545 545 { // Use Factory without NTL 546 546 if ( isOn( SW_BERLEKAMP ) ) … … 549 549 F=FpFactorizeUnivariateCZ( f, issqrfree, 0, Variable(), Variable() ); 550 550 } 551 #endif //HAVE_FLINT 551 552 } 552 553 else -
factory/cf_gcd_smallp.cc
r5c0bf0 rc8302b 1596 1596 bool fail= false; 1597 1597 bool inextension= false; 1598 bool inextensionextension= false; 1599 bool topLevel2= false; 1598 topLevel= false; 1600 1599 CFList source, dest; 1601 1600 int bound1= degree (ppA, 1); … … 1614 1613 G_random_element= 1615 1614 GCD_small_p (ppA (random_element,x), ppB (random_element,x), 1616 coF_random_element, coG_random_element, topLevel 2,1615 coF_random_element, coG_random_element, topLevel, 1617 1616 list); 1618 1617 TIMING_END_AND_PRINT (gcd_recursion, … … 1627 1626 GCD_Fp_extension (ppA (random_element, x), ppB (random_element, x), 1628 1627 coF_random_element, coG_random_element, alpha, 1629 list, topLevel 2);1628 list, topLevel); 1630 1629 TIMING_END_AND_PRINT (gcd_recursion, 1631 1630 "time for recursive call: "); … … 1653 1652 GCD_Fp_extension (ppA (random_element, x), ppB (random_element, x), 1654 1653 coF_random_element, coG_random_element, alpha, 1655 list, topLevel 2);1654 list, topLevel); 1656 1655 TIMING_END_AND_PRINT (gcd_recursion, 1657 1656 "time for recursive call: "); … … 1698 1697 DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2)); 1699 1698 1700 inextensionextension= true;1701 1699 for (CFListIterator i= l; i.hasItem(); i++) 1702 1700 i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem, … … 1722 1720 GCD_Fp_extension (ppA (random_element, x), ppB (random_element, x), 1723 1721 coF_random_element, coG_random_element, V_buf, 1724 list, topLevel 2);1722 list, topLevel); 1725 1723 TIMING_END_AND_PRINT (gcd_recursion, 1726 1724 "time for recursive call: "); … … 3023 3021 } 3024 3022 3025 long rk;3026 3023 matColumns= biggestSize2 - 1; 3027 3024 matRows= 0; … … 3029 3026 { 3030 3027 if (V_buf.level() == 1) 3031 rk=gaussianElimFp (pMat[i], pL[i]);3028 (void) gaussianElimFp (pMat[i], pL[i]); 3032 3029 else 3033 rk=gaussianElimFq (pMat[i], pL[i], V_buf);3030 (void) gaussianElimFq (pMat[i], pL[i], V_buf); 3034 3031 3035 3032 if (pMat[i] (coeffMonoms[i].size(), coeffMonoms[i].size()) == 0) … … 3706 3703 topLevel= false; 3707 3704 bool inextension= false; 3708 bool inextensionextension= false;3709 3705 Variable V_buf, alpha; 3710 3706 CanonicalForm prim_elem, im_prim_elem; … … 3807 3803 DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2)); 3808 3804 3809 inextensionextension= true;3810 3805 for (CFListIterator i= l; i.hasItem(); i++) 3811 3806 i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem, … … 4009 4004 DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2)); 4010 4005 4011 inextensionextension= true;4012 4006 for (CFListIterator i= l; i.hasItem(); i++) 4013 4007 i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem, -
factory/facFactorize.cc
r5c0bf0 rc8302b 321 321 if (!pass) 322 322 { 323 int lev ;323 int lev= 0; 324 324 for (int i= 1; i <= LCF.level(); i++) 325 325 { -
factory/facFqBivar.cc
r5c0bf0 rc8302b 41 41 #include "NTLconvert.h" 42 42 43 #ifdef HAVE_FLINT 44 #include "FLINTconvert.h" 45 #endif 46 43 47 TIMING_DEFINE_PRINT(fac_uni_factorizer) 44 48 TIMING_DEFINE_PRINT(fac_hensel_lift12) … … 145 149 { 146 150 Variable x= A.mvar(); 147 ASSERT (A.isUnivariate() || A.inCoeffDomain(), 151 if (A.inCoeffDomain()) 152 return CFList(); 153 ASSERT (A.isUnivariate(), 148 154 "univariate polynomial expected or constant expected"); 149 155 CFFList factorsA; … … 215 221 else 216 222 { 223 #ifdef HAVE_FLINT 224 nmod_poly_t FLINTA; 225 convertFacCF2nmod_poly_t (FLINTA, A); 226 nmod_poly_factor_t result; 227 nmod_poly_factor_init (result); 228 mp_limb_t leadingCoeff= nmod_poly_factor (result, FLINTA); 229 factorsA= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, x); 230 if (factorsA.getFirst().factor().inCoeffDomain()) 231 factorsA.removeFirst(); 232 nmod_poly_factor_clear (result); 233 nmod_poly_clear (FLINTA); 234 #else 217 235 if (getCharacteristic() > 2) 218 236 { … … 232 250 x); 233 251 } 252 #endif 234 253 } 235 254 CFList uniFactors; … … 648 667 zz_p::init (getCharacteristic()); 649 668 zz_pX NTLIrredpoly; 650 int i , m;669 int i=1, m= 2; 651 670 // extension of F_p needed 652 671 if (alpha.level() == 1 && beta.level() == 1 && k == 1) … … 2265 2284 ) 2266 2285 { 2267 bool irreducible= false;2268 2286 int d; 2269 2287 int* bounds= computeBounds (F, d); … … 2328 2346 if (NTLN.NumCols() == 1) 2329 2347 { 2330 irreducible= true;2331 2348 delete [] A; 2332 2349 delete [] bounds; … … 2398 2415 ) 2399 2416 { 2400 bool irreducible= false;2401 2417 int d; 2402 2418 int* bounds= computeBounds (F, d); … … 2461 2477 if (NTLN.NumCols() == 1) 2462 2478 { 2463 irreducible= true;2464 2479 delete [] A; 2465 2480 delete [] bounds; … … 2533 2548 int degMipo= degree (getMipo (info.getAlpha())); 2534 2549 Variable alpha= info.getAlpha(); 2535 bool irreducible= false;2536 2550 int d; 2537 2551 int* bounds= computeBounds (F, d); … … 2650 2664 if (NTLN.NumCols() == 1) 2651 2665 { 2652 irreducible= true;2653 2666 Variable y= Variable (2); 2654 2667 CanonicalForm tmp= F (y - evaluation, y); … … 2722 2735 const Variable& alpha, int precision) 2723 2736 { 2724 bool irreducible= false;2725 2737 int d; 2726 2738 int* bounds= computeBounds (F, d); … … 2786 2798 if (NTLN.NumCols() == 1) 2787 2799 { 2788 irreducible= true;2789 2800 delete [] A; 2790 2801 delete [] bounds; … … 2844 2855 ) 2845 2856 { 2846 bool irreducible= false;2847 2857 int d; 2848 2858 int* bounds= computeBounds (F, d); … … 2908 2918 if (NTLN.NumCols() == 1) 2909 2919 { 2910 irreducible= true;2911 2920 delete [] A; 2912 2921 delete [] bounds; … … 2976 2985 { 2977 2986 CFList result= CFList(); 2978 bool irreducible= false;2979 2987 CFArray * A= new CFArray [factors.length()]; 2980 2988 int oldL2= oldL/2; … … 3033 3041 if (NTLN.NumCols() == 1) 3034 3042 { 3035 irreducible= true;3036 3043 delete [] A; 3037 3044 return CFList (F); … … 3041 3048 if (NTLN.NumCols() == 1) 3042 3049 { 3043 irreducible= true;3044 3050 delete [] A; 3045 3051 return CFList (F); … … 3083 3089 { 3084 3090 CFList result= CFList(); 3085 bool irreducible= false;3086 3091 CFArray * A= new CFArray [factors.length()]; 3087 3092 int oldL2= oldL/2; … … 3137 3142 if (NTLN.NumCols() == 1) 3138 3143 { 3139 irreducible= true;3140 3144 delete [] A; 3141 3145 return CFList (F); … … 3145 3149 if (NTLN.NumCols() == 1) 3146 3150 { 3147 irreducible= true;3148 3151 delete [] A; 3149 3152 return CFList (F); … … 3191 3194 { 3192 3195 CFList result= CFList(); 3193 bool irreducible= false;3194 3196 CFArray * A= new CFArray [factors.length()]; 3195 3197 int oldL2= oldL/2; //be careful … … 3302 3304 if (NTLN.NumCols() == 1) 3303 3305 { 3304 irreducible= true;3305 3306 Variable y= Variable (2); 3306 3307 CanonicalForm tmp= F (y - evaluation, y); … … 3314 3315 if (NTLN.NumCols() == 1) 3315 3316 { 3316 irreducible= true;3317 3317 Variable y= Variable (2); 3318 3318 CanonicalForm tmp= F (y - evaluation, y); … … 3363 3363 { 3364 3364 CFList result= CFList(); 3365 bool irreducible= false;3366 3365 CFArray * A= new CFArray [factors.length()]; 3367 3366 int extensionDeg= degree (getMipo (alpha)); … … 3418 3417 if (NTLN.NumCols() == 1) 3419 3418 { 3420 irreducible= true;3421 3419 delete [] A; 3422 3420 return CFList (F); -
factory/facFqBivarUtil.cc
r5c0bf0 rc8302b 669 669 int** newtonPolyg= newtonPolygon (F, sizeOfNewtonPolygon); 670 670 671 int minXIndex= 0, minYIndex= 0, maxXIndex= 0, maxYIndex= 0;672 671 int minX, minY, maxX, maxY; 673 672 minX= newtonPolyg [0] [0]; … … 678 677 { 679 678 if (minX > newtonPolyg [i] [0]) 680 {681 679 minX= newtonPolyg [i] [0]; 682 minXIndex= i;683 }684 680 if (maxX < newtonPolyg [i] [0]) 685 {686 681 maxX= newtonPolyg [i] [0]; 687 maxXIndex= i;688 }689 682 if (minY > newtonPolyg [i] [1]) 690 {691 683 minY= newtonPolyg [i] [1]; 692 minYIndex= i;693 }694 684 if (maxY < newtonPolyg [i] [1]) 695 {696 685 maxY= newtonPolyg [i] [1]; 697 maxYIndex= i;698 }699 686 } 700 687 -
factory/facFqFactorize.cc
r5c0bf0 rc8302b 1499 1499 if (!pass) 1500 1500 { 1501 int lev ;1501 int lev= 0; 1502 1502 // LCF is non-constant here 1503 1503 for (int i= 1; i <= LCF.level(); i++) -
factory/facMul.cc
r5c0bf0 rc8302b 107 107 108 108 fmpz_poly_t FLINTA,FLINTB; 109 fmpz_poly_init (FLINTA);110 fmpz_poly_init (FLINTB);111 109 kronSub (FLINTA, A, d); 112 110 kronSub (FLINTB, B, d); … … 217 215 218 216 fmpz_poly_t FLINTA,FLINTB; 219 fmpz_poly_init (FLINTA);220 fmpz_poly_init (FLINTB);221 217 kronSub (FLINTA, A, d); 222 218 kronSub (FLINTB, B, d); … … 1357 1353 1358 1354 nmod_poly_t F1, F2; 1359 mp_limb_t ninv= n_preinvert_limb (getCharacteristic());1360 nmod_poly_init_preinv (F1, getCharacteristic(), ninv);1361 nmod_poly_init_preinv (F2, getCharacteristic(), ninv);1362 1355 kronSubReciproFp (F1, F2, F, d1); 1363 1356 1364 1357 nmod_poly_t G1, G2; 1365 nmod_poly_init_preinv (G1, getCharacteristic(), ninv);1366 nmod_poly_init_preinv (G2, getCharacteristic(), ninv);1367 1358 kronSubReciproFp (G1, G2, G, d1); 1368 1359 … … 1409 1400 1410 1401 nmod_poly_t FLINTA, FLINTB; 1411 mp_limb_t ninv= n_preinvert_limb (getCharacteristic());1412 nmod_poly_init_preinv (FLINTA, getCharacteristic(), ninv);1413 nmod_poly_init_preinv (FLINTB, getCharacteristic(), ninv);1414 1402 kronSubFp (FLINTA, A, d1); 1415 1403 kronSubFp (FLINTB, B, d1); … … 1434 1422 1435 1423 fmpz_poly_t F1, F2; 1436 fmpz_poly_init (F1);1437 fmpz_poly_init (F2);1438 1424 kronSubReciproQ (F1, F2, F, d1); 1439 1425 1440 1426 fmpz_poly_t G1, G2; 1441 fmpz_poly_init (G1);1442 fmpz_poly_init (G2);1443 1427 kronSubReciproQ (G1, G2, G, d1); 1444 1428 … … 1483 1467 1484 1468 fmpz_poly_t FLINTA, FLINTB; 1485 fmpz_poly_init (FLINTA);1486 fmpz_poly_init (FLINTB);1487 1469 kronSub (FLINTA, A, d1); 1488 1470 kronSub (FLINTB, B, d1); -
libpolys/polys/clapsing.cc
r68a3479 rc8302b 501 501 } 502 502 503 static int primepower(int c, const ring r)504 {505 int p=1;506 int cc=c;507 while(cc!= rChar(r)) { cc*=c; p++; }508 return p;509 }510 511 503 BOOLEAN count_Factors(ideal I, intvec *v,int j, poly &f, poly fac, const ring r) 512 504 {
Note: See TracChangeset
for help on using the changeset viewer.