Changeset 2e7132 in git for libpolys/polys


Ignore:
Timestamp:
Apr 29, 2013, 11:37:21 AM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
ccb904bb634d071cbadd5d11141c512313839b46
Parents:
3c2c9540b63c2f11ed9fe4817807c8b3e5034318
Message:
fix: n_Normalize for rat. functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/transext.cc

    r3c2c95 r2e7132  
    183183      number n=pGetCoeff(p);
    184184      n_Test(n,ntCoeffs);
     185      if ((!(SR_HDL(n) & SR_INT))&&(n->s==0))
     186      /* not normalized, just do for the following test*/
     187      {
     188        n_Normalize(pGetCoeff(p),ntCoeffs);
     189        n=pGetCoeff(p);
     190      }
    185191      if (!(SR_HDL(n) & SR_INT))
    186192      {
     
    988994       then both the numerator and the denominator will be divided by the
    989995       GCD of the a_alpha's and the c_beta's (if this GCD is != 1),
    990    (3) if 'a' is - e.g. after having performed steps (1) and (2) - of the
    991        form
    992           (sum_alpha a_alpha * t^alpha)
    993           -----------------------------
    994                         c
    995        with integers a_alpha, and c != 1, then 'a' will be replaced by
    996        (sum_alpha a_alpha/c * t^alpha);
    997996   this procedure does not alter COM(f) (this has to be done by the
    998997   calling procedure);
     
    10041003  assume(!DENIS1(f));
    10051004
    1006   if (!p_IsConstant(DEN(f), ntRing))
    10071005  { /* step (1); see documentation of this procedure above */
    10081006    p_Normalize(NUM(f), ntRing);
     
    10381036    }
    10391037    n_Delete(&lcmOfDenominators, ntCoeffs);
    1040     if (!p_IsConstant(DEN(f), ntRing))
     1038    if (DEN(f)!=NULL)
    10411039    { /* step (2); see documentation of this procedure above */
    10421040      p = NUM(f);
     
    10721070      n_Delete(&gcdOfCoefficients, ntCoeffs);
    10731071    }
    1074   }
    1075   if (p_IsConstant(DEN(f), ntRing) &&
    1076       (!n_IsOne(p_GetCoeff(DEN(f), ntRing), ntCoeffs)))
    1077   { /* step (3); see documentation of this procedure above */
    1078     number inverseOfDen = n_Invers(p_GetCoeff(DEN(f), ntRing), ntCoeffs);
    1079     NUM(f) = p_Mult_nn(NUM(f), inverseOfDen, ntRing);
    1080     n_Delete(&inverseOfDen, ntCoeffs);
    1081     p_Delete(&DEN(f), ntRing);
    1082     DEN(f) = NULL;
    10831072  }
    10841073
Note: See TracChangeset for help on using the changeset viewer.