Changeset 2933bb in git for Singular/kstd2.cc
- Timestamp:
- Sep 27, 1999, 2:52:49 PM (25 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
- Children:
- b4b8d2106fa7d6bd9e9fafab0fa53237e4f97fea
- Parents:
- 01e06d33e7200c899a77268319368b290f9abec3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/kstd2.cc
r01e06d r2933bb 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.2 7 1999-07-14 13:16:06 SingularExp $ */4 /* $Id: kstd2.cc,v 1.28 1999-09-27 12:52:49 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 31 31 // #include "timer.h" 32 32 33 #define HAVE_HOMOG_T 34 33 35 /*2 34 36 * consider the part above syzComp: … … 85 87 wrp(h->p); 86 88 } 89 i = 0; 90 j = 0; 87 91 loop 88 92 { 93 #ifdef HAVE_HOMOG_T 94 if (pDivisibleBy(strat->T[i].p,(*h).p)) 95 { 96 if ((!exchanged) && (pEqual((*h).p,strat->T[j].p))) 97 { 98 j = 0; 99 while (j<= strat->sl) 100 { 101 if (strat->S[j] == strat->T[i].p) break; 102 j++; 103 } 104 if (j > strat->sl) goto NOTFOUND; 105 #else 89 106 if (pDivisibleBy(strat->S[j],(*h).p)) 90 107 { 91 108 if ((!exchanged) && (pEqual((*h).p,strat->S[j]))) 92 109 { 110 #endif 93 111 q = kFromInput(strat->S[j],strat); 94 112 if (q!=NULL) … … 105 123 strat->S[j] = (*h).p; 106 124 (*h).p = p; 125 #ifndef HAVE_HOMOG_T 107 126 while ((i<=strat->tl) && (strat->T[i].p!=p)) i++; 127 #endif 108 128 if (i<=strat->tl) strat->T[i].p = strat->S[j]; 109 for (i=0;i<=strat->Ll;i++) 110 { 111 if (strat->L[i].p1==p) strat->L[i].p1=strat->S[j]; 112 if (strat->L[i].p2==p) strat->L[i].p2=strat->S[j]; 129 int k; 130 for (k=0;k<=strat->Ll;k++) 131 { 132 if (strat->L[k].p1==p) strat->L[k].p1=strat->S[j]; 133 if (strat->L[k].p2==p) strat->L[k].p2=strat->S[j]; 113 134 } 114 135 } … … 121 142 wrp(strat->S[j]); 122 143 } 144 #ifdef HAVE_HOMOG_T 145 (*h).p = spSpolyRed(strat->T[i].p,(*h).p,strat->kNoether, 146 strat->spSpolyLoop); 147 #else 123 148 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether, 124 149 strat->spSpolyLoop); 150 #endif 125 151 if (TEST_OPT_DEBUG) 126 152 { … … 136 162 } 137 163 /*- try to reduce the s-polynomial -*/ 164 #ifdef HAVE_HOMOG_T 165 i = 0; 166 #else 138 167 j = 0; 168 #endif 139 169 } 140 170 else 141 171 { 172 #ifdef HAVE_HOMOG_T 173 NOTFOUND: 174 if (i >= strat->tl) 175 #else 142 176 if (j >= strat->sl) 177 #endif 143 178 { 144 179 if (exchanged) … … 173 208 return; 174 209 } 210 #ifdef HAVE_HOMOG_T 211 i++; 212 #else 175 213 j++; 214 #endif 176 215 } 177 216 } … … 183 222 */ 184 223 224 // #define HAVE_HOMOG_T 225 185 226 static void redHomog (LObject* h,kStrategy strat) 186 227 { … … 197 238 loop 198 239 { 240 #ifdef HAVE_HOMOG_T 241 if (pDivisibleBy1(strat->T[j].p,(*h).p)) 242 #else 199 243 if (pDivisibleBy1(strat->S[j],(*h).p)) 244 #endif 200 245 { 201 246 //if (strat->interpt) test_int_std(strat->kIdeal); … … 206 251 wrp(h->p); 207 252 PrintS(" with "); 253 #ifdef HAVE_HOMOG_T 254 wrp(strat->T[j].p); 255 #else 208 256 wrp(strat->S[j]); 209 } 257 #endif 258 } 259 #ifdef HAVE_HOMOG_T 260 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, 261 strat->spSpolyLoop); 262 #else 210 263 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether, 211 264 strat->spSpolyLoop); 265 #endif 212 266 if (TEST_OPT_DEBUG) 213 267 { … … 228 282 else 229 283 { 284 #ifdef HAVE_HOMOG_T 285 if (j >= strat->tl) 286 #else 230 287 if (j >= strat->sl) 231 { 232 enterTBba((*h),strat->tl+1,strat); 288 #endif 289 { 290 if (TEST_OPT_INTSTRATEGY && strat->homog) 291 { 292 pCleardenom(h->p); 293 enterTBba((*h), strat->posInT(strat->T,strat->tl,(*h)), strat); 294 } 295 else 296 enterTBba((*h),strat->tl+1,strat); 233 297 return; 234 298 } … … 242 306 loop 243 307 { 308 #ifdef HAVE_HOMOG_T 309 if (pDivisibleBy2(strat->T[j].p,(*h).p)) 310 #else 244 311 if (pDivisibleBy2(strat->S[j],(*h).p)) 312 #endif 245 313 { 246 314 //if (strat->interpt) test_int_std(strat->kIdeal); … … 251 319 wrp(h->p); 252 320 PrintS(" with "); 321 #ifdef HAVE_HOMOG_T 322 wrp(strat->T[j].p); 323 #else 253 324 wrp(strat->S[j]); 254 } 325 #endif 326 } 327 #ifdef HAVE_HOMOG_T 328 (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether, 329 strat->spSpolyLoop); 330 #else 255 331 (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether, 256 332 strat->spSpolyLoop); 333 #endif 257 334 if (TEST_OPT_DEBUG) 258 335 { … … 273 350 else 274 351 { 352 #ifdef HAVE_HOMOG_T 353 if (j >= strat->tl) 354 #else 275 355 if (j >= strat->sl) 276 { 277 enterTBba((*h),strat->tl+1,strat); 356 #endif 357 { 358 if (TEST_OPT_INTSTRATEGY && strat->homog) 359 { 360 pCleardenom(h->p); 361 enterTBba((*h), strat->posInT(strat->T,strat->tl,(*h)), strat); 362 } 363 else 364 enterTBba((*h),strat->tl+1,strat); 278 365 return; 279 366 } … … 284 371 } 285 372 373 #ifdef KEEP_GARBAGE 286 374 /*2 287 375 * reduction procedure for the homogeneous case … … 386 474 else 387 475 { 476 #ifdef HAVE_HOMOG_T 388 477 if (j >= strat->tl) 478 #else 479 if (j >= strat->sl) 480 #endif 389 481 { 390 482 //pContent((*h).p); … … 458 550 if (at <= strat->Ll) 459 551 { 552 #ifdef HAVE_HOMOG_T 553 i=strat->tl+1; 554 #else 460 555 i=strat->sl+1; 556 #endif 461 557 do 462 558 { … … 468 564 } 469 565 } 470 while (!pDivisibleBy1(strat->S[i],(*h).p)); 566 #ifdef HAVE_HOMOG_T 567 } while (!pDivisibleBy1(strat->T[i],(*h).p)); 568 #else 569 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 570 #endif 471 571 if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at); 472 572 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 498 598 } 499 599 } 600 601 #endif // KEEP_GARBAGE 500 602 501 603 /*2 … … 638 740 { 639 741 /*test if h is already standardbasis element*/ 742 #ifdef HAVE_HOMOG_T 743 i=strat->tl+1; 744 #else 640 745 i=strat->sl+1; 746 #endif 641 747 do 642 748 { … … 648 754 return; 649 755 } 756 #ifdef HAVE_HOMOG_T 757 } while (!pDivisibleBy1(strat->T[i].p,(*h).p)); 758 #else 650 759 } while (!pDivisibleBy1(strat->S[i],(*h).p)); 760 #endif 761 651 762 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 652 763 if (TEST_OPT_DEBUG) … … 900 1011 else if (strat->honey) 901 1012 strat->red = redHoney; 1013 #ifdef KEEP_GARBAGE 902 1014 else if (pLexOrder && !strat->homog) 903 1015 strat->red = redLazy; 904 1016 else if (TEST_OPT_INTSTRATEGY && strat->homog) 905 1017 strat->red = redHomog0; 1018 #endif 906 1019 else 907 1020 strat->red = redHomog;
Note: See TracChangeset
for help on using the changeset viewer.