Changeset 4567e8e in git


Ignore:
Timestamp:
Feb 20, 2017, 12:19:50 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1d8b37332905599d7dd138313bbc02aff3627905
Parents:
def3b20bda0f43d4d4bd310a2976c396c69d0bd7
Message:
fix: tr. #779
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • Tst/Short/ok_s.lst

    rdef3b2 r4567e8e  
    6868bug_tr774
    6969bug_tr778
     70bug_tr779
    7071bug_genus_etc
    7172conv_bi
  • libpolys/polys/ext_fields/transext.cc

    rdef3b2 r4567e8e  
    781781}
    782782
    783 /* this method will only consider the numerator of a, without cancelling
    784    the gcd before;
    785    returns TRUE iff the leading coefficient of the numerator of a is > 0
    786                     or the leading term of the numerator of a is not a
    787                     constant */
     783/* return FALSE, if a is a constant <=0 */
    788784static BOOLEAN ntGreaterZero(number a, const coeffs cf)
    789785{
     
    796792}
    797793
    798 /* This method will only consider the numerators of a and b, without
    799    cancelling gcd's before.
    800    Moreover it may return TRUE only if one or both numerators
    801    are zero or if their degrees are equal. Then TRUE is returned iff
    802    coeff(numerator(a)) > coeff(numerator(b));
    803    In all other cases, FALSE will be returned. */
    804794static BOOLEAN ntGreater(number a, number b, const coeffs cf)
    805795{
     
    812802  number bNumCoeff = NULL; int bNumDeg = 0;
    813803  number bDenCoeff = NULL; int bDenDeg = 0;
    814   if (!IS0(a))
     804  if (IS0(a))
     805  {
     806    if (IS0(b)) return FALSE;
     807    fraction fb = (fraction)b;
     808    return (!n_GreaterZero(pGetCoeff(NUM(fb)), ntCoeffs));
     809  }
     810  if (IS0(b))
    815811  {
    816812    fraction fa = (fraction)a;
    817     aNumDeg = p_Totaldegree(NUM(fa), ntRing);
    818     aNumCoeff = p_GetCoeff(NUM(fa), ntRing);
    819     if (DEN(fa)!=NULL)
    820     {
    821       aDenDeg = p_Totaldegree(DEN(fa), ntRing);
    822       aDenCoeff=p_GetCoeff(DEN(fa),ntRing);
    823     }
    824   }
    825   else return !(ntGreaterZero (b,cf));
    826   if (!IS0(b))
    827   {
    828     fraction fb = (fraction)b;
    829     bNumDeg = p_Totaldegree(NUM(fb), ntRing);
    830     bNumCoeff = p_GetCoeff(NUM(fb), ntRing);
    831     if (DEN(fb)!=NULL)
    832     {
    833       bDenDeg = p_Totaldegree(DEN(fb), ntRing);
    834       bDenCoeff=p_GetCoeff(DEN(fb),ntRing);
    835     }
    836   }
    837   else return ntGreaterZero(a,cf);
     813    return (n_GreaterZero(pGetCoeff(NUM(fa)), ntCoeffs));
     814  }
     815  // now: a!=0, b!=0
     816  fraction fa = (fraction)a;
     817  aNumDeg = p_Totaldegree(NUM(fa), ntRing);
     818  aNumCoeff = p_GetCoeff(NUM(fa), ntRing);
     819  if (DEN(fa)!=NULL)
     820  {
     821    aDenDeg = p_Totaldegree(DEN(fa), ntRing);
     822    aDenCoeff=p_GetCoeff(DEN(fa),ntRing);
     823  }
     824  fraction fb = (fraction)b;
     825  bNumDeg = p_Totaldegree(NUM(fb), ntRing);
     826  bNumCoeff = p_GetCoeff(NUM(fb), ntRing);
     827  if (DEN(fb)!=NULL)
     828  {
     829    bDenDeg = p_Totaldegree(DEN(fb), ntRing);
     830    bDenCoeff=p_GetCoeff(DEN(fb),ntRing);
     831  }
    838832  if (aNumDeg-aDenDeg > bNumDeg-bDenDeg) return TRUE;
    839833  if (aNumDeg-aDenDeg < bNumDeg-bDenDeg) return FALSE;
Note: See TracChangeset for help on using the changeset viewer.