Changeset dc42daf in git
- Timestamp:
- Feb 21, 2013, 7:13:50 PM (11 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 5693d74c7e74fb28bc22148699aebb6524ded48c
- Parents:
- 892dd80edda39f846824ca997ef834ad6d19f748
- git-author:
- Claus Fieker <fieker@erbsenstein.(none)>2013-02-21 19:13:50+01:00
- git-committer:
- Claus Fieker <fieker@erbsenstein.(none)>2013-02-22 16:40:29+01:00
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kInline.h
r892dd8 rdc42daf 456 456 { 457 457 if (t_p != NULL) 458 459 p_Cleardenom(t_p, tailRing);460 461 458 { 459 p_ProjectiveUnique(t_p, tailRing); 460 pSetCoeff0(p, pGetCoeff(t_p)); 461 } 462 462 else 463 { 464 p_Cleardenom(p, currRing); 465 } 463 { 464 #ifdef HAVE_RATGRING 465 p_ProjectiveUnique(p, currRing); 466 #else 467 p_ProjectiveUnique(p, currRing); 468 #endif 469 } 466 470 } 467 471 } -
libpolys/polys/ext_fields/algext.cc
r892dd8 rdc42daf 220 220 } 221 221 222 222 223 /* assumes that p and q are univariate polynomials in r, 223 224 mentioning the same variable; … … 505 506 poly aTimesB = p_Mult_q(p_Copy((poly)a, naRing), 506 507 p_Copy((poly)b, naRing), naRing); 508 definiteReduce(aTimesB, naMinpoly, cf); 507 509 p_Normalize(aTimesB,naRing); 508 definiteReduce(aTimesB, naMinpoly, cf);509 510 return (number)aTimesB; 510 511 } … … 520 521 poly aDivB = p_Mult_q(p_Copy((poly)a, naRing), bInverse, naRing); 521 522 definiteReduce(aDivB, naMinpoly, cf); 523 p_Normalize(aDivB,naRing); 522 524 return (number)aDivB; 523 525 } … … 682 684 pIter(bb); 683 685 } 686 return h; 684 687 } 685 688 number naLcmContent(number a, number b, const coeffs cf) 686 689 { 687 690 if (nCoeff_is_Zp(naRing->cf)) return naCopy(a,cf); 688 else return ndGcd(a,b,cf); 689 #if 0 691 #if 0 692 else { 693 number g = ndGcd(a, b, cf); 694 return g; 695 } 696 #else 690 697 { 691 698 a=(number)p_Copy((poly)a,naRing); 692 699 number t=napLcm(b,cf); 693 if(!n aIsOne(t,cf))700 if(!n_IsOne(t,naRing->cf)) 694 701 { 695 702 number bt, rr; … … 710 717 return (number) a; 711 718 } 712 719 #endif 713 720 } 714 721 … … 1195 1202 1196 1203 } 1204 1197 1205 1198 1206 // part3: all coeffs = all coeffs / cand -
libpolys/polys/monomials/p_polys.cc
r892dd8 rdc42daf 2495 2495 if(pNext(p)==NULL) 2496 2496 { 2497 /* 2497 2498 if (TEST_OPT_CONTENTSB) 2498 2499 { … … 2507 2508 } 2508 2509 else 2510 */ 2509 2511 p_SetCoeff(p,n_Init(1,r->cf),r); 2510 2512 … … 2517 2519 assume(pNext(p)!=NULL); 2518 2520 2519 #if CLEARENUMERATORS 2521 #if 0 && CLEARENUMERATORS 2522 //CF: does not seem to work that well.. 2523 2520 2524 if( nCoeff_is_Q(C) || nCoeff_is_Q_a(C) ) 2521 2525 { … … 2809 2813 } 2810 2814 2815 // normalization: for poly over Q: make poly primitive, integral 2816 // Qa make poly integral with leading 2817 // coefficient minimal in N 2818 // Q(t) make poly primitive, integral 2819 2820 void p_ProjectiveUnique(poly ph, const ring r) 2821 { 2822 if( ph == NULL ) 2823 return; 2824 2825 assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf; 2826 2827 poly start=ph; 2828 2829 number d, h; 2830 poly p; 2831 2832 #ifdef HAVE_RINGS 2833 if (rField_is_Ring(r)) 2834 { 2835 p_Content(ph,r); 2836 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2837 if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r); 2838 return; 2839 } 2840 #endif 2841 2842 if (rField_is_Zp(r) && TEST_OPT_INTSTRATEGY) 2843 { 2844 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2845 if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r); 2846 return; 2847 } 2848 p = ph; 2849 2850 assume(p != NULL); 2851 2852 if(pNext(p)==NULL) // a monomial 2853 { 2854 p_SetCoeff(p, n_Init(1, C), r); 2855 return; 2856 } 2857 2858 assume(pNext(p)!=NULL); 2859 2860 if(1) 2861 { 2862 h = p_GetCoeff(p, C); 2863 number hInv = n_Invers(h, C); 2864 pIter(p); 2865 while (p!=NULL) 2866 { 2867 p_SetCoeff(p, n_Mult(p_GetCoeff(p, C), hInv, C), r); 2868 pIter(p); 2869 } 2870 n_Delete(&hInv, C); 2871 p = ph; 2872 p_SetCoeff(p, n_Init(1, C), r); 2873 } 2874 p_Cleardenom(ph, r); 2875 p_Content(ph, r); 2876 return; 2877 } 2878 2811 2879 number p_GetAllDenom(poly ph, const ring r) 2812 2880 { -
libpolys/polys/monomials/p_polys.h
r892dd8 rdc42daf 203 203 void p_Norm(poly p1, const ring r); 204 204 void p_Normalize(poly p,const ring r); 205 void p_ProjectiveUnique(poly p,const ring r); 205 206 206 207 void p_Content(poly p, const ring r);
Note: See TracChangeset
for help on using the changeset viewer.