Changeset afda22 in git


Ignore:
Timestamp:
Jun 25, 2012, 2:20:45 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
2fd733aba192da5e453cb9e58df6832aeec5bc60
Parents:
eea50a6525a2aac0c87955d053e79c8e99e44044
Message:
fix: #329, part 1: alg. ext
File:
1 edited

Legend:

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

    reea50a rafda22  
    275275}
    276276
    277 /* TRUE iff (a != 0 and (b == 0 or deg(a) > deg(b))) */
     277/* TRUE iff (a != 0 and (b == 0 or deg(a) > deg(b) or (deg(a)==deg(b) && lc(a)>lc(b))) */
    278278BOOLEAN naGreater(number a, number b, const coeffs cf)
    279279{
    280280  naTest(a); naTest(b);
    281   if (naIsZero(a, cf)) return FALSE;
    282   if (naIsZero(b, cf)) return TRUE;
    283   int aDeg = 0;
    284   if (a != NULL) aDeg = p_Totaldegree((poly)a, naRing);
    285   int bDeg = 0;
    286   if (b != NULL) bDeg = p_Totaldegree((poly)b, naRing);
    287   return (aDeg > bDeg);
     281  if (naIsZero(a, cf))
     282  {
     283    if (naIsZero(b, cf)) return FALSE;
     284    return !n_GreaterZero(pGetCoeff((poly)b),cf);
     285  }
     286  if (naIsZero(b, cf))
     287  {
     288    return n_GreaterZero(pGetCoeff((poly)a),cf);
     289  }
     290  int aDeg = p_Totaldegree((poly)a, naRing);
     291  int bDeg = p_Totaldegree((poly)b, naRing);
     292  if (aDeg>bDeg) return TRUE;
     293  if (aDeg<bDeg) return FALSE;
     294  return n_Greater(pGetCoeff((poly)a),pGetCoeff((poly)b),cf);
    288295}
    289296
Note: See TracChangeset for help on using the changeset viewer.