Changeset 7964f9c in git


Ignore:
Timestamp:
Feb 22, 2013, 6:07:28 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
53568dfd6864f93c0a03e533c7cd650061dab05969745c12a329a3d82624b53e9fec810e6378365b
Parents:
5693d74c7e74fb28bc22148699aebb6524ded48c
Message:
fix: output and simplifation of rat. fct.: ntGreaterZero and heuristicGcdCancellation
File:
1 edited

Legend:

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

    r5693d7 r7964f9c  
    654654  fraction f = (fraction)a;
    655655  poly g = NUM(f);
    656   return (n_GreaterZero(p_GetCoeff(g, ntRing), ntCoeffs) ||
    657           (!p_LmIsConstant(g, ntRing)));
     656  return (!p_LmIsConstant(g,ntRing)|| n_GreaterZero(pGetCoeff(g), ntCoeffs));
    658657}
    659658
     
    10971096      definiteGcdCancellation(a, cf, TRUE);
    10981097
    1099   // TODO: check if it is enough to put the following into definiteGcdCancellation?!
    1100   if( DEN(f) != NULL )
    1101     if( !n_GreaterZero(pGetCoeff(DEN(f)), ntCoeffs) )
    1102     {
    1103       NUM(f) = p_Neg(NUM(f), ntRing);
    1104       DEN(f) = p_Neg(DEN(f), ntRing);
     1098    // TODO: check if it is enough to put the following into definiteGcdCancellation?!
     1099    if( DEN(f) != NULL )
     1100    {
     1101      if( !n_GreaterZero(pGetCoeff(DEN(f)), ntCoeffs) )
     1102      {
     1103        NUM(f) = p_Neg(NUM(f), ntRing);
     1104        DEN(f) = p_Neg(DEN(f), ntRing);
     1105      }
     1106      if (ntCoeffs->has_simple_Inverse)
     1107      {
     1108        if (!n_IsOne(pGetCoeff(DEN(f)),ntCoeffs))
     1109        {
     1110          number inv=n_Invers(pGetCoeff(DEN(f)),ntCoeffs);
     1111          DEN(f)=p_Mult_nn(DEN(f),inv,ntRing);
     1112          NUM(f)=p_Mult_nn(NUM(f),inv,ntRing);
     1113        }
     1114        if(p_LmIsConstant(DEN(f),ntRing))
     1115        {
     1116          p_Delete(&DEN(f),ntRing);
     1117          COM(f)=0;
     1118        }
     1119      }
    11051120    }
    11061121  }
Note: See TracChangeset for help on using the changeset viewer.