Changeset cdec33 in git for kernel/longalg.cc
 Timestamp:
 Apr 7, 2011, 4:33:45 PM (12 years ago)
 Branches:
 (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
 Children:
 c0b2e03243dcc8b84e3afb3a38cac55b6bb590c8
 Parents:
 73624c6eb72939321ed403d522f0f94a290bca1a
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/longalg.cc
r73624c6 rcdec33 66 66 n>nIsMOne = naIsMOne; 67 67 n>nGreaterZero = naGreaterZero; 68 n>nGreater = naGreater; 68 69 n>cfWrite = naWrite; 69 70 n>nRead = naRead; … … 99 100 nIsMOne = naIsMOne; 100 101 nGreaterZero = naGreaterZero; 102 nGreater = naGreater; 101 103 nRead = naRead; 102 104 nPower = naPower; … … 174 176 nacIsZero = nacRing>cf>nIsZero; 175 177 nacGreaterZero = nacRing>cf>nGreaterZero; 178 nacGreater = nacRing>cf>nGreater; 176 179 nacIsOne = nacRing>cf>nIsOne; 177 180 nacGcd = nacRing>cf>nGcd; … … 737 740 738 741 742 /* This method will only consider the numerators of a and b. 743 Moreover it may return TRUE only if one or both numerators 744 are zero or if their degrees are equal. Then TRUE is returned iff 745 coeff(numerator(a)) > coeff(numerator(b)); 746 In all other cases, FALSE will be returned. */ 739 747 BOOLEAN naGreater (number a, number b) 740 748 { 741 if (naIsZero(a)) 742 return FALSE; 743 if (naIsZero(b)) 744 return TRUE; /* a!= 0)*/ 745 return napDeg(((lnumber)a)>z)>napDeg(((lnumber)b)>z); 749 int az = 0; int ad = 0; 750 if (naIsZero(a)) az = 1; 751 else ad = napDeg(((lnumber)a)>z); 752 int bz = 0; int bd = 0; 753 if (naIsZero(b)) bz = 1; 754 else bd = napDeg(((lnumber)b)>z); 755 756 if ((az == 1) && (bz == 1)) /* a = b = 0 */ return FALSE; 757 if (az == 1) /* a = 0, b != 0 */ 758 { 759 return (!nacGreaterZero(pGetCoeff(((lnumber)b)>z))); 760 } 761 if (bz == 1) /* a != 0, b = 0 */ 762 { 763 return (nacGreaterZero(pGetCoeff(((lnumber)a)>z))); 764 } 765 if (ad == bd) 766 return nacGreater(pGetCoeff(((lnumber)a)>z), 767 pGetCoeff(((lnumber)b)>z)); 768 return FALSE; 746 769 } 747 770
Note: See TracChangeset
for help on using the changeset viewer.