Changeset a3bc95e in git for Singular/p_Minus_mm_Mult_qq__T.cc
- Timestamp:
- Oct 9, 2001, 6:36:27 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 7497ef3773fc1afff892546445b1d82b1cf0fb05
- Parents:
- e58c4abd91b68d128331a23f3f9dd76dff924048
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/p_Minus_mm_Mult_qq__T.cc
re58c4a ra3bc95e 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Minus_mm_Mult_qq__T.cc,v 1. 2 2001-08-27 14:47:25Singular Exp $9 * Version: $Id: p_Minus_mm_Mult_qq__T.cc,v 1.3 2001-10-09 16:36:14 Singular Exp $ 10 10 *******************************************************************/ 11 11 … … 16 16 * Destroys: p 17 17 * Const: m, q 18 * 18 * 19 19 ***************************************************************/ 20 20 LINKAGE poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int& Shorter, const poly spNoether, const ring r, poly &last) … … 31 31 // we are done if q == NULL || m == NULL 32 32 if (q == NULL || m == NULL) return p; 33 33 34 34 spolyrec rp; 35 35 poly a = &rp, // collects the result … … 50 50 const unsigned long* m_e = m->exp; 51 51 omBin bin = r->PolyBin; 52 52 53 53 if (p == NULL) goto Finish; // return tneg*q if (p == NULL) 54 54 55 55 pAssume(p_GetComp(q, r) == 0 || p_GetComp(m, r) == 0); 56 56 … … 60 60 p_MemSum(qm->exp, q->exp, m_e, length); 61 61 p_MemAddAdjust(qm, r); 62 63 CmpTop: 62 63 CmpTop: 64 64 // compare qm = m*q and p w.r.t. monomial ordering 65 65 p_MemCmp(qm->exp, p->exp, length, ordsgn, goto Equal, goto Greater, goto Smaller ); 66 66 67 67 Equal: // qm equals p 68 68 tb = n_Mult(pGetCoeff(q), tm, r); … … 78 78 } 79 79 else 80 { // coeffs are equal, so their difference is 0: 80 { // coeffs are equal, so their difference is 0: 81 81 shorter += 2; 82 82 n_Delete(&tc, r); … … 88 88 // no, so update qm 89 89 goto SumTop; 90 90 91 91 92 92 Greater: … … 97 97 { 98 98 qm = NULL; 99 goto Finish; 99 goto Finish; 100 100 } 101 // construct new qm 101 // construct new qm 102 102 goto AllocTop; 103 104 Smaller: 103 104 Smaller: 105 105 a = pNext(a) = p;// append p to result and advance p 106 106 pIter(p); 107 107 if (p == NULL) goto Finish; 108 108 goto CmpTop; 109 109 110 110 111 111 Finish: // q or p is NULL: Clean-up time … … 129 129 pSetCoeff0(m, tm); 130 130 } 131 131 132 132 n_Delete(&tneg, r); 133 133 if (qm != NULL) p_FreeBinAddr(qm, r); … … 135 135 p_Test(pNext(&rp), r); 136 136 return pNext(&rp); 137 } 137 }
Note: See TracChangeset
for help on using the changeset viewer.