Changeset 58ea04 in git
 Timestamp:
 Mar 22, 2011, 11:40:25 AM (12 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 a4081e52fffd1c1c6450f2811d458e9ebc4e2823
 Parents:
 494884581702ad06eefdf632a5e1abb42bd90f4d
 gitauthor:
 Hans Schoenemann <hannes@mathematik.unikl.de>20110322 11:40:25+01:00
 gitcommitter:
 Mohamed Barakat <mohamed.barakat@rwthaachen.de>20111109 12:04:10+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libpolys/polys/kbuckets.cc
r494884 r58ea04 4 4 /* $Id$ */ 5 5 6 #include <kernel/mod2.h> 7 #include <kernel/structs.h> 6 //#include <kernel/mod2.h> 8 7 #include <omalloc/omalloc.h> 9 #include < kernel/p_polys.h>10 #include <kernel/febase.h>11 #include <kernel/pShallowCopyDelete.h>12 #include < kernel/numbers.h>13 #include < kernel/ring.h>14 #include <kernel/p_Procs.h>15 #include <kernel/kutil.h>16 #include < kernel/kbuckets.h>8 #include <polys/monomials/p_polys.h> 9 //#include <kernel/febase.h> 10 //#include <kernel/pShallowCopyDelete.h> 11 #include <coeffs/coeffs.h> 12 #include <polys/monomials/ring.h> 13 //#include <kernel/p_Procs.h> 14 //#include <kernel/kutil.h> 15 #include <polys/kbuckets.h> 17 16 18 17 #ifdef HAVE_COEF_BUCKETS … … 30 29 } \ 31 30 } while(0) \ 32 if (rField_is_Ring( currRing)) B>buckets_length[i] = pLength(B>buckets[i]);31 if (rField_is_Ring(B>bucket_ring)) B>buckets_length[i] = pLength(B>buckets[i]); 33 32 #else 34 33 #define MULTIPLY_BUCKET(B,I) do \ … … 594 593 performed when "(i<coef_start)" is true? 595 594 For the time being, I leave it as it is. */ 596 if (rField_is_Ring(r) && !(rField_is_Domain(r))) { 595 if (rField_is_Ring(r) && !(rField_is_Domain(r))) 596 { 597 597 bucket>buckets_length[i] = pLength(bucket>buckets[i]); 598 598 kBucketAdjust(bucket, i); … … 611 611 bucket>buckets[i] = p_Mult_nn(bucket>buckets[i], n, r); 612 612 #ifdef HAVE_RINGS 613 if (rField_is_Ring(currRing) && !(rField_is_Domain(currRing))) { 613 if (rField_is_Ring(r) && !(rField_is_Domain(r))) 614 { 614 615 bucket>buckets_length[i] = pLength(bucket>buckets[i]); 615 616 kBucketAdjust(bucket, i); … … 738 739 bucket>buckets_length[i] = 0; 739 740 #ifdef HAVE_RINGS 740 if (rField_is_Ring( currRing) && !(rField_is_Domain(currRing)))741 if (rField_is_Ring(r) && !(rField_is_Domain(r))) 741 742 { 742 743 l1 = pLength(p1); … … 748 749 else 749 750 { 750 pSetCoeff0(m, n Neg(pGetCoeff(m)));751 pSetCoeff0(m, n_Neg(pGetCoeff(m),r>cf)); 751 752 if (spNoether != NULL) 752 753 { … … 758 759 p1 = r>p_Procs>pp_Mult_mm(p1, m, r, last); 759 760 #ifdef HAVE_RINGS 760 if (rField_is_Ring( currRing) && !(rField_is_Domain(currRing)))761 if (rField_is_Ring(r) && !(rField_is_Domain(r))) 761 762 { 762 763 l1 = pLength(p1); … … 765 766 #endif 766 767 } 767 pSetCoeff0(m, n Neg(pGetCoeff(m)));768 pSetCoeff0(m, n_Neg(pGetCoeff(m),r>cf)); 768 769 } 769 770 … … 820 821 i = pLogLength(l1); 821 822 #ifdef USE_COEF_BUCKETS 822 number n=n_Init(1,r );823 number n=n_Init(1,r>cf); 823 824 #endif 824 825 if (i <= bucket>buckets_used && bucket>buckets[i] != NULL) … … 1062 1063 poly spNoether) 1063 1064 { 1064 assume((!rIsPluralRing(bucket>bucket_ring))p_LmEqual(p1,kBucketGetLm(bucket), bucket>bucket_ring)); 1065 ring r=bucket>bucket_ring; 1066 assume((!rIsPluralRing(r))p_LmEqual(p1,kBucketGetLm(bucket), r)); 1065 1067 assume(p1 != NULL && 1066 p_DivisibleBy(p1, kBucketGetLm(bucket), bucket>bucket_ring));1068 p_DivisibleBy(p1, kBucketGetLm(bucket), r)); 1067 1069 assume(pLength(p1) == (int) l1); 1068 1070 … … 1076 1078 if(a1==NULL) 1077 1079 { 1078 p_LmDelete(&lm, bucket>bucket_ring);1079 return n Init(1);1080 } 1081 1082 if (! n IsOne(pGetCoeff(p1)))1080 p_LmDelete(&lm, r); 1081 return n_Init(1,r>cf); 1082 } 1083 1084 if (! n_IsOne(pGetCoeff(p1),r>cf)) 1083 1085 { 1084 1086 number an = pGetCoeff(p1), bn = pGetCoeff(lm); … … 1091 1093 1092 1094 /* setup factor for p1 which cancels leading terms */ 1093 p_SetCoeff(lm, bn, bucket>bucket_ring);1095 p_SetCoeff(lm, bn, r); 1094 1096 if ((ct == 0)  (ct == 2)) 1095 1097 { … … 1100 1102 1101 1103 /* correct factor for cancelation by changing sign if an=1 */ 1102 if (rField_is_Ring( ))1103 lm = p_Mult_nn(lm, an, bucket>bucket_ring);1104 if (rField_is_Ring(r)) 1105 lm = p_Mult_nn(lm, an, r); 1104 1106 else 1105 1107 kBucket_Mult_n(bucket, an); … … 1109 1111 else 1110 1112 { 1111 rn = n Init(1);1112 } 1113 1114 if (p_GetComp(p1, bucket>bucket_ring) != p_GetComp(lm, bucket>bucket_ring))1115 { 1116 p_SetCompP(a1, p_GetComp(lm, bucket>bucket_ring), bucket>bucket_ring);1113 rn = n_Init(1,r>cf); 1114 } 1115 1116 if (p_GetComp(p1, r) != p_GetComp(lm, r)) 1117 { 1118 p_SetCompP(a1, p_GetComp(lm, r), r); 1117 1119 reset_vec = TRUE; 1118 p_SetComp(lm, p_GetComp(p1, bucket>bucket_ring), bucket>bucket_ring);1119 p_Setm(lm, bucket>bucket_ring);1120 } 1121 1122 p_ExpVectorSub(lm, p1, bucket>bucket_ring);1120 p_SetComp(lm, p_GetComp(p1, r), r); 1121 p_Setm(lm, r); 1122 } 1123 1124 p_ExpVectorSub(lm, p1, r); 1123 1125 l1; 1124 1126 … … 1130 1132 if(l1==1) { 1131 1133 1132 //if (rField_is_Q( bucket>bucket_ring)) {1134 //if (rField_is_Q(r)) { 1133 1135 //avoid this for function fields, as gcds are expensive at the moment 1134 1136 1135 1137 1136 coef=p_GetCoeff(a1, bucket>bucket_ring);1137 lm=p_Mult_nn(lm, coef, bucket>bucket_ring);1138 p_SetCoeff0(a1, n_Init(1, bucket>bucket_ring), bucket>bucket_ring);1138 coef=p_GetCoeff(a1,r); 1139 lm=p_Mult_nn(lm, coef, r); 1140 p_SetCoeff0(a1, n_Init(1,r), r); 1139 1141 backuped=TRUE; 1140 1142 //WARNING: not thread_safe … … 1147 1149 1148 1150 if (backuped) 1149 p_SetCoeff0(a1,coef, bucket>bucket_ring);1150 p_LmDelete(&lm, bucket>bucket_ring);1151 if (reset_vec) p_SetCompP(a1, 0, bucket>bucket_ring);1151 p_SetCoeff0(a1,coef,r); 1152 p_LmDelete(&lm, r); 1153 if (reset_vec) p_SetCompP(a1, 0, r); 1152 1154 kbTest(bucket); 1153 1155 return rn; … … 1159 1161 if (r>parameter==NULL) 1160 1162 { 1161 return (r>cf> nSize(n)==1);1163 return (r>cf>cfSize(n,r>cf)==1); 1162 1164 } 1163 1165 //if (r>parameter!=NULL) 1164 return ( (n_IsOne(n,r))  (n_IsMOne(n,r)));1166 return (n_IsOne(n,r>cf)  n_IsMOne(n,r>cf)); 1165 1167 } 1166 1168
Note: See TracChangeset
for help on using the changeset viewer.