Changeset 7245240 in git for kernel/kutil.cc
- Timestamp:
- Jul 9, 2008, 10:26:30 AM (16 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 7739c953f47596b385dcf31bc6786a1e3ac94590
- Parents:
- c9c60f894de6f136a5e83377562698e0806b77c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kutil.cc
rc9c60f r7245240 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1. 99 2008-07-08 13:29:46 SingularExp $ */4 /* $Id: kutil.cc,v 1.100 2008-07-09 08:26:30 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 1266 1266 number d, s, t; 1267 1267 assume(i<=strat->sl); 1268 LObject Lp;1269 poly m1, m2, erg,gcd;1268 assume(atR >= 0); 1269 poly m1, m2, gcd; 1270 1270 1271 1271 d = nExtGcd(pGetCoeff(p), pGetCoeff(strat->S[i]), &s, &t); … … 1280 1280 1281 1281 k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing); 1282 1282 while (! kCheckStrongCreation(atR, m1, i, m2, strat) ) 1283 { 1284 memset(&(strat->P), 0, sizeof(strat->P)); 1285 kStratChangeTailRing(strat); 1286 strat->P = *(strat->R[atR]); 1287 p_LmFree(m1, strat->tailRing); 1288 p_LmFree(m2, strat->tailRing); 1289 p_LmFree(gcd, currRing); 1290 k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing); 1291 } 1283 1292 pSetCoeff0(m1, s); 1284 1293 pSetCoeff0(m2, t); 1285 1294 pSetCoeff0(gcd, d); 1286 1287 1295 1288 1296 #ifdef KDEBUG … … 1305 1313 #endif 1306 1314 1307 erg = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(strat->S[i]), m2, strat->tailRing), strat->tailRing); 1308 pNext(gcd) = erg; 1309 pLmDelete(m1); 1310 pLmDelete(m2); 1315 pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(strat->S[i]), m2, strat->tailRing), strat->tailRing); 1316 p_LmDelete(m1, strat->tailRing); 1317 p_LmDelete(m2, strat->tailRing); 1311 1318 1312 1319 #ifdef KDEBUG … … 1322 1329 h.tailRing = strat->tailRing; 1323 1330 int posx; 1324 if (h.p!=NULL) 1325 { 1326 if (TEST_OPT_INTSTRATEGY) 1327 { 1328 h.pCleardenom(); // also does a pContent 1329 } 1330 else 1331 { 1332 h.pNorm(); 1333 } 1331 h.pCleardenom(); 1334 1332 strat->initEcart(&h); 1335 1333 if (strat->Ll==-1) … … 1339 1337 h.sev = pGetShortExpVector(h.p); 1340 1338 h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing); 1341 if (pNext(p) != NULL)1342 {1343 // What does this? (Oliver)1344 // pShallowCopyDeleteProc p_shallow_copy_delete1345 // = pGetShallowCopyDeleteProc(strat->tailRing, new_tailRing);1346 // pNext(p) = p_shallow_copy_delete(pNext(p),1347 // currRing, strat->tailRing, strat->tailRing->PolyBin);1348 }1349 1339 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx); 1350 }1351 1340 return TRUE; 1352 1341 } … … 2633 2622 } 2634 2623 } 2635 2636 #ifdef HAVE_VANGB2637 // initenterzeropairsRing(h, ecart, strat, atR);2638 #endif2639 2624 2640 2625 if (new_pair) chainCritRing(h,ecart,strat); … … 5772 5757 } 5773 5758 5759 #ifdef HAVE_RINGS 5760 /*************************************************************** 5761 * 5762 * Checks, if we can compute the gcd poly / strong pair 5763 * gcd-poly = m1 * R[atR] + m2 * S[atS] 5764 * 5765 ***************************************************************/ 5766 BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat) 5767 { 5768 assume(strat->S_2_R[atS] >= -1 && strat->S_2_R[atS] <= strat->tl); 5769 assume(strat->tailRing != currRing); 5770 5771 poly p1_max = (strat->R[atR])->max; 5772 poly p2_max = (strat->R[strat->S_2_R[atS]])->max; 5773 5774 if ((p1_max != NULL && !p_LmExpVectorAddIsOk(m1, p1_max, strat->tailRing)) || 5775 (p2_max != NULL && !p_LmExpVectorAddIsOk(m2, p2_max, strat->tailRing))) 5776 { 5777 return FALSE; 5778 } 5779 return TRUE; 5780 } 5781 #endif 5782 5774 5783 BOOLEAN kStratChangeTailRing(kStrategy strat, LObject *L, TObject* T, unsigned long expbound) 5775 5784 { … … 5890 5899 if (rField_is_Ring(currRing)) 5891 5900 { 5892 l += 20; // TEMP, TODO OLI5893 5901 l *= 2; 5894 5902 }
Note: See TracChangeset
for help on using the changeset viewer.