Changeset cdec33 in git
 Timestamp:
 Apr 7, 2011, 4:33:45 PM (12 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 c0b2e03243dcc8b84e3afb3a38cac55b6bb590c8
 Parents:
 73624c6eb72939321ed403d522f0f94a290bca1a
 Location:
 kernel
 Files:

 3 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 
kernel/longtrans.cc
r73624c6 rcdec33 48 48 BOOLEAN (*nacIsOne)(number a); 49 49 BOOLEAN (*nacGreaterZero)(number a); 50 BOOLEAN (*nacGreater)(number a, number b); 50 51 number (*nacMap)(number); 51 52 … … 102 103 nacIsZero = nacRing>cf>nIsZero; 103 104 nacGreaterZero = nacRing>cf>nGreaterZero; 105 nacGreater = nacRing>cf>nGreater; 104 106 nacIsOne = nacRing>cf>nIsOne; 105 107 nacGcd = nacRing>cf>nGcd; … … 1574 1576 } 1575 1577 1576 1578 /* This method will only consider the numerators of a and b. 1579 Moreover it may return TRUE only if one or both numerators 1580 are zero or if their degrees are equal. Then TRUE is returned iff 1581 coeff(numerator(a)) > coeff(numerator(b)); 1582 In all other cases, FALSE will be returned. */ 1577 1583 BOOLEAN ntGreater (number a, number b) 1578 1584 { 1579 if (ntIsZero(a)) 1580 return FALSE; 1581 if (ntIsZero(b)) 1582 return TRUE; /* a!= 0)*/ 1583 return napDeg(((lnumber)a)>z)>napDeg(((lnumber)b)>z); 1585 int az = 0; int ad = 0; 1586 if (ntIsZero(a)) az = 1; 1587 else ad = napDeg(((lnumber)a)>z); 1588 int bz = 0; int bd = 0; 1589 if (ntIsZero(b)) bz = 1; 1590 else bd = napDeg(((lnumber)b)>z); 1591 1592 if ((az == 1) && (bz == 1)) /* a = b = 0 */ return FALSE; 1593 if (az == 1) /* a = 0, b != 0 */ 1594 { 1595 return (!nacGreaterZero(pGetCoeff(((lnumber)b)>z))); 1596 } 1597 if (bz == 1) /* a != 0, b = 0 */ 1598 { 1599 return (nacGreaterZero(pGetCoeff(((lnumber)a)>z))); 1600 } 1601 if (ad == bd) 1602 return nacGreater(pGetCoeff(((lnumber)a)>z), 1603 pGetCoeff(((lnumber)b)>z)); 1604 return FALSE; 1584 1605 } 1585 1606 
kernel/longtrans.h
r73624c6 rcdec33 118 118 extern BOOLEAN (*nacIsOne)(number a); 119 119 extern BOOLEAN (*nacGreaterZero)(number a); 120 extern BOOLEAN (*nacGreater)(number a, number b); 120 121 extern number (*nacMap)(number); 121 122
Note: See TracChangeset
for help on using the changeset viewer.