- Timestamp:
- Nov 10, 2017, 2:41:08 PM (6 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
- Children:
- d893deb4561cf6de5791862e034cf2cc2b9721ba
- Parents:
- e372c73286071e8cf1bacd857dc4a9e3355bb7df
- Location:
- libpolys/polys
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/p_polys.h
re372c73 r04b7a73 891 891 { 892 892 assume( (p != q) || (p == NULL && q == NULL) ); 893 if (q==NULL) return p; 894 if (p==NULL) return q; 893 895 int shorter; 894 896 return r->p_Procs->p_Add_q(p, q, shorter, r); … … 899 901 { 900 902 assume( (p != q) || (p == NULL && q == NULL) ); 903 if (q==NULL) return p; 904 if (p==NULL) { lp=lq; return q; } 901 905 int shorter; 902 906 poly res = r->p_Procs->p_Add_q(p, q, shorter, r); … … 908 912 static inline poly p_Mult_nn(poly p, number n, const ring r) 909 913 { 914 if (p==NULL) return NULL; 910 915 if (n_IsOne(n, r->cf)) 911 916 return p; … … 914 919 r->p_Procs->p_Delete(&p, r); // NOTE: without p_Delete - memory leak! 915 920 return NULL; 916 } else 921 } 922 else 917 923 return r->p_Procs->p_Mult_nn(p, n, r); 918 924 } … … 922 928 const ring tailRing) 923 929 { 930 assume(p!=NULL); 924 931 #ifndef PDEBUG 925 932 if (lmRing == tailRing) … … 936 943 static inline poly pp_Mult_nn(poly p, number n, const ring r) 937 944 { 945 if (p==NULL) return NULL; 938 946 if (n_IsOne(n, r->cf)) 939 947 return p_Copy(p, r); … … 974 982 static inline poly pp_Mult_mm(poly p, poly m, const ring r) 975 983 { 984 if (p==NULL) return NULL; 976 985 if (p_LmIsConstant(m, r)) 977 986 return __pp_Mult_nn(p, pGetCoeff(m), r); … … 983 992 static inline poly p_Mult_mm(poly p, poly m, const ring r) 984 993 { 994 if (p==NULL) return NULL; 985 995 if (p_LmIsConstant(m, r)) 986 996 return __p_Mult_nn(p, pGetCoeff(m), r); -
libpolys/polys/templates/p_Add_q__T.cc
re372c73 r04b7a73 23 23 int l = pLength(p) + pLength(q); 24 24 #endif 25 assume(p!=NULL && q!=NULL); 25 26 26 // test for trivial cases27 27 Shorter = 0; 28 if (q == NULL) return p;29 if (p == NULL) return q;30 28 31 29 number t, n1, n2; -
libpolys/polys/templates/p_Mult_mm__T.cc
re372c73 r04b7a73 20 20 p_Test(p, ri); 21 21 p_LmTest(m, ri); 22 if (p == NULL) return NULL;23 22 pAssume(m != NULL); 23 assume(p!=NULL); 24 24 poly q = p; 25 25 number ln = pGetCoeff(m); -
libpolys/polys/templates/p_Mult_nn__T.cc
re372c73 r04b7a73 25 25 poly old = NULL; 26 26 #endif 27 while (p != NULL)27 do 28 28 { 29 29 #ifndef HAVE_ZERODIVISORS … … 55 55 } 56 56 #endif 57 } 57 } while (p!=NULL); 58 58 p_Test(q, r); 59 59 return q;
Note: See TracChangeset
for help on using the changeset viewer.