Changeset 8222d6 in git
- Timestamp:
- Sep 9, 2016, 2:42:40 PM (7 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- dd930e594c1cd299f2e2b78fe5444de64aede28a
- Parents:
- bebd5a0361ed499fa0769cad9424e1bb193acd7c
- Location:
- libpolys/polys/monomials
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/p_polys.cc
rbebd5a0 r8222d6 4708 4708 #include <polys/templates/p_Delete__T.cc> 4709 4709 4710 /***************************************************************/ 4711 /* 4712 * compare the leading terms of a and b 4713 */ 4714 static int tCompare(const poly a, const poly b, const ring R) 4715 { 4716 if (b == NULL) return(a != NULL); 4717 if (a == NULL) return(-1); 4718 4719 /* a != NULL && b != NULL */ 4720 int r = p_LmCmp(a, b,R); 4721 if (r != 0) return(r); 4722 number h = n_Sub(pGetCoeff(a), pGetCoeff(b),R->cf); 4723 r = -1 + n_IsZero(h,R->cf) + 2*n_GreaterZero(h,R->cf); /* -1: <, 0:==, 1: > */ 4724 n_Delete(&h,R->cf); 4725 return(r); 4726 } 4727 4728 /* 4729 * compare a and b 4730 */ 4731 int p_Compare(const poly a, const poly b, const ring R) 4732 { 4733 int r = tCompare(a, b,R); 4734 if (r != 0) return(r); 4735 4736 poly aa = a; 4737 poly bb = b; 4738 while (r == 0 && aa != NULL && bb != NULL) 4739 { 4740 pIter(aa); 4741 pIter(bb); 4742 r = tCompare(aa, bb,R); 4743 } 4744 return(r); 4745 } 4746 -
libpolys/polys/monomials/p_polys.h
rbebd5a0 r8222d6 2021 2021 /// shifts components of the vector p by i 2022 2022 void p_Shift (poly * p,int i, const ring r); 2023 /*----------------------------------------------------*/ 2024 2025 int p_Compare(const poly a, const poly b, const ring R); 2023 2026 #endif // P_POLYS_H 2024 2027
Note: See TracChangeset
for help on using the changeset viewer.