Changeset 88cceb in git


Ignore:
Timestamp:
Jul 12, 2014, 5:56:31 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
642a254c3cd9870d56e7587e48237a9649b595d38f0728edc2d87e260893c1b9a488d65023bb0d2e
Parents:
b5d9340ceee76456a2eb1298e4089c556634b9e7
Message:
fix: n_Lcm is not n_NormalizeHelper
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/syzextra/syzextra.cc

    rb5d934 r88cceb  
    824824      const number& lc2 = p_GetCoeff(pp, r);
    825825
    826       number g = n_Lcm( lc1, lc2, r );
     826      number g = n_Lcm( lc1, lc2, r->cf );
    827827
    828828      p_SetCoeff0(m ,       n_Div(g, lc1, r), r);
  • kernel/fglm/fglmvec.cc

    rb5d934 r88cceb  
    507507    {
    508508      isZero = FALSE;
    509       number temp = n_Lcm (theLcm, rep->getconstelem (i), currRing->cf);
     509      number temp = n_NormalizeHelper (theLcm, rep->getconstelem (i), currRing->cf);
    510510      nDelete (&theLcm);
    511511      theLcm = temp;
  • libpolys/coeffs/README.coeffs

    rb5d934 r88cceb  
    6666-cfParDeg (otherwise: -1 for 0, 0 for non-zero)
    6767-cfParameter (otherwise: error)
    68 -cfInit_bigint (otherwise: error)
    6968
    7069automatic:
     
    7473to describe:
    7574-cfLcm
     75-cfNormalizeHelper
    7676-cfQuotRem
    7777-cfRandom
  • libpolys/coeffs/coeffs.h

    rb5d934 r88cceb  
    251251   number  (*cfQuotRem)(number a, number b, number *rem, const coeffs r);
    252252   number  (*cfLcm)(number a, number b, const coeffs r);
     253   number  (*cfNormalizeHelper)(number a, number b, const coeffs r);
    253254   void    (*cfDelete)(number * a, const coeffs r);
    254255
     
    674675/// in Z/nZ, Z/2^kZ: computed as in the case Z
    675676/// in Z/pZ, C, R: not implemented
    676 /// in Q: return the lcm of the numerators of 'a' and the denominator of 'b'
    677677/// in K(a)/<p(a)>: not implemented
    678678/// in K(t_1, ..., t_n): not implemented
    679679static inline number n_Lcm(number a, number b, const coeffs r)
    680680{ assume(r != NULL); assume(r->cfLcm!=NULL); return r->cfLcm(a,b,r); }
     681
     682/// assume that r is a quotient field (otherwise, return 1)
     683/// for arguments (a1/a2,b1/b2) return (lcm(a1,b2)/1)
     684static inline number n_NormalizeHelper(number a, number b, const coeffs r)
     685{ assume(r != NULL); assume(r->cfNormalizeHelper!=NULL); return r->cfNormalizeHelper(a,b,r); }
    681686
    682687/// set the mapping function pointers for translating numbers from src to dst
  • libpolys/coeffs/longrat.cc

    rb5d934 r88cceb  
    12521252* returns in result->z the lcm(a->z,b->n)
    12531253*/
    1254 number nlLcm(number a, number b, const coeffs r)
     1254number nlNormalizeHelper(number a, number b, const coeffs r)
    12551255{
    12561256  number result;
     
    30913091  r->cfGetNumerator = nlGetNumerator;
    30923092  r->cfExtGcd = nlExtGcd; // only for ring stuff and Z
    3093   r->cfLcm  = nlLcm;
     3093  r->cfNormalizeHelper  = nlNormalizeHelper;
    30943094  r->cfDelete= nlDelete;
    30953095  r->cfSetMap = nlSetMap;
  • libpolys/coeffs/longrat.h

    rb5d934 r88cceb  
    106106number   nlGcd(number a, number b, const coeffs r);
    107107number nlExtGcd(number a, number b, number *s, number *t, const coeffs);
    108 number   nlLcm(number a, number b, const coeffs r);   /*special routine !*/
     108number   nlNormalizeHelper(number a, number b, const coeffs r);   /*special routine !*/
    109109BOOLEAN  nlGreater(number a, number b, const coeffs r);
    110110BOOLEAN  nlIsMOne(number a, const coeffs r);
  • libpolys/coeffs/numbers.cc

    rb5d934 r88cceb  
    331331    n->cfNormalize=ndNormalize;
    332332    n->cfGcd  = ndGcd;
     333    n->cfNormalizeHelper  = ndGcd; /* tricky, isn't it ?*/
    333334    n->cfLcm  = ndGcd; /* tricky, isn't it ?*/
    334335    n->cfInitMPZ = ndInitMPZ;
     
    430431    assume(n->cfGetNumerator!=NULL);
    431432    assume(n->cfGcd!=NULL);
    432     assume(n->cfLcm!=NULL);
     433    assume(n->cfNormalizeHelper!=NULL);
    433434    assume(n->cfDelete!=NULL);
    434435    assume(n->cfSetMap!=NULL);
  • libpolys/polys/coeffrings.h

    rb5d934 r88cceb  
    3838static inline number n_ExactDiv(number a, number b, const ring r){ return n_ExactDiv(a,b, r->cf);}
    3939static inline number n_Gcd(number a, number b, const ring r){ return n_Gcd(a,b, r->cf);}
    40 static inline number n_Lcm(number a, number b, const ring r){ return n_Lcm(a,b, r->cf);}
    4140
    4241#ifdef HAVE_RINGS
  • libpolys/polys/ext_fields/algext.cc

    rb5d934 r88cceb  
    101101number   naGetNumerator(number &a, const coeffs cf);
    102102number   naGcd(number a, number b, const coeffs cf);
    103 //number   naLcm(number a, number b, const coeffs cf);
    104103int      naSize(number a, const coeffs cf);
    105104void     naDelete(number *a, const coeffs cf);
     
    642641}
    643642#endif
    644 number napLcm(number b, const coeffs cf)
     643number napNormalizeHelper(number b, const coeffs cf)
    645644{
    646645  number h=n_Init(1,naRing->cf);
     
    649648  while(bb!=NULL)
    650649  {
    651     d=n_Lcm(h,pGetCoeff(bb), naRing->cf);
     650    d=n_NormalizeHelper(h,pGetCoeff(bb), naRing->cf);
    652651    n_Delete(&h,naRing->cf);
    653652    h=d;
     
    667666  {
    668667    a=(number)p_Copy((poly)a,naRing);
    669     number t=napLcm(b,cf);
     668    number t=napNormalizeHelper(b,cf);
    670669    if(!n_IsOne(t,naRing->cf))
    671670    {
     
    12841283          while (c_n!=NULL)
    12851284          { // each monom: coeff in Q
    1286             d=n_Lcm(hzz,pGetCoeff(c_n),r->cf->extRing->cf);
     1285            d=n_NormalizeHelper(hzz,pGetCoeff(c_n),r->cf->extRing->cf);
    12871286            n_Delete(&hzz,r->cf->extRing->cf);
    12881287            hzz=d;
     
    14611460#endif
    14621461  cf->cfGcd          = naGcd;
    1463   cf->cfLcm          = naLcmContent;
     1462  cf->cfNormalizeHelper          = naLcmContent;
    14641463  cf->cfSize         = naSize;
    14651464  cf->nCoeffIsEqual  = naCoeffIsEqual;
     
    16391638#endif
    16401639  cf->cfGcd          = naGcd;
    1641   cf->cfLcm          = naLcmContent;
     1640  cf->cfNormalizeHelper          = naLcmContent;
    16421641  cf->cfSize         = naSize;
    16431642  cf->nCoeffIsEqual  = naCoeffIsEqual;
  • libpolys/polys/ext_fields/transext.cc

    rb5d934 r88cceb  
    126126number   ntGetNumerator(number &a, const coeffs cf);
    127127number   ntGcd(number a, number b, const coeffs cf);
    128 number   ntLcm(number a, number b, const coeffs cf);
     128number   ntNormalizeHelper(number a, number b, const coeffs cf);
    129129int      ntSize(number a, const coeffs cf);
    130130void     ntDelete(number * a, const coeffs cf);
     
    11131113    number c; number tmp;
    11141114    poly p = NUM(f);
    1115     /* careful when using n_Lcm!!! It computes the lcm of the numerator
     1115    /* careful when using n_NormalizeHelper!!! It computes the lcm of the numerator
    11161116       of the 1st argument and the denominator of the 2nd!!! */
    11171117    while (p != NULL)
    11181118    {
    11191119      c = p_GetCoeff(p, ntRing);
    1120       tmp = n_Lcm(lcmOfDenominators, c, ntCoeffs);
     1120      tmp = n_NormalizeHelper(lcmOfDenominators, c, ntCoeffs);
    11211121      n_Delete(&lcmOfDenominators, ntCoeffs);
    11221122      lcmOfDenominators = tmp;
     
    11271127    {
    11281128      c = p_GetCoeff(p, ntRing);
    1129       tmp = n_Lcm(lcmOfDenominators, c, ntCoeffs);
     1129      tmp = n_NormalizeHelper(lcmOfDenominators, c, ntCoeffs);
    11301130      n_Delete(&lcmOfDenominators, ntCoeffs);
    11311131      lcmOfDenominators = tmp;
     
    14961496}
    14971497
    1498 number ntLcm(number a, number b, const coeffs cf)
     1498number ntNormalizeHelper(number a, number b, const coeffs cf)
    14991499{
    15001500  ntTest(a);
     
    22912291      else
    22922292      {
    2293         number g = n_Lcm(d, pGetCoeff(den), Q);
     2293        number g = n_NormalizeHelper(d, pGetCoeff(den), Q);
    22942294        n_Delete(&d, Q); d = g;
    22952295      }
     
    24372437  //cf->cfGcd          = ntGcd_dummy;
    24382438  cf->cfSubringGcd   = ntGcd;
    2439   cf->cfLcm          = ntLcm;
     2439  cf->cfNormalizeHelper = ntNormalizeHelper;
    24402440  cf->cfSize         = ntSize;
    24412441  cf->nCoeffIsEqual  = ntCoeffIsEqual;
  • libpolys/polys/monomials/p_polys.cc

    rb5d934 r88cceb  
    23292329          while (c_n!=NULL)
    23302330          { // each monom: coeff in Q
    2331             d=n_Lcm(h,pGetCoeff(c_n),r->cf->extRing->cf);
     2331            d=n_NormalizeHelper(h,pGetCoeff(c_n),r->cf->extRing->cf);
    23322332            n_Delete(&h,r->cf->extRing->cf);
    23332333            h=d;
     
    27642764    {
    27652765      n_Normalize(pGetCoeff(p),r->cf);
    2766       d=n_Lcm(h,pGetCoeff(p),r->cf);
     2766      d=n_NormalizeHelper(h,pGetCoeff(p),r->cf);
    27672767      n_Delete(&h,r->cf);
    27682768      h=d;
     
    29042904    {
    29052905      n_Normalize(pGetCoeff(p),r->cf);
    2906       d=n_Lcm(h,pGetCoeff(p),r->cf);
     2906      d=n_NormalizeHelper(h,pGetCoeff(p),r->cf);
    29072907      n_Delete(&h,r->cf);
    29082908      h=d;
     
    29402940          while (p!=NULL)
    29412941          {
    2942             d=n_Lcm(h,pGetCoeff(p),r->cf);
     2942            d=n_NormalizeHelper(h,pGetCoeff(p),r->cf);
    29432943            n_Delete(&h,r->cf);
    29442944            h=d;
Note: See TracChangeset for help on using the changeset viewer.