Changeset e21795 in git for kernel/GBEngine/kutil.cc
- Timestamp:
- May 26, 2016, 4:07:09 PM (8 years ago)
- Branches:
- (u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
- Children:
- 7510bb63f9801836a7bf75aa5ffc7e82b8cec4fed6e0c0fd81f7fba2ec29faa8a27186e0133b2293
- Parents:
- c21def206345e194f51f5b0d9c86daf757b940f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kutil.cc
rc21def re21795 355 355 h = pNext(p); 356 356 357 loop 358 { 359 if (h==NULL) 360 { 361 p_Delete(&pNext(p), r); 362 if (!inNF) 363 { 364 number eins; 365 if (rField_is_Ring(r) /*&& (rHasLocalOrMixedOrdering(r))*/) 366 eins = nCopy(lc); 367 else 368 eins=nInit(1); 369 if (L->p != NULL) 370 { 371 pSetCoeff(L->p,eins); 372 if (L->t_p != NULL) 373 pSetCoeff0(L->t_p,eins); 374 } 375 else 376 pSetCoeff(L->t_p,eins); 377 /* p and t_p share the same coeff, if both are !=NULL */ 378 /* p==NULL==t_p cannot happen here */ 379 } 380 L->ecart = 0; 381 L->length = 1; 382 //if (L->pLength > 0) 383 L->pLength = 1; 384 L->max = NULL; 385 386 if (L->t_p != NULL && pNext(L->t_p) != NULL) 387 p_Delete(&pNext(L->t_p),r); 388 if (L->p != NULL && pNext(L->p) != NULL) 389 pNext(L->p) = NULL; 390 391 return; 392 } 393 i = 0; 357 #ifdef HAVE_RINGS 358 if(rField_is_Ring(currRing)) 359 { 394 360 loop 395 361 { 396 i++; 397 if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide 398 if (i == r->N) break; // does divide, try next monom 399 } 400 //wrp(p); PrintS(" divide ");wrp(h); PrintLn(); 401 #ifdef HAVE_RINGS 402 // Note: As long as qring j forbidden if j contains integer (i.e. ground rings are 403 // domains), no zerodivisor test needed CAUTION 404 #if ADIDEBUG 405 pWrite(h); 406 #endif 407 if (rField_is_Ring(r) && !n_DivBy(pGetCoeff(h),lc,r->cf)) 408 { 362 if (h==NULL) 363 { 364 p_Delete(&pNext(p), r); 365 if (!inNF) 366 { 367 number eins= nCopy(lc); 368 if (L->p != NULL) 369 { 370 pSetCoeff(L->p,eins); 371 if (L->t_p != NULL) 372 pSetCoeff0(L->t_p,eins); 373 } 374 else 375 pSetCoeff(L->t_p,eins); 376 /* p and t_p share the same coeff, if both are !=NULL */ 377 /* p==NULL==t_p cannot happen here */ 378 } 379 L->ecart = 0; 380 L->length = 1; 381 //if (L->pLength > 0) 382 L->pLength = 1; 383 L->max = NULL; 384 385 if (L->t_p != NULL && pNext(L->t_p) != NULL) 386 p_Delete(&pNext(L->t_p),r); 387 if (L->p != NULL && pNext(L->p) != NULL) 388 pNext(L->p) = NULL; 389 390 return; 391 } 392 i = 0; 393 loop 394 { 395 i++; 396 if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide 397 if (i == r->N) break; // does divide, try next monom 398 } 399 //wrp(p); PrintS(" divide ");wrp(h); PrintLn(); 400 // Note: As long as qring j forbidden if j contains integer (i.e. ground rings are 401 // domains), no zerodivisor test needed CAUTION 409 402 #if ADIDEBUG 410 p rintf("\nDoes not divide\n");403 pWrite(h); 411 404 #endif 412 return; 413 } 414 #if ADIDEBUG 415 printf("\nDivides. Go On\n"); 416 #endif 417 #endif 418 pIter(h); 405 if (!n_DivBy(pGetCoeff(h),lc,r->cf)) 406 { 407 #if ADIDEBUG 408 printf("\nDoes not divide\n"); 409 #endif 410 return; 411 } 412 #if ADIDEBUG 413 printf("\nDivides. Go On\n"); 414 #endif 415 pIter(h); 416 } 417 } 418 else 419 #endif 420 { 421 loop 422 { 423 if (h==NULL) 424 { 425 p_Delete(&pNext(p), r); 426 if (!inNF) 427 { 428 number eins=nInit(1); 429 if (L->p != NULL) 430 { 431 pSetCoeff(L->p,eins); 432 if (L->t_p != NULL) 433 pSetCoeff0(L->t_p,eins); 434 } 435 else 436 pSetCoeff(L->t_p,eins); 437 /* p and t_p share the same coeff, if both are !=NULL */ 438 /* p==NULL==t_p cannot happen here */ 439 } 440 L->ecart = 0; 441 L->length = 1; 442 //if (L->pLength > 0) 443 L->pLength = 1; 444 L->max = NULL; 445 446 if (L->t_p != NULL && pNext(L->t_p) != NULL) 447 p_Delete(&pNext(L->t_p),r); 448 if (L->p != NULL && pNext(L->p) != NULL) 449 pNext(L->p) = NULL; 450 451 return; 452 } 453 i = 0; 454 loop 455 { 456 i++; 457 if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide 458 if (i == r->N) break; // does divide, try next monom 459 } 460 //wrp(p); PrintS(" divide ");wrp(h); PrintLn(); 461 pIter(h); 462 } 419 463 } 420 464 } … … 5220 5264 #endif 5221 5265 5266 #ifdef HAVE_RINGS 5222 5267 int posInL11Ringls (const LSet set, const int length, 5223 5268 LObject* p,const kStrategy strat) … … 5301 5346 } 5302 5347 } 5303 5348 #endif 5304 5349 5305 5350 /*2 Position for rings L: Here I am … … 6068 6113 } 6069 6114 } 6115 #ifdef HAVE_RINGS 6070 6116 else 6071 6117 { … … 6090 6136 } 6091 6137 } 6138 #endif 6092 6139 // if called from NF, T objects do not exist: 6093 6140 if (strat->tl < 0 || strat->S_2_R[j] == -1) … … 6135 6182 } 6136 6183 } 6184 #ifdef HAVE_RINGS 6137 6185 else 6138 6186 { … … 6163 6211 } 6164 6212 } 6213 #endif 6165 6214 } 6166 6215 } … … 8078 8127 * puts p to the set T at position atT 8079 8128 */ 8129 #ifdef HAVE_RINGS 8080 8130 void enterT_strong(LObject &p, kStrategy strat, int atT) 8081 8131 { 8132 assume(rField_is_Ring(currRing)); 8082 8133 int i; 8083 8134 … … 8157 8208 strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev); 8158 8209 #if 1 8159 if(rField_is_Ring(currRing) 8160 && rHasLocalOrMixedOrdering(currRing) 8210 if(rHasLocalOrMixedOrdering(currRing) 8161 8211 && !n_IsUnit(p.p->coef, currRing->cf)) 8162 8212 { … … 8185 8235 kTest_T(&(strat->T[atT])); 8186 8236 } 8187 8237 #endif 8188 8238 8189 8239 /*2 … … 8279 8329 if (TEST_OPT_SB_1) 8280 8330 strat->chainCrit=chainCritOpt_1; 8281 #ifdef HAVE_RINGS 8331 #ifdef HAVE_RINGS 8282 8332 if (rField_is_Ring(currRing)) 8283 8333 { … … 8356 8406 strat->syzCrit = syzCriterion; 8357 8407 } 8358 #ifdef HAVE_RINGS 8408 #ifdef HAVE_RINGS 8359 8409 if (rField_is_Ring(currRing)) 8360 8410 { … … 8775 8825 else if (BTEST1(12) || BTEST1(14) || BTEST1(16) || BTEST1(18)) 8776 8826 strat->posInT = posInT1; 8827 #ifdef HAVE_RINGS 8777 8828 if (rField_is_Ring(currRing)) 8778 8829 { … … 8782 8833 strat->posInT = posInT11; 8783 8834 } 8835 #endif 8784 8836 strat->posInLDependsOnLength = FALSE; 8785 8837 strat->posInLSba = posInLSig; … … 8920 8972 ) 8921 8973 { 8922 8923 8974 for(q=IDELEMS(Q)-1; q>=0;q--) 8924 8975 { … … 8942 8993 } 8943 8994 } 8995 #ifdef HAVE_RINGS 8944 8996 else 8945 8997 { … … 8975 9027 } 8976 9028 } 8977 9029 #endif 8978 9030 } 8979 9031 else … … 9019 9071 for(q=IDELEMS(Q)-1; q>=0;q--) 9020 9072 { 9021 if( !rField_is_Ring(currRing) ||n_DivBy(r->m[l]->coef, Q->m[q]->coef, currRing))9073 if(n_DivBy(r->m[l]->coef, Q->m[q]->coef, currRing)) 9022 9074 { 9023 9075 if ((Q->m[q]!=NULL)&&(pLmEqual(Q->m[q],r->m[l])) && pDivisibleBy(Q->m[q],r->m[l])) … … 9044 9096 if (/*TEST_OPT_REDSB &&*/ reduction_found) 9045 9097 { 9098 #ifdef HAVE_RINGS 9046 9099 if(rField_is_Ring(currRing)) 9047 9100 { … … 9075 9128 } 9076 9129 else 9130 #endif 9077 9131 { 9078 9132 for (l=IDELEMS(r)-1;l>=0;l--) … … 9349 9403 return TRUE; 9350 9404 } 9405 #endif 9406 9407 #ifdef HAVE_RINGS 9351 9408 /*! 9352 9409 used for GB over ZZ: look for constant and monomial elements in the ideal … … 9514 9571 return NULL; 9515 9572 } 9516 9573 #endif 9574 9575 #ifdef HAVE_RINGS 9517 9576 /*! 9518 9577 used for GB over ZZ: intermediate reduction by monomial elements … … 9583 9642 strat->initEcart(h); 9584 9643 } 9585 9644 #endif 9645 9646 #ifdef HAVE_RINGS 9586 9647 /*! 9587 9648 used for GB over ZZ: final reduction by constant elements … … 9653 9714 //idSkipZeroes(strat->Shdl); 9654 9715 } 9655 9656 9716 #endif 9657 9717
Note: See TracChangeset
for help on using the changeset viewer.