Changeset 8227a9 in git
 Timestamp:
 Nov 23, 2006, 1:46:17 PM (17 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
 Children:
 9edc1d34e7e5f871fd5bdb741da43dfa5e168ea2
 Parents:
 688c5f840bb21a424c4b9fa6527595a7dd39d409
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/kbuckets.cc
r688c5f r8227a9 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kbuckets.cc,v 1.2 7 20060227 14:42:05 brickenExp $ */4 /* $Id: kbuckets.cc,v 1.28 20061123 12:46:17 Singular Exp $ */ 5 5 6 6 #include "mod2.h" … … 740 740 l1 = pLength(p1); 741 741 assume(pLength(p1) == l1); 742 #endif 742 #endif 743 743 i = pLogLength(l1); 744 744 } … … 793 793 void kBucket_Plus_mm_Mult_pp(kBucket_pt bucket, poly m, poly p, int l) 794 794 { 795 assume((!rIsPluralRing(bucket>bucket_ring))p_IsConstant(m, bucket>bucket_ring)); 795 assume((!rIsPluralRing(bucket>bucket_ring))p_IsConstant(m, bucket>bucket_ring)); 796 796 assume(l <= 0  pLength(p) == l); 797 797 int i, l1; … … 871 871 } 872 872 } 873 873 874 874 else 875 875 { … … 889 889 #endif 890 890 } 891 891 892 892 893 893 while ((bucket>buckets[i] != NULL) && (p1!=NULL)) … … 952 952 #ifdef USE_COEF_BUCKETS 953 953 assume(bucket>coef[i]==NULL); 954 954 955 955 if (!(n_IsOne(n,r))) 956 956 { … … 962 962 n_Delete(&n,r); 963 963 } 964 964 965 965 if ((p1==NULL) && (bucket>coef[i]!=NULL)) 966 966 p_Delete(&bucket>coef[i],r); … … 1088 1088 poly spNoether) 1089 1089 { 1090 assume((!rIsPluralRing(bucket>bucket_ring))p_LmEqual(p1,kBucketGetLm(bucket), bucket>bucket_ring)); 1090 assume((!rIsPluralRing(bucket>bucket_ring))p_LmEqual(p1,kBucketGetLm(bucket), bucket>bucket_ring)); 1091 1091 assume(p1 != NULL && 1092 1092 p_DivisibleBy(p1, kBucketGetLm(bucket), bucket>bucket_ring)); … … 1133 1133 //@Viktor, don't ignore coefficients on monomials 1134 1134 if(l1==1) { 1135 1135 1136 1136 //if (rField_is_Q(bucket>bucket_ring)) { 1137 1137 //avoid this for function fields, as gcds are expensive at the moment 1138 1139 1138 1139 1140 1140 coef=p_GetCoeff(a1,bucket>bucket_ring); 1141 1141 lm=p_Mult_nn(lm, coef, bucket>bucket_ring); … … 1147 1147 } 1148 1148 #endif 1149 1149 1150 1150 kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether); 1151 1151 1152 1152 if (backuped) 1153 1153 p_SetCoeff0(a1,coef,bucket>bucket_ring); … … 1157 1157 return rn; 1158 1158 } 1159 static BOOLEAN nIsPseudoUnit(number n, ring r){ 1160 if (rField_is_Zp(r)) 1161 return TRUE; 1162 if (r>parameter==NULL) 1163 { 1164 if (r>cf>nSize(n)==1) 1165 return TRUE; 1166 else 1167 return FALSE; 1168 } 1169 //if (r>parameter!=NULL) 1170 number one=n_Init(1,r); 1171 if (n_Equal(n,one,r)) { 1159 static BOOLEAN nIsPseudoUnit(number n, ring r) 1160 { 1161 if (rField_is_Zp(r)) 1162 return TRUE; 1163 if (r>parameter==NULL) 1164 { 1165 if (r>cf>nSize(n)==1) 1166 return TRUE; 1167 else 1168 return FALSE; 1169 } 1170 //if (r>parameter!=NULL) 1171 number one=n_Init(1,r); 1172 if (n_Equal(n,one,r)) 1173 { 1172 1174 n_Delete(&one,r); 1173 1175 return TRUE; 1174 } 1175 n_Delete(&one,r); 1176 number minus_one=n_Init(1,r); 1177 if (n_Equal(n,minus_one,r)){ 1178 n_Delete(&minus_one,r); 1179 return TRUE; 1180 } 1181 return FALSE; 1176 } 1177 n_Delete(&one,r); 1178 number minus_one=n_Init(1,r); 1179 if (n_Equal(n,minus_one,r)) 1180 { 1181 n_Delete(&minus_one,r); 1182 return TRUE; 1183 } 1184 return FALSE; 1182 1185 } 1183 1186 … … 1207 1210 assume(bucket>buckets[i]==NULL); 1208 1211 } 1209 if ((bucket>buckets[i]!=NULL) && (nIsPseudoUnit(p_GetCoeff(bucket>coef[i],r),r)))1210 1212 if ((bucket>buckets[i]!=NULL) 1213 && (nIsPseudoUnit(p_GetCoeff(bucket>coef[i],r),r))) 1211 1214 return; 1212 1215 } 1213 1216 //return; 1214 1217 1215 1218 number coef=n_Init(0,r); 1216 1219 //ATTENTION: will not work correct for GB over ring … … 1227 1230 assume(bucket>coef[i]!=NULL); 1228 1231 assume(!(n_IsZero(pGetCoeff(bucket>coef[i]),r))); 1229 1230 1232 1231 1233 //in this way it should crash on programming errors, yeah 1232 1234 number temp=nGcd(coef, pGetCoeff(bucket>coef[i]),r); … … 1249 1251 for(i=0;i<=MAX_BUCKET;i++) 1250 1252 { 1251 1252 1253 if (bucket>buckets[i]!=NULL) 1253 1254 {
Note: See TracChangeset
for help on using the changeset viewer.