- Timestamp:
- May 18, 2015, 4:07:27 PM (9 years ago)
- Branches:
- (u'spielwiese', '6e5adcba05493683b94648c659a729c189812c77')
- Children:
- 888b7927c89b5d09691595ac2815d18b05ae93cd
- Parents:
- 2329e7bd2c4ad25ed85b80547b94644b22ef85d5
- Location:
- libpolys/polys/templates
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/templates/p_Add_q__T.cc
r2329e7 rc85b30 43 43 n2 = pGetCoeff(q); 44 44 #if 0 45 t = n_Add__T(n1,n2, r );46 n_Delete__T(&n1, r );45 t = n_Add__T(n1,n2, r->cf); 46 n_Delete__T(&n1, r->cf); 47 47 #else 48 n_InpAdd__T(n1,n2,r );48 n_InpAdd__T(n1,n2,r->cf); 49 49 t = n1; 50 50 #endif 51 n_Delete__T(&n2, r );51 n_Delete__T(&n2, r->cf); 52 52 q = p_LmFreeAndNext(q, r); 53 53 54 if (n_IsZero__T(t, r ))54 if (n_IsZero__T(t, r->cf)) 55 55 { 56 56 shorter += 2; 57 n_Delete__T(&t, r );57 n_Delete__T(&t, r->cf); 58 58 p = p_LmFreeAndNext(p, r); 59 59 } -
libpolys/polys/templates/p_Copy__T.cc
r2329e7 rc85b30 24 24 p_AllocBin(pNext(d_p), bin, r); 25 25 pIter(d_p); 26 pSetCoeff0(d_p, n_Copy__T(pGetCoeff(s_p), r ));26 pSetCoeff0(d_p, n_Copy__T(pGetCoeff(s_p), r->cf)); 27 27 // it is better to iter here, 28 28 // for MemCopy advances goes from low to high addresses -
libpolys/polys/templates/p_Delete__T.cc
r2329e7 rc85b30 15 15 while (p != NULL) 16 16 { 17 n_Delete__T(&(p->coef), r );17 n_Delete__T(&(p->coef), r->cf); 18 18 p = p_LmFreeAndNext(p, r); 19 19 } -
libpolys/polys/templates/p_Minus_mm_Mult_qq__T.cc
r2329e7 rc85b30 37 37 38 38 number tm = pGetCoeff(m), // coefficient of m 39 tneg = n_Neg__T(n_Copy__T(tm, r ), r), // - (coefficient of m)39 tneg = n_Neg__T(n_Copy__T(tm, r->cf), r->cf), // - (coefficient of m) 40 40 tb, // used for tm*coeff(a1) 41 41 tc; // used as intermediate number … … 64 64 65 65 Equal: // qm equals p 66 tb = n_Mult__T(pGetCoeff(q), tm, r );66 tb = n_Mult__T(pGetCoeff(q), tm, r->cf); 67 67 #ifdef HAVE_ZERODIVISORS 68 if (!n_IsZero__T(tb,r )) {68 if (!n_IsZero__T(tb,r->cf)) { 69 69 #endif 70 70 tc = pGetCoeff(p); 71 if (!n_Equal__T(tc, tb, r ))71 if (!n_Equal__T(tc, tb, r->cf)) 72 72 { 73 73 shorter++; 74 tc = n_Sub__T(tc, tb, r );75 n_Delete__T(&(pGetCoeff(p)), r );74 tc = n_Sub__T(tc, tb, r->cf); 75 n_Delete__T(&(pGetCoeff(p)), r->cf); 76 76 pSetCoeff0(p,tc); // adjust coeff of p 77 77 a = pNext(a) = p; // append p to result and advance p … … 81 81 { // coeffs are equal, so their difference is 0: 82 82 shorter += 2; 83 n_Delete__T(&tc, r );83 n_Delete__T(&tc, r->cf); 84 84 p = p_LmFreeAndNext(p, r); 85 85 } … … 91 91 } 92 92 #endif 93 n_Delete__T(&tb, r );93 n_Delete__T(&tb, r->cf); 94 94 pIter(q); 95 95 if (q == NULL || p == NULL) goto Finish; // are we done ? … … 100 100 Greater: 101 101 #ifdef HAVE_ZERODIVISORS 102 tb = n_Mult__T(pGetCoeff(q), tneg, r );103 if (!n_IsZero__T(tb,r ))102 tb = n_Mult__T(pGetCoeff(q), tneg, r->cf); 103 if (!n_IsZero__T(tb,r->cf)) 104 104 { 105 105 #endif 106 pSetCoeff0(qm, n_Mult__T(pGetCoeff(q), tneg, r ));106 pSetCoeff0(qm, n_Mult__T(pGetCoeff(q), tneg, r->cf)); 107 107 a = pNext(a) = qm; // append qm to result and advance q 108 108 #ifdef HAVE_ZERODIVISORS … … 112 112 shorter++; 113 113 } 114 n_Delete__T(&tb, r );114 n_Delete__T(&tb, r->cf); 115 115 #endif 116 116 pIter(q); … … 157 157 } 158 158 159 n_Delete__T(&tneg, r );159 n_Delete__T(&tneg, r->cf); 160 160 if (qm != NULL) p_FreeBinAddr(qm, r); 161 161 Shorter = shorter; -
libpolys/polys/templates/p_Mult_mm__T.cc
r2329e7 rc85b30 27 27 DECLARE_LENGTH(const unsigned long length = ri->ExpL_Size); 28 28 const unsigned long* m_e = m->exp; 29 pAssume(!n_IsZero__T(ln,ri ));29 pAssume(!n_IsZero__T(ln,ri->cf)); 30 30 31 31 #ifdef HAVE_ZERODIVISORS … … 35 35 { 36 36 pn = pGetCoeff(p); 37 number tmp = n_Mult__T(ln, pn, ri );37 number tmp = n_Mult__T(ln, pn, ri->cf); 38 38 #ifdef HAVE_ZERODIVISORS 39 if (n_IsZero__T(tmp, ri ))39 if (n_IsZero__T(tmp, ri->cf)) 40 40 { 41 n_Delete__T(&tmp, ri );41 n_Delete__T(&tmp, ri->cf); 42 42 if (before == p) 43 43 { … … 56 56 { 57 57 pSetCoeff0(p, tmp); 58 n_Delete__T(&pn, ri );58 n_Delete__T(&pn, ri->cf); 59 59 p_MemAdd__T(p->exp, m_e, length); 60 60 p_MemAddAdjust__T(p, ri); -
libpolys/polys/templates/p_Mult_nn__T.cc
r2329e7 rc85b30 18 18 LINKAGE poly p_Mult_nn__T(poly p, const number n, const ring r) 19 19 { 20 pAssume(!n_IsZero__T(n,r ));20 pAssume(!n_IsZero__T(n,r->cf)); 21 21 p_Test(p, r); 22 22 … … 28 28 { 29 29 #ifndef HAVE_ZERODIVISORS 30 n_InpMult__T(pGetCoeff(p), n, r );30 n_InpMult__T(pGetCoeff(p), n, r->cf); 31 31 pIter(p); 32 32 #else 33 number tmp = n_Mult__T(n, pGetCoeff(p), r );34 if (!n_IsZero__T(tmp,r ))33 number tmp = n_Mult__T(n, pGetCoeff(p), r->cf); 34 if (!n_IsZero__T(tmp,r->cf)) 35 35 { 36 36 number nc = pGetCoeff(p); 37 37 p_SetCoeff0(p, tmp, r); 38 n_Delete__T(&nc, r );38 n_Delete__T(&nc, r->cf); 39 39 old = p; 40 40 pIter(p); … … 42 42 else 43 43 { 44 n_Delete__T(&tmp, r );44 n_Delete__T(&tmp, r->cf); 45 45 if (old == NULL) 46 46 { -
libpolys/polys/templates/p_Neg__T.cc
r2329e7 rc85b30 20 20 while (p != NULL) 21 21 { 22 pSetCoeff0(p, n_Neg__T(pGetCoeff(p), r ));22 pSetCoeff0(p, n_Neg__T(pGetCoeff(p), r->cf)); 23 23 pIter(p); 24 24 } -
libpolys/polys/templates/p_Numbers.h
r2329e7 rc85b30 16 16 #include <polys/monomials/ring.h> 17 17 18 static FORCE_INLINE number n_Copy_FieldGeneral(number n, const ringr)19 { return n_Copy(n,r ->cf); }18 static FORCE_INLINE number n_Copy_FieldGeneral(number n, const coeffs r) 19 { return n_Copy(n,r); } 20 20 21 static FORCE_INLINE void n_Delete_FieldGeneral(number* p, const ringr)22 { n_Delete(p,r ->cf); }21 static FORCE_INLINE void n_Delete_FieldGeneral(number* p, const coeffs r) 22 { n_Delete(p,r); } 23 23 24 static FORCE_INLINE number n_Mult_FieldGeneral(number n1, number n2, const ringr)25 { return n_Mult(n1, n2, r ->cf); }24 static FORCE_INLINE number n_Mult_FieldGeneral(number n1, number n2, const coeffs r) 25 { return n_Mult(n1, n2, r); } 26 26 27 static FORCE_INLINE number n_Add_FieldGeneral(number n1, number n2, const ringr)28 { return n_Add(n1, n2, r ->cf); }27 static FORCE_INLINE number n_Add_FieldGeneral(number n1, number n2, const coeffs r) 28 { return n_Add(n1, n2, r); } 29 29 30 static FORCE_INLINE BOOLEAN n_IsZero_FieldGeneral(number n, const ringr)31 { return n_IsZero(n, r ->cf); }30 static FORCE_INLINE BOOLEAN n_IsZero_FieldGeneral(number n, const coeffs r) 31 { return n_IsZero(n, r); } 32 32 33 static FORCE_INLINE BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const ringr)34 { return n_Equal(n1, n2, r ->cf); }33 static FORCE_INLINE BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const coeffs r) 34 { return n_Equal(n1, n2, r); } 35 35 36 static FORCE_INLINE number n_Neg_FieldGeneral(number n, const ringr)37 { return n_InpNeg(n, r ->cf); }36 static FORCE_INLINE number n_Neg_FieldGeneral(number n, const coeffs r) 37 { return n_InpNeg(n, r); } 38 38 39 static FORCE_INLINE number n_Sub_FieldGeneral(number n1, number n2, const ringr)40 { return n_Sub(n1, n2, r ->cf); }39 static FORCE_INLINE number n_Sub_FieldGeneral(number n1, number n2, const coeffs r) 40 { return n_Sub(n1, n2, r); } 41 41 42 static FORCE_INLINE void n_InpMult_FieldGeneral(number &n1, number n2, const ringr)43 { n_InpMult(n1, n2, r ->cf); }42 static FORCE_INLINE void n_InpMult_FieldGeneral(number &n1, number n2, const coeffs r) 43 { n_InpMult(n1, n2, r); } 44 44 45 static FORCE_INLINE void n_InpAdd_FieldGeneral(number &n1, number n2, const ringr)46 { n_InpAdd(n1, n2, r ->cf); }45 static FORCE_INLINE void n_InpAdd_FieldGeneral(number &n1, number n2, const coeffs r) 46 { n_InpAdd(n1, n2, r); } 47 47 48 48 #ifdef HAVE_RINGS … … 58 58 #define n_InpMult_RingGeneral(n1, n2, r) n_InpMult_FieldGeneral(n1, n2, r) 59 59 60 static FORCE_INLINE void n_InpAdd_RingGeneral(number &n1, number n2, const ringr)61 { assume( rField_is_Ring(r)); n_InpAdd(n1, n2, r->cf); }60 static FORCE_INLINE void n_InpAdd_RingGeneral(number &n1, number n2, const coeffs r) 61 { assume(nCoeff_is_Ring(r)); n_InpAdd(n1, n2, r); } 62 62 #endif 63 63 … … 67 67 #define n_Delete_FieldZp(n, r) do {} while (0) 68 68 69 static FORCE_INLINE number n_Mult_FieldZp(number n1, number n2, const ringr)70 { STATISTIC(n_Mult); return npMultM(n1, n2, r ->cf); }69 static FORCE_INLINE number n_Mult_FieldZp(number n1, number n2, const coeffs r) 70 { STATISTIC(n_Mult); return npMultM(n1, n2, r); } 71 71 72 72 #ifdef HAVE_NUMSTATS 73 static FORCE_INLINE number n_Add_FieldZp(number n1, number n2, const ringr)74 { STATISTIC(n_Add); const number sum = npAddM(n1, n2, r ->cf);73 static FORCE_INLINE number n_Add_FieldZp(number n1, number n2, const coeffs r) 74 { STATISTIC(n_Add); const number sum = npAddM(n1, n2, r); 75 75 // avoid double counting 76 if( npIsZeroM(sum,r ->cf) ) STATISTIC(n_CancelOut);77 return sum;76 if( npIsZeroM(sum,r) ) STATISTIC(n_CancelOut); 77 return sum; 78 78 } 79 79 #else 80 static FORCE_INLINE number n_Add_FieldZp(number n1, number n2, const ringr)81 { return npAddM(n1, n2, r ->cf); }80 static FORCE_INLINE number n_Add_FieldZp(number n1, number n2, const coeffs r) 81 { return npAddM(n1, n2, r); } 82 82 #endif 83 83 84 84 #ifdef HAVE_NUMSTATS 85 static FORCE_INLINE number n_Sub_FieldZp(number n1, number n2, const ringr)86 { STATISTIC(n_Sub); const number d = npSubM(n1, n2, r ->cf);85 static FORCE_INLINE number n_Sub_FieldZp(number n1, number n2, const coeffs r) 86 { STATISTIC(n_Sub); const number d = npSubM(n1, n2, r); 87 87 // avoid double counting 88 if( npIsZeroM(d,r ->cf) ) STATISTIC(n_CancelOut);88 if( npIsZeroM(d,r) ) STATISTIC(n_CancelOut); 89 89 return d; 90 90 } 91 91 #else 92 static FORCE_INLINE number n_Sub_FieldZp(number n1, number n2, const ringr)93 { return npSubM(n1, n2, r ->cf); }92 static FORCE_INLINE number n_Sub_FieldZp(number n1, number n2, const coeffs r) 93 { return npSubM(n1, n2, r); } 94 94 #endif 95 95 96 static FORCE_INLINE BOOLEAN n_IsZero_FieldZp(number n, const ringr)97 { STATISTIC(n_IsZero); return npIsZeroM(n, r ->cf); }96 static FORCE_INLINE BOOLEAN n_IsZero_FieldZp(number n, const coeffs r) 97 { STATISTIC(n_IsZero); return npIsZeroM(n, r); } 98 98 99 static FORCE_INLINE BOOLEAN n_Equal_FieldZp(number n1, number n2, const ringr)100 { STATISTIC(n_Equal); return npEqualM(n1, n2, r ->cf); }99 static FORCE_INLINE BOOLEAN n_Equal_FieldZp(number n1, number n2, const coeffs r) 100 { STATISTIC(n_Equal); return npEqualM(n1, n2, r); } 101 101 102 static FORCE_INLINE number n_Neg_FieldZp(number n, const ringr)103 { STATISTIC(n_InpNeg); return npNegM(n, r ->cf); }102 static FORCE_INLINE number n_Neg_FieldZp(number n, const coeffs r) 103 { STATISTIC(n_InpNeg); return npNegM(n, r); } 104 104 105 static FORCE_INLINE void n_InpMult_FieldZp(number &n1, number n2, const ringr)106 { STATISTIC(n_InpMult); n1=npMultM(n1, n2, r ->cf); }105 static FORCE_INLINE void n_InpMult_FieldZp(number &n1, number n2, const coeffs r) 106 { STATISTIC(n_InpMult); n1=npMultM(n1, n2, r); } 107 107 108 108 #ifdef HAVE_NUMSTATS 109 static FORCE_INLINE void n_InpAdd_FieldZp(number &n1, number n2, const ringr)109 static FORCE_INLINE void n_InpAdd_FieldZp(number &n1, number n2, const coeffs r) 110 110 { 111 STATISTIC(n_InpAdd); n1=npAddM(n1, n2, r ->cf);111 STATISTIC(n_InpAdd); n1=npAddM(n1, n2, r); 112 112 // avoid double counting 113 if( npIsZeroM(n1,r ->cf) ) STATISTIC(n_CancelOut);113 if( npIsZeroM(n1,r) ) STATISTIC(n_CancelOut); 114 114 } 115 115 #else 116 static FORCE_INLINE void n_InpAdd_FieldZp(number &n1, number n2, const ringr)117 { n1=npAddM(n1, n2, r ->cf); }116 static FORCE_INLINE void n_InpAdd_FieldZp(number &n1, number n2, const coeffs r) 117 { n1=npAddM(n1, n2, r); } 118 118 #endif 119 119 … … 121 121 #include <coeffs/longrat.cc> // for inlining... TODO: fix this Uglyness?!!! 122 122 123 static FORCE_INLINE number n_Copy_FieldQ(number n, const ringr)124 { STATISTIC(n_Copy); return nlCopy(n, r ->cf); }123 static FORCE_INLINE number n_Copy_FieldQ(number n, const coeffs r) 124 { STATISTIC(n_Copy); return nlCopy(n, r); } 125 125 126 static FORCE_INLINE void n_Delete_FieldQ(number* n, const ringr)127 { STATISTIC(n_Delete); nlDelete(n,r ->cf); }126 static FORCE_INLINE void n_Delete_FieldQ(number* n, const coeffs r) 127 { STATISTIC(n_Delete); nlDelete(n,r); } 128 128 129 static FORCE_INLINE number n_Mult_FieldQ(number n1, number n2, const ringr)130 { STATISTIC(n_Mult); return nlMult(n1,n2, r ->cf); }129 static FORCE_INLINE number n_Mult_FieldQ(number n1, number n2, const coeffs r) 130 { STATISTIC(n_Mult); return nlMult(n1,n2, r); } 131 131 132 132 #ifdef HAVE_NUMSTATS 133 static FORCE_INLINE number n_Add_FieldQ(number n1, number n2, const ringr)134 { STATISTIC(n_Add); const number sum = nlAdd(n1, n2, r ->cf);133 static FORCE_INLINE number n_Add_FieldQ(number n1, number n2, const coeffs r) 134 { STATISTIC(n_Add); const number sum = nlAdd(n1, n2, r); 135 135 // avoid double counting 136 if( nlIsZero(sum,r ->cf) ) STATISTIC(n_CancelOut);137 return sum;136 if( nlIsZero(sum,r) ) STATISTIC(n_CancelOut); 137 return sum; 138 138 } 139 139 #else 140 static FORCE_INLINE number n_Add_FieldQ(number n1, number n2, const ringr)141 { return nlAdd(n1, n2, r ->cf); }140 static FORCE_INLINE number n_Add_FieldQ(number n1, number n2, const coeffs r) 141 { return nlAdd(n1, n2, r); } 142 142 #endif 143 143 144 144 #ifdef HAVE_NUMSTATS 145 static FORCE_INLINE number n_Sub_FieldQ(number n1, number n2, const ringr)146 { STATISTIC(n_Sub); const number d = nlSub(n1, n2, r ->cf);145 static FORCE_INLINE number n_Sub_FieldQ(number n1, number n2, const coeffs r) 146 { STATISTIC(n_Sub); const number d = nlSub(n1, n2, r); 147 147 // avoid double counting 148 if( nlIsZero(d,r ->cf) ) STATISTIC(n_CancelOut);148 if( nlIsZero(d,r) ) STATISTIC(n_CancelOut); 149 149 return d; 150 150 } 151 151 #else 152 static FORCE_INLINE number n_Sub_FieldQ(number n1, number n2, const ringr)153 { return nlSub(n1, n2, r ->cf); }152 static FORCE_INLINE number n_Sub_FieldQ(number n1, number n2, const coeffs r) 153 { return nlSub(n1, n2, r); } 154 154 #endif 155 155 156 static FORCE_INLINE BOOLEAN n_IsZero_FieldQ(number n, const ringr)157 { STATISTIC(n_IsZero); return nlIsZero(n, r ->cf); }156 static FORCE_INLINE BOOLEAN n_IsZero_FieldQ(number n, const coeffs r) 157 { STATISTIC(n_IsZero); return nlIsZero(n, r); } 158 158 159 static FORCE_INLINE BOOLEAN n_Equal_FieldQ(number n1, number n2, const ringr)160 { STATISTIC(n_Equal); return nlEqual(n1, n2, r ->cf); }159 static FORCE_INLINE BOOLEAN n_Equal_FieldQ(number n1, number n2, const coeffs r) 160 { STATISTIC(n_Equal); return nlEqual(n1, n2, r); } 161 161 162 static FORCE_INLINE number n_Neg_FieldQ(number n, const ringr)163 { STATISTIC(n_InpNeg); return nlNeg(n, r ->cf); }162 static FORCE_INLINE number n_Neg_FieldQ(number n, const coeffs r) 163 { STATISTIC(n_InpNeg); return nlNeg(n, r); } 164 164 165 static FORCE_INLINE void n_InpMult_FieldQ(number &n1, number n2, const ringr)166 { STATISTIC(n_InpMult); nlInpMult(n1, n2, r ->cf); }165 static FORCE_INLINE void n_InpMult_FieldQ(number &n1, number n2, const coeffs r) 166 { STATISTIC(n_InpMult); nlInpMult(n1, n2, r); } 167 167 168 168 #ifdef HAVE_NUMSTATS 169 static FORCE_INLINE void n_InpAdd_FieldQ(number &n1, number n2, const ring r) 170 { STATISTIC(n_InpAdd); assume(rField_is_Q(r)); nlInpAdd(n1, n2, r->cf); 171 169 static FORCE_INLINE void n_InpAdd_FieldQ(number &n1, number n2, const coeffs r) 170 { STATISTIC(n_InpAdd); assume(nCoeff_is_Q(r)); nlInpAdd(n1, n2, r); 172 171 // avoid double counting 173 if( nlIsZero(n1,r ->cf) ) STATISTIC(n_CancelOut);172 if( nlIsZero(n1,r) ) STATISTIC(n_CancelOut); 174 173 } 175 174 #else 176 static FORCE_INLINE void n_InpAdd_FieldQ(number &n1, number n2, const ringr)177 { nlInpAdd(n1, n2, r ->cf); }175 static FORCE_INLINE void n_InpAdd_FieldQ(number &n1, number n2, const coeffs r) 176 { nlInpAdd(n1, n2, r); } 178 177 #endif 179 178 -
libpolys/polys/templates/p_kBucketSetLm__T.cc
r2329e7 rc85b30 55 55 Greater: 56 56 { 57 if (n_IsZero__T(pGetCoeff(p), r ))57 if (n_IsZero__T(pGetCoeff(p), r->cf)) 58 58 { 59 n_Delete__T(&pGetCoeff(p), r );59 n_Delete__T(&pGetCoeff(p), r->cf); 60 60 pIter(bucket->buckets[j]); 61 61 p_FreeBinAddr(p, r); … … 71 71 number tn = pGetCoeff(p); 72 72 #if 0 73 pSetCoeff0(p, n_Add__T(pGetCoeff(bucket->buckets[i]), tn, r ));74 n_Delete__T(&tn, r );73 pSetCoeff0(p, n_Add__T(pGetCoeff(bucket->buckets[i]), tn, r->cf)); 74 n_Delete__T(&tn, r->cf); 75 75 #else 76 n_InpAdd__T(tn,pGetCoeff(bucket->buckets[i]), r );76 n_InpAdd__T(tn,pGetCoeff(bucket->buckets[i]), r->cf); 77 77 pSetCoeff0(p, tn); 78 78 #endif 79 79 p = bucket->buckets[i]; 80 80 pIter(bucket->buckets[i]); 81 n_Delete__T(&pGetCoeff(p), r );81 n_Delete__T(&pGetCoeff(p), r->cf); 82 82 p_FreeBinAddr(p, r); 83 83 (bucket->buckets_length[i])--; … … 88 88 } 89 89 p = bucket->buckets[j]; 90 if (j > 0 && n_IsZero__T(pGetCoeff(p), r ))90 if (j > 0 && n_IsZero__T(pGetCoeff(p), r->cf)) 91 91 { 92 n_Delete__T(&pGetCoeff(p), r );92 n_Delete__T(&pGetCoeff(p), r->cf); 93 93 pIter(bucket->buckets[j]); 94 94 p_FreeBinAddr(p, r); -
libpolys/polys/templates/pp_Mult_Coeff_mm_DivSelectMult__T.cc
r2329e7 rc85b30 25 25 number n = pGetCoeff(m); 26 26 number nc; 27 pAssume(!n_IsZero__T(n,r ));27 pAssume(!n_IsZero__T(n,r->cf)); 28 28 29 29 spolyrec rp; … … 59 59 q = pNext(q); 60 60 nc = pGetCoeff(p); 61 pSetCoeff0(q, n_Mult__T(n, nc, r ));61 pSetCoeff0(q, n_Mult__T(n, nc, r->cf)); 62 62 p_MemSum__T(q->exp, p->exp, ab_e, length); 63 63 -
libpolys/polys/templates/pp_Mult_Coeff_mm_DivSelect__T.cc
r2329e7 rc85b30 20 20 { 21 21 number n = pGetCoeff(m); 22 pAssume(!n_IsZero__T(n,r ));22 pAssume(!n_IsZero__T(n,r->cf)); 23 23 p_Test(p, r); 24 24 if (p == NULL) return NULL; … … 36 36 q = pNext(q); 37 37 number nc = pGetCoeff(p); 38 pSetCoeff0(q, n_Mult__T(n, nc, r ));38 pSetCoeff0(q, n_Mult__T(n, nc, r->cf)); 39 39 p_MemCopy__T(q->exp, p->exp, length); 40 40 } -
libpolys/polys/templates/pp_Mult_mm_Noether__T.cc
r2329e7 rc85b30 36 36 DECLARE_ORDSGN(const long* ordsgn = ri->ordsgn); 37 37 const unsigned long* m_e = m->exp; 38 pAssume(!n_IsZero__T(ln,ri ));38 pAssume(!n_IsZero__T(ln,ri->cf)); 39 39 pAssume1(p_GetComp(m, ri) == 0 || p_MaxComp(p, ri) == 0); 40 40 int l = 0; … … 54 54 Continue: 55 55 56 n = n_Mult__T(ln, pGetCoeff(p), ri );56 n = n_Mult__T(ln, pGetCoeff(p), ri->cf); 57 57 58 58 #ifdef HAVE_RINGS 59 if(n_IsZero__T(n, ri ))59 if(n_IsZero__T(n, ri->cf)) 60 60 { 61 n_Delete__T(&n, ri );61 n_Delete__T(&n, ri->cf); 62 62 p_FreeBinAddr(r, ri); 63 63 } else -
libpolys/polys/templates/pp_Mult_mm__T.cc
r2329e7 rc85b30 32 32 DECLARE_LENGTH(const unsigned long length = ri->ExpL_Size); 33 33 const unsigned long* m_e = m->exp; 34 pAssume(!n_IsZero__T(ln,ri ));34 pAssume(!n_IsZero__T(ln,ri->cf)); 35 35 pAssume1(p_GetComp(m, ri) == 0 || p_MaxComp(p, ri) == 0); 36 36 number tmp; … … 38 38 do 39 39 { 40 tmp = n_Mult__T(ln, pGetCoeff(p), ri );40 tmp = n_Mult__T(ln, pGetCoeff(p), ri->cf); 41 41 #ifdef HAVE_ZERODIVISORS 42 if (! n_IsZero__T(tmp, ri ))42 if (! n_IsZero__T(tmp, ri->cf)) 43 43 { 44 44 #endif … … 50 50 #ifdef HAVE_ZERODIVISORS 51 51 } 52 else n_Delete__T(&tmp, ri );52 else n_Delete__T(&tmp, ri->cf); 53 53 #endif 54 54 p = pNext(p); -
libpolys/polys/templates/pp_Mult_nn__T.cc
r2329e7 rc85b30 17 17 LINKAGE poly pp_Mult_nn__T(poly p, const number n, const ring r) 18 18 { 19 pAssume(!n_IsZero__T(n,r ));19 pAssume(!n_IsZero__T(n,r->cf)); 20 20 p_Test(p, r); 21 21 if (p == NULL) return NULL; … … 34 34 pIter(q); 35 35 number nc = pGetCoeff(p); 36 pSetCoeff0(q, n_Mult__T(n, nc, r ));36 pSetCoeff0(q, n_Mult__T(n, nc, r->cf)); 37 37 p_MemCopy__T(q->exp, p->exp, length); 38 38 #else 39 39 number nc = pGetCoeff(p); 40 number tmp = n_Mult__T(n, nc, r );41 if (! n_IsZero__T(tmp,r ))40 number tmp = n_Mult__T(n, nc, r->cf); 41 if (! n_IsZero__T(tmp,r->cf)) 42 42 { 43 43 p_AllocBin(pNext(q), bin, r); … … 47 47 } 48 48 else 49 n_Delete__T(&tmp,r );49 n_Delete__T(&tmp,r->cf); 50 50 #endif 51 51 pIter(p);
Note: See TracChangeset
for help on using the changeset viewer.