Changeset a54114 in git
- Timestamp:
- Jan 16, 2012, 1:08:04 PM (12 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 69076c5854bc7141a7ff79af314eb57862ea37be
- Parents:
- 34e062be492e096661b73e4bf540240303bdc2ec
- git-author:
- Martin Lee <martinlee84@web.de>2012-01-16 13:08:04+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-10 14:16:44+01:00
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facFqBivar.cc
r34e062 ra54114 72 72 fail= false; 73 73 Variable x= Variable(2); 74 Variable y= Variable(1); 74 75 FFRandom genFF; 75 76 GFRandom genGF; … … 122 123 if (find (list, random)) continue; 123 124 eval= F (random, x); 124 if (degree (eval) != degree (F, Variable (1)))125 if (degree (eval) != degree (F, y)) 125 126 { //leading coeff vanishes 126 127 if (!find (list, random)) … … 256 257 257 258 Variable y= F.mvar(); 259 Variable x= Variable (1); 258 260 CFList source, dest; 259 261 if (degs.getLength() <= 1 || factors.length() == 1) … … 278 280 buf= F; 279 281 280 CanonicalForm g, LCBuf= LC (buf, Variable (1));282 CanonicalForm g, LCBuf= LC (buf, x); 281 283 int * v= new int [T.length()]; 282 284 for (int i= 0; i < T.length(); i++) … … 333 335 g= prodMod (S, M); 334 336 S.removeFirst(); 335 g /= content (g, Variable (1));337 g /= content (g, x); 336 338 if (fdivides (g, buf, quot)) 337 339 { … … 344 346 { 345 347 buf= quot; 346 LCBuf= LC (buf, Variable (1));348 LCBuf= LC (buf, x); 347 349 recombination= true; 348 350 appendTestMapDown (result, buf2, info, source, dest); … … 355 357 { 356 358 buf= quot; 357 LCBuf= LC (buf, Variable (1));359 LCBuf= LC (buf, x); 358 360 recombination= true; 359 361 appendTestMapDown (result, buf2, info, source, dest); … … 460 462 T= factors; 461 463 CFList result; 462 CanonicalForm LCBuf= LC (F, Variable (1)); 464 Variable y= Variable (2); 465 Variable x= Variable (1); 466 CanonicalForm LCBuf= LC (F, x); 463 467 CanonicalForm g, quot, buf= F; 464 468 int * v= new int [T.length()]; … … 484 488 g= prodMod (T, M); 485 489 T.removeFirst(); 486 result.append (g/content (g, Variable (1)));490 result.append (g/content (g, x)); 487 491 F= 1; 488 492 return result; … … 511 515 g= prodMod (S, M); 512 516 S.removeFirst(); 513 g /= content (g, Variable (1));517 g /= content (g, x); 514 518 515 519 if (fdivides (g, buf, quot)) … … 518 522 result.append (g); 519 523 buf= quot; 520 LCBuf= LC (buf, Variable(1));524 LCBuf= LC (buf, x); 521 525 T= Difference (T, S); 522 526 … … 628 632 CFList T= factors; 629 633 CanonicalForm buf= F; 630 CanonicalForm LCBuf= LC (buf, Variable (1)); 634 Variable x= Variable (1); 635 CanonicalForm LCBuf= LC (buf, x); 631 636 CanonicalForm g, quot; 632 637 CanonicalForm M= power (F.mvar(), deg); … … 645 650 { 646 651 g= mulMod2 (i.getItem(), LCBuf, M); 647 g /= content (g, Variable (1));652 g /= content (g, x); 648 653 if (fdivides (g, buf, quot)) 649 654 { 650 655 result.append (g); 651 656 buf= quot; 652 d -= degree (g) + degree (LC (g, Variable (1)));653 LCBuf= LC (buf, Variable (1));657 d -= degree (g) + degree (LC (g, x)); 658 LCBuf= LC (buf, x); 654 659 T= Difference (T, CFList (i.getItem())); 655 660 … … 695 700 CFList T= factors; 696 701 Variable y= F.mvar(); 697 CanonicalForm buf= F, LCBuf= LC (buf, Variable (1)), g, buf2; 702 Variable x= Variable (1); 703 CanonicalForm buf= F, LCBuf= LC (buf, x), g, buf2; 698 704 CanonicalForm M= power (y, deg); 699 705 adaptedLiftBound= 0; … … 717 723 { 718 724 g= mulMod2 (i.getItem(), LCBuf, M); 719 g /= content (g, Variable (1));725 g /= content (g, x); 720 726 if (fdivides (g, buf, quot)) 721 727 { … … 723 729 buf2 /= Lc (buf2); 724 730 725 if (!k && beta == Variable (1))731 if (!k && beta == x) 726 732 { 727 733 if (degree (buf2, alpha) < degMipoBeta) … … 729 735 appendTestMapDown (result, buf2, info, source, dest); 730 736 buf= quot; 731 d -= degree (g) + degree (LC (g, Variable (1)));732 LCBuf= LC (buf, Variable (1));737 d -= degree (g) + degree (LC (g, x)); 738 LCBuf= LC (buf, x); 733 739 trueFactor= true; 734 740 } … … 740 746 appendTestMapDown (result, buf2, info, source, dest); 741 747 buf= quot; 742 d -= degree (g) + degree (LC (g, Variable (1)));743 LCBuf= LC (buf, Variable (1));748 d -= degree (g) + degree (LC (g, x)); 749 LCBuf= LC (buf, x); 744 750 trueFactor= true; 745 751 } … … 1260 1266 buf /= content (buf, x); 1261 1267 buf2= buf (y-evaluation, y); 1262 if (!k && beta == Variable (1))1268 if (!k && beta == x) 1263 1269 { 1264 1270 if (degree (buf2, alpha) < 1) … … 1396 1402 buf /= content (buf, x); 1397 1403 buf2= buf (y - evaluation, y); 1398 if (!k && beta == Variable (1))1404 if (!k && beta == x) 1399 1405 { 1400 1406 if (degree (buf2, alpha) < 1) … … 5587 5593 factors= Union (lll, factors); 5588 5594 } 5589 else if (!extension && (alpha != Variable (1)|| GF))5595 else if (!extension && (alpha != x || GF)) 5590 5596 { 5591 5597 CFList lll= henselLiftAndLatticeRecombi (A, uniFactors, alpha, degs); … … 5760 5766 else // not able to pass to GF, pass to F_p(\alpha) 5761 5767 { 5762 CanonicalForm mipo= randomIrredpoly (2, Variable (1));5768 CanonicalForm mipo= randomIrredpoly (2, x); 5763 5769 Variable v= rootOf (mipo); 5764 5770 ExtensionInfo info2= ExtensionInfo (v); … … 5773 5779 int extDeg= degree (getMipo (alpha)); 5774 5780 extDeg++; 5775 CanonicalForm mipo= randomIrredpoly (extDeg + 1, Variable (1));5781 CanonicalForm mipo= randomIrredpoly (extDeg + 1, x); 5776 5782 Variable v= rootOf (mipo); 5777 5783 ExtensionInfo info2= ExtensionInfo (v); … … 5780 5786 else 5781 5787 { 5782 if (beta == Variable (1))5788 if (beta == x) 5783 5789 { 5784 5790 Variable v= chooseExtension (alpha, beta, k); -
factory/facFqFactorize.cc
r34e062 ra54114 49 49 myContent (const CanonicalForm& F) 50 50 { 51 CanonicalForm G= swapvar (F, F.mvar(), Variable (1)); 51 Variable x= Variable (1); 52 CanonicalForm G= swapvar (F, F.mvar(), x); 52 53 CFList L; 53 54 for (CFIterator i= G; i.hasTerms(); i++) 54 55 L.append (i.coeff()); 55 56 if (L.length() == 2) 56 return swapvar (gcd (L.getFirst(), L.getLast()), F.mvar(), Variable (1));57 return swapvar (gcd (L.getFirst(), L.getLast()), F.mvar(), x); 57 58 if (L.length() == 1) 58 return LC (F, Variable (1));59 return swapvar (listGCD (L), F.mvar(), Variable (1));59 return LC (F, x); 60 return swapvar (listGCD (L), F.mvar(), x); 60 61 } 61 62 … … 214 215 buf= F; 215 216 216 CanonicalForm g, LCBuf= LC (buf, Variable (1)); 217 Variable x= Variable (1); 218 CanonicalForm g, LCBuf= LC (buf, x); 217 219 CanonicalForm buf2, quot; 218 220 int * v= new int [T.length()]; … … 260 262 buf2= reverseShift (g, evaluation); 261 263 buf2 /= Lc (buf2); 262 if (!k && beta == Variable (1))264 if (!k && beta == x) 263 265 { 264 266 if (degree (buf2, alpha) < degMipoBeta) … … 266 268 appendTestMapDown (result, buf2, info, source, dest); 267 269 buf= quot; 268 LCBuf= LC (buf, Variable (1));270 LCBuf= LC (buf, x); 269 271 recombination= true; 270 272 trueFactor= true; … … 277 279 appendTestMapDown (result, buf2, info, source, dest); 278 280 buf /= g; 279 LCBuf= LC (buf, Variable (1));281 LCBuf= LC (buf, x); 280 282 recombination= true; 281 283 trueFactor= true; … … 416 418 CanonicalForm buf= F; 417 419 Variable y= F.mvar(); 418 CanonicalForm LCBuf= LC (buf, Variable (1)); 420 Variable x= Variable (1); 421 CanonicalForm LCBuf= LC (buf, x); 419 422 CanonicalForm g, quot; 420 423 CFList M= MOD; … … 433 436 e= tmax (e, nBuf); 434 437 buf= quot; 435 LCBuf= LC (buf, Variable (1));438 LCBuf= LC (buf, x); 436 439 } 437 440 } … … 485 488 CanonicalForm buf= F; 486 489 Variable y= F.mvar(); 487 CanonicalForm LCBuf= LC (buf, Variable (1)); 490 Variable x= Variable (1); 491 CanonicalForm LCBuf= LC (buf, x); 488 492 CanonicalForm g, gg, quot; 489 493 CFList M= MOD; … … 506 510 gg= reverseShift (g, eval); 507 511 gg /= Lc (gg); 508 if (!k && beta == Variable (1))512 if (!k && beta == x) 509 513 { 510 514 if (degree (gg, alpha) < degMipoBeta) 511 515 { 512 516 buf= quot; 513 nBuf= degree (g, y) + degree (LC (g, Variable (1)), y);517 nBuf= degree (g, y) + degree (LC (g, x), y); 514 518 d -= nBuf; 515 519 e= tmax (e, nBuf); 516 LCBuf= LC (buf, Variable (1));520 LCBuf= LC (buf, x); 517 521 } 518 522 } … … 522 526 { 523 527 buf= quot; 524 nBuf= degree (g, y) + degree (LC (g, Variable (1)), y);528 nBuf= degree (g, y) + degree (LC (g, x), y); 525 529 d -= nBuf; 526 530 e= tmax (e, nBuf); 527 LCBuf= LC (buf, Variable (1));531 LCBuf= LC (buf, x); 528 532 } 529 533 } … … 576 580 CanonicalForm buf= F; 577 581 Variable y= F.mvar(); 578 CanonicalForm LCBuf= LC (buf, Variable (1)); 582 Variable x= Variable (1); 583 CanonicalForm LCBuf= LC (buf, x); 579 584 CanonicalForm g, quot; 580 585 CFList M= MOD; … … 591 596 { 592 597 result.append (g); 593 nBuf= degree (g, y) + degree (LC (g, Variable (1)), y);598 nBuf= degree (g, y) + degree (LC (g, x), y); 594 599 d -= nBuf; 595 600 e= tmax (e, nBuf); 596 601 buf= quot; 597 LCBuf= LC (buf, Variable (1));602 LCBuf= LC (buf, x); 598 603 T= Difference (T, CFList (i.getItem())); 599 604 } … … 631 636 CanonicalForm buf= F; 632 637 Variable y= F.mvar(); 633 CanonicalForm LCBuf= LC (buf, Variable (1)); 638 Variable x= Variable (1); 639 CanonicalForm LCBuf= LC (buf, x); 634 640 CanonicalForm g, gg, quot; 635 641 CFList M= MOD; … … 653 659 gg= reverseShift (g, eval); 654 660 gg /= Lc (gg); 655 if (!k && beta == Variable (1))661 if (!k && beta == x) 656 662 { 657 663 if (degree (gg, alpha) < degMipoBeta) … … 659 665 appendTestMapDown (result, gg, info, source, dest); 660 666 buf= quot; 661 nBuf= degree (g, y) + degree (LC (g, Variable (1)), y);667 nBuf= degree (g, y) + degree (LC (g, x), y); 662 668 d -= nBuf; 663 669 e= tmax (e, nBuf); 664 LCBuf= LC (buf, Variable (1));670 LCBuf= LC (buf, x); 665 671 T= Difference (T, CFList (i.getItem())); 666 672 } … … 672 678 appendTestMapDown (result, gg, info, source, dest); 673 679 buf= quot; 674 nBuf= degree (g, y) + degree (LC (g, Variable (1)), y);680 nBuf= degree (g, y) + degree (LC (g, x), y); 675 681 d -= nBuf; 676 682 e= tmax (e, nBuf); 677 LCBuf= LC (buf, Variable (1));683 LCBuf= LC (buf, x); 678 684 T= Difference (T, CFList (i.getItem())); 679 685 } … … 710 716 int p= getCharacteristic (); 711 717 double bound; 712 if (alpha != Variable (1))718 if (alpha != x) 713 719 { 714 720 bound= pow ((double) p, (double) degree (getMipo(alpha))); … … 2137 2143 buf2= g; 2138 2144 buf2 /= Lc (buf2); 2139 if (!k && beta == Variable (1))2145 if (!k && beta.level() == 1) 2140 2146 { 2141 2147 if (degree (buf2, alpha) < degMipoBeta) … … 2788 2794 else // not able to pass to GF, pass to F_p(\alpha) 2789 2795 { 2790 CanonicalForm mipo= randomIrredpoly (2, Variable (1));2796 CanonicalForm mipo= randomIrredpoly (2, w); 2791 2797 Variable v= rootOf (mipo); 2792 2798 ExtensionInfo info= ExtensionInfo (v); … … 2801 2807 int extDeg= degree (getMipo (alpha)); 2802 2808 extDeg++; 2803 CanonicalForm mipo= randomIrredpoly (extDeg + 1, Variable (1));2809 CanonicalForm mipo= randomIrredpoly (extDeg + 1, w); 2804 2810 Variable v= rootOf (mipo); 2805 2811 ExtensionInfo info= ExtensionInfo (v); … … 2808 2814 else 2809 2815 { 2810 if (beta == Variable (1))2816 if (beta == w) 2811 2817 { 2812 2818 Variable v= chooseExtension (alpha, beta, k);
Note: See TracChangeset
for help on using the changeset viewer.