Ticket #300: fix component check in gcd poly creation and tidied up division checks for ring coefficients.patch

File fix component check in gcd poly creation and tidied up division checks for ring coefficients.patch, 2.8 KB (added by wienand, 12 years ago)

patch to fix component check in gcd poly creation and tidied up division checks for ring coefficients

  • kernel/kutil.cc

     
    162162    if (b) return pDivComp_GREATER;
    163163    if (!a & !b) return pDivComp_EQUAL;
    164164  }
    165   return 0;
     165  return pDivComp_INCOMP;
    166166}
    167167#endif
    168168
     
    11341134  {
    11351135    compare=pDivCompRing(strat->B[j].lcm,Lp.lcm);
    11361136    compareCoeff = nDivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(Lp.lcm));
    1137     if (compareCoeff == 0 || compare == compareCoeff)
     1137    if (compareCoeff == pDivComp_EQUAL || compare == compareCoeff)
    11381138    {
    11391139      if (compare == 1)
    11401140      {
     
    29252925      // Print("j:%d, Ll:%d\n",j,strat->Ll);
    29262926//      if (((unsigned long) pGetCoeff(h) % (unsigned long) pGetCoeff(strat->S[j]) != 0) &&
    29272927//         ((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]) )
    29292929      {
    29302930        {
    29312931          if (enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR))
  • kernel/numbers.cc

     
    117117
    118118#ifdef HAVE_RINGS
    119119BOOLEAN ndDivBy(number a, number b) { return TRUE; } // assume a,b !=0
    120 int ndDivComp(number a, number b) { return 0; }
     120int ndDivComp(number a, number b) { return 2; }
    121121BOOLEAN ndIsUnit(number a) { return !nIsZero(a); }
    122122number  ndExtGcd (number a, number b, number *s, number *t) { return nInit(1); }
    123123#endif
  • kernel/rintegers.cc

     
    185185
    186186int nrzDivComp(number a, number b)
    187187{
    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;
    190192  if (nrzDivBy(b, a)) return 1;
    191   return 2;
     193  return 0;
    192194}
    193195
    194196BOOLEAN nrzDivBy (number a,number b)
  • kernel/rmodulo2m.cc

     
    252252  {
    253253    if (b % 2 == 1)
    254254    {
    255       return 0;
     255      return 2;
    256256    }
    257257    else
    258258    {
  • kernel/rmodulon.cc

     
    286286
    287287int nrnDivComp(number a, number b)
    288288{
    289   if (nrnEqual(a, b)) return 0;
     289  if (nrnEqual(a, b)) return 2;
    290290  if (mpz_divisible_p((int_number) a, (int_number) b)) return -1;
    291291  if (mpz_divisible_p((int_number) b, (int_number) a)) return 1;
    292   return 2;
     292  return 0;
    293293}
    294294
    295295number nrnDiv (number a,number b)