Ticket #300: fix component check in gcd poly creation and tidied up division checks for ring coefficients.2.patch
File fix component check in gcd poly creation and tidied up division checks for ring coefficients.2.patch, 2.8 KB (added by , 13 years ago) |
---|
-
kernel/kutil.cc
162 162 if (b) return pDivComp_GREATER; 163 163 if (!a & !b) return pDivComp_EQUAL; 164 164 } 165 return 0;165 return pDivComp_INCOMP; 166 166 } 167 167 #endif 168 168 … … 1134 1134 { 1135 1135 compare=pDivCompRing(strat->B[j].lcm,Lp.lcm); 1136 1136 compareCoeff = nDivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(Lp.lcm)); 1137 if (compareCoeff == 0|| compare == compareCoeff)1137 if (compareCoeff == pDivComp_EQUAL || compare == compareCoeff) 1138 1138 { 1139 1139 if (compare == 1) 1140 1140 { … … 2925 2925 // Print("j:%d, Ll:%d\n",j,strat->Ll); 2926 2926 // if (((unsigned long) pGetCoeff(h) % (unsigned long) pGetCoeff(strat->S[j]) != 0) && 2927 2927 // ((unsigned long) pGetCoeff(strat->S[j]) % (unsigned long) pGetCoeff(h) != 0)) 2928 if ( iCompH == pGetComp(strat->S[ k]) )2928 if ( iCompH == pGetComp(strat->S[j]) ) 2929 2929 { 2930 2930 { 2931 2931 if (enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR)) -
kernel/numbers.cc
117 117 118 118 #ifdef HAVE_RINGS 119 119 BOOLEAN ndDivBy(number a, number b) { return TRUE; } // assume a,b !=0 120 int ndDivComp(number a, number b) { return 0; }120 int ndDivComp(number a, number b) { return 2; } 121 121 BOOLEAN ndIsUnit(number a) { return !nIsZero(a); } 122 122 number ndExtGcd (number a, number b, number *s, number *t) { return nInit(1); } 123 123 #endif -
kernel/rintegers.cc
185 185 186 186 int nrzDivComp(number a, number b) 187 187 { 188 if (nrzEqual(a, b)) return 0; 189 if (nrzDivBy(a, b)) return -1; 188 if (nrzDivBy(a, b)) 189 { 190 if (nrzDivBy(b, a)) return 2; 191 return -1; 192 } 190 193 if (nrzDivBy(b, a)) return 1; 191 return 2;194 return 0; 192 195 } 193 196 194 197 BOOLEAN nrzDivBy (number a,number b) -
kernel/rmodulo2m.cc
252 252 { 253 253 if (b % 2 == 1) 254 254 { 255 return 0;255 return 2; 256 256 } 257 257 else 258 258 { -
kernel/rmodulon.cc
286 286 287 287 int nrnDivComp(number a, number b) 288 288 { 289 if (nrnEqual(a, b)) return 0;289 if (nrnEqual(a, b)) return 2; 290 290 if (mpz_divisible_p((int_number) a, (int_number) b)) return -1; 291 291 if (mpz_divisible_p((int_number) b, (int_number) a)) return 1; 292 return 2;292 return 0; 293 293 } 294 294 295 295 number nrnDiv (number a,number b)