Changeset 7245240 in git
- Timestamp:
- Jul 9, 2008, 10:26:30 AM (15 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 7739c953f47596b385dcf31bc6786a1e3ac94590
- Parents:
- c9c60f894de6f136a5e83377562698e0806b77c5
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kInline.cc
rc9c60f r7245240 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: kInline.cc,v 1. 9 2007-08-07 11:36:46 SingularExp $9 * Version: $Id: kInline.cc,v 1.10 2008-07-09 08:26:29 wienand Exp $ 10 10 *******************************************************************/ 11 11 #ifndef KINLINE_CC … … 1000 1000 p_Setm(m2, tailRing); 1001 1001 p_Setm(lcm, leadRing); 1002 return TRUE;1003 1004 false_return:1005 p_LmFree(m1, tailRing);1006 p_LmFree(m2, tailRing);1007 m1 = m2 = NULL;1008 return FALSE;1009 1002 } 1010 1003 #endif -
kernel/kstd2.cc
rc9c60f r7245240 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.6 8 2008-07-08 13:02:21 SingularExp $ */4 /* $Id: kstd2.cc,v 1.69 2008-07-09 08:26:29 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 297 297 loop 298 298 { 299 #ifdef HAVE_VANGB300 #ifdef HAVE_RING2TOM301 zeroPoly = kFindDivisibleByZeroPoly(h);302 if (zeroPoly != NULL)303 {304 if (TEST_OPT_PROT)305 {306 PrintS("z");307 }308 #ifdef KDEBUG309 if (TEST_OPT_DEBUG)310 {311 PrintS("zero red: ");312 }313 #endif314 LObject tmp_h(zeroPoly, currRing, strat->tailRing);315 tmp_h.SetShortExpVector();316 strat->initEcart(&tmp_h);317 tmp_h.sev = pGetShortExpVector(tmp_h.p);318 tmp_h.SetpFDeg();319 320 enterT(tmp_h, strat, strat->tl + 1);321 j = strat->tl;322 }323 else324 #endif325 #endif326 {327 299 j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h); 328 300 if (j < 0) return 1; … … 333 305 } 334 306 #endif 335 }336 307 #ifdef KDEBUG 337 308 if (TEST_OPT_DEBUG) … … 344 315 345 316 ksReducePoly(h, &(strat->T[j]), NULL, NULL, strat); 346 #ifdef HAVE_VANGB347 #ifdef HAVE_RING2TOM348 if (zeroPoly != NULL)349 {350 // TODO Free memory of zeropoly and last element of L351 strat->tl--;352 }353 #endif354 #endif355 317 356 318 #ifdef KDEBUG … … 1210 1172 enterT(strat->P, strat); 1211 1173 #ifdef HAVE_RINGS 1212 #ifdef HAVE_VANGB1213 int at_R = strat->tl;1214 #endif1215 1174 if (rField_is_Ring(currRing)) 1216 1175 superenterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl); … … 1221 1180 if ((!TEST_OPT_IDLIFT) || (pGetComp(strat->P.p) <= strat->syzComp)) 1222 1181 { 1223 #ifdef HAVE_VANGB1224 strat->enterS(strat->P, pos, strat, at_R);1225 #else1226 1182 strat->enterS(strat->P, pos, strat, strat->tl); 1227 #endif1228 1183 } 1229 1184 else -
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 } -
kernel/kutil.h
rc9c60f r7245240 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1.3 6 2008-07-04 16:17:15 motsakExp $ */6 /* $Id: kutil.h,v 1.37 2008-07-09 08:26:30 wienand Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 604 604 // FALSE, otherwise 605 605 BOOLEAN kCheckSpolyCreation(LObject* L, kStrategy strat, poly &m1, poly &m2); 606 #ifdef HAVE_RINGS 607 // return TRUE if gcdpoly creation of R[atR] and S[atS] does not violate 608 // exponent bound of strat->tailRing 609 // FALSE, otherwise 610 BOOLEAN kCheckStrongCreation(int atR, poly m1, int atS, poly m2, kStrategy strat); 611 #endif 606 612 // change strat->tailRing and adjust all data in strat, L, and T: 607 613 // new tailRing has larger exponent bound
Note: See TracChangeset
for help on using the changeset viewer.