Changeset dbcaa4 in git for factory/libfac/charset/alg_factor.cc
 Timestamp:
 Mar 7, 2014, 4:38:13 PM (10 years ago)
 Branches:
 (u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
 Children:
 d21c2cb52c17b8ca70c95d559d91d0d074c00a7e
 Parents:
 48686414f84cb721633f002b70fc8550f00a41d5
 gitauthor:
 Martin Lee <martinlee84@web.de>20140307 16:38:13+01:00
 gitcommitter:
 Hans Schoenemann <hannes@mathematik.unikl.de>20140317 18:31:54+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/libfac/charset/alg_factor.cc
r486864 rdbcaa4 581 581 // K must have more than S elements (>thesis, > getextension) 582 582 static CFList 583 simpleextension(const CFList & Astar, const Variable & Extension, 584 CanonicalForm & R){ 583 simpleextension(const CFList & Astar, const Variable & Extension, bool& isFunctionField, 584 CanonicalForm & R) 585 { 585 586 CFList Returnlist, Bstar=Astar; 586 CanonicalForm s, g; 587 CanonicalForm s, g, ra, rb, oldR, h, denra, denrb=1; 588 Variable alpha; 589 CFList tmp; 590 591 bool isRat= isOn (SW_RATIONAL); 587 592 588 593 DEBOUTLN(CERR, "simpleextension: Astar= ", Astar); 589 594 DEBOUTLN(CERR, "simpleextension: R= ", R); 590 595 DEBOUTLN(CERR, "simpleextension: Extension= ", Extension); 591 if ( Astar.length() == 1 ){ R= Astar.getFirst();} 592 else{ 593 R=Bstar.getFirst(); Bstar.removeFirst(); 594 for ( CFListIterator i=Bstar; i.hasItem(); i++){ 595 DEBOUTLN(CERR, "simpleextension: f(x)= ", i.getItem()); 596 DEBOUTLN(CERR, "simpleextension: P(x)= ", R); 597 sqrf_norm(i.getItem(), R, Extension, s, g, R); 598 // spielt die Repraesentation eine Rolle? 599 // muessen wir die Nachfolger aendern, wenn s != 0 ? 596 CFListIterator j; 597 if (Astar.length() == 1) 598 { 599 R= Astar.getFirst(); 600 rb= R.mvar(); 601 } 602 else 603 { 604 R=Bstar.getFirst(); 605 Bstar.removeFirst(); 606 for (CFListIterator i=Bstar; i.hasItem(); i++) 607 { 608 j= i; 609 j++; 610 Off (SW_RATIONAL); 611 R /= icontent (R); 612 On (SW_RATIONAL); 613 oldR= R; 614 sqrf_norm (i.getItem(), R, Extension, s, g, R); 615 616 Off (SW_RATIONAL); 617 R /= icontent (R); 618 619 On (SW_RATIONAL); 620 621 if (!isFunctionField) 622 { 623 alpha= rootOf (R); 624 h= replacevar (g, g.mvar(), alpha); 625 On (SW_RATIONAL); //needed for GCD 626 h= gcd (h, oldR); 627 h /= Lc (h); 628 ra= h[0]; 629 ra= replacevar(ra, alpha, g.mvar()); 630 rb= R.mvar()s*ra; 631 for (; j.hasItem(); j++) 632 { 633 j.getItem()= j.getItem() (ra, oldR.mvar()); 634 j.getItem()= j.getItem() (rb, i.getItem().mvar()); 635 } 636 } 637 else 638 { 639 On (SW_RATIONAL); 640 h= swapvar (g, g.mvar(), oldR.mvar()); 641 tmp= CFList (swapvar (R, g.mvar(), oldR.mvar())); 642 h= alg_gcd (h, swapvar (oldR, g.mvar(), oldR.mvar()), tmp); 643 CanonicalForm hh= replacevar (h, oldR.mvar(), alpha); 644 645 CanonicalForm numt, dent; 646 QuasiInverse (tmp.getFirst(), LC (h), numt, tmp.getFirst().mvar()); 647 648 Off (SW_RATIONAL); 649 h *= numt; 650 h= reduce (h, tmp.getFirst()); 651 dent= LC(h); 652 653 ra= h[0]; 654 denra= gcd (ra, dent); 655 ra /= denra; 656 denra= dent/denra; 657 denra= replacevar (denra, ra.mvar(), g.mvar()); 658 ra= replacevar(ra, ra.mvar(), g.mvar()); 659 rb= R.mvar()*denras*ra; 660 denrb= denra; 661 for (; j.hasItem(); j++) 662 { 663 CanonicalForm powdenra= power (denra, degree (j.getItem(), oldR.mvar())); 664 j.getItem()= evaluate (j.getItem(),ra, denra, powdenra, oldR.mvar()); 665 powdenra= power (denra, degree (j.getItem(), i.getItem().mvar())); 666 j.getItem()= evaluate (j.getItem(), rb, denrb, powdenra, i.getItem().mvar()); 667 } 668 } 669 600 670 DEBOUTLN(CERR, "simpleextension: g= ", g); 601 671 DEBOUTLN(CERR, "simpleextension: s= ", s); 602 672 DEBOUTLN(CERR, "simpleextension: R= ", R); 603 Returnlist.insert(s); 604 } 605 } 673 Returnlist.append (ra); 674 if (isFunctionField) 675 Returnlist.append (denra); 676 } 677 } 678 Returnlist.append (rb); 679 if (isFunctionField) 680 Returnlist.append (denrb); 681 682 if (isRat) 683 On (SW_RATIONAL); 684 else 685 Off (SW_RATIONAL); 606 686 607 687 return Returnlist;
Note: See TracChangeset
for help on using the changeset viewer.