Changeset 8e8744 in git


Ignore:
Timestamp:
Nov 12, 2022, 6:37:40 PM (3 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
7afda2f3c573a61d019acbe60473bfe15eda6636c3c704ae428df052f1a454e90db10d6be4c5b98e
Parents:
4969bd84679f00e0090770de53eae064004f1330
Message:
fix: (number)0 is not valid for generic cf
Location:
kernel/GBEngine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r4969bd8 r8e8744  
    43254325#ifdef HAVE_RINGS
    43264326/*2
    4327 * Generates spoly(0, h) if applicable. Assumes ring in Z/2^n.
     4327* Generates spoly(0, h) if applicable. Assumes ring has zero divisors
    43284328*/
    43294329void enterExtendedSpoly(poly h,kStrategy strat)
     
    43314331  if (nIsOne(pGetCoeff(h))) return;
    43324332  number gcd;
     4333  number zero=n_Init(0,currRing->cf);
    43334334  bool go = false;
    4334   if (n_DivBy((number) 0, pGetCoeff(h), currRing->cf))
     4335  if (n_DivBy(zero, pGetCoeff(h), currRing->cf))
    43354336  {
    43364337    gcd = n_Ann(pGetCoeff(h),currRing->cf);
     
    43384339  }
    43394340  else
    4340     gcd = n_Gcd((number) 0, pGetCoeff(h), strat->tailRing->cf);
     4341    gcd = n_Gcd(zero, pGetCoeff(h), strat->tailRing->cf);
    43414342  if (go || !nIsOne(gcd))
    43424343  {
     
    43504351    p_Test(p,strat->tailRing);
    43514352    p = __pp_Mult_nn(p, gcd, strat->tailRing);
    4352     nDelete(&gcd);
    43534353
    43544354    if (p != NULL)
     
    44074407    }
    44084408  }
     4409  nDelete(&zero);
    44094410  nDelete(&gcd);
    44104411}
     
    44144415  if (nIsOne(pGetCoeff(h))) return;
    44154416  number gcd;
     4417  number zero=n_Init(0,currRing->cf);
    44164418  bool go = false;
    4417   if (n_DivBy((number) 0, pGetCoeff(h), currRing->cf))
     4419  if (n_DivBy(zero, pGetCoeff(h), currRing->cf))
    44184420  {
    44194421    gcd = n_Ann(pGetCoeff(h),currRing->cf);
     
    44214423  }
    44224424  else
    4423     gcd = n_Gcd((number) 0, pGetCoeff(h), strat->tailRing->cf);
     4425    gcd = n_Gcd(zero, pGetCoeff(h), strat->tailRing->cf);
    44244426  if (go || !nIsOne(gcd))
    44254427  {
     
    44774479          p_Delete(&Lp.sig,currRing);Lp.sig = NULL;
    44784480          strat->sigdrop = FALSE;
    4479           return;
    44804481        }
    44814482        else
     
    44854486          strat->enterS(Lp,0,strat,strat->tl);
    44864487          #endif
    4487           return;
    4488         }
    4489 
     4488        }
     4489        nDelete(&zero);
     4490        nDelete(&gcd);
     4491        return;
    44904492      }
    44914493      #else
     
    45214523      }
    45224524    }
    4523     nDelete(&gcd);
    45244525  }
    45254526  nDelete(&gcd);
     4527  nDelete(&zero);
    45264528}
    45274529#endif
  • kernel/GBEngine/ringgb.cc

    r4969bd8 r8e8744  
    181181
    182182/*2
    183 * Generates spoly(0, h) if applicable. Assumes ring in Z/2^n.
     183* Generates spoly(0, h) if applicable. Assumes ring has zero divisors
    184184*/
    185185poly plain_zero_spoly(poly h)
    186186{
    187187  poly p = NULL;
    188   number gcd = n_Gcd((number) 0, pGetCoeff(h), currRing->cf);
     188  number zero=n_Init(0,currRing->cf);
     189  number gcd = n_Gcd(zero, pGetCoeff(h), currRing->cf);
    189190  if (!n_IsOne( gcd,  currRing->cf ))
    190191  {
     
    194195    n_Delete(&tmp,currRing->cf);
    195196  }
     197   n_Delete(&zero,currRing->cf);
    196198  return p;
    197199}
Note: See TracChangeset for help on using the changeset viewer.