Changeset fc58b5b in git for kernel/GBEngine
- Timestamp:
- Oct 21, 2015, 3:44:28 PM (9 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a375377c864dd6ddd5d4e8270041b08ca7acab9f
- Parents:
- 5bd9ec36b87fa8f176a21995de2b56724d67be2d
- Location:
- kernel/GBEngine
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kInline.h
r5bd9ec rfc58b5b 456 456 { 457 457 if (t_p != NULL) 458 459 460 461 458 { 459 p_ProjectiveUnique(t_p, tailRing); 460 pSetCoeff0(p, pGetCoeff(t_p)); 461 } 462 462 else 463 463 { 464 464 #ifdef HAVE_RATGRING 465 465 p_ProjectiveUnique(p, currRing); 466 466 #else 467 467 p_ProjectiveUnique(p, currRing); 468 468 #endif 469 469 } 470 470 } 471 471 } -
kernel/GBEngine/kspoly.cc
r5bd9ec rfc58b5b 161 161 { 162 162 Print(" to: "); PR->wrp(); Print("\n"); 163 //printf("\nt^%i ", PR->ecart);pWrite(pHead(PR->p)); 163 //printf("\nt^%i ", PR->ecart);pWrite(pHead(PR->p)); 164 164 } 165 165 #endif -
kernel/GBEngine/kstd1.cc
r5bd9ec rfc58b5b 362 362 #if ADIDEBUG_NF 363 363 int iii; 364 PrintLn(); 365 PrintS("---------------------------- NEW REDRILOC COMPUTATION ----------------------------"); 366 PrintLn(); 367 PrintS(" The pair h : "); PrintLn(); PrintLn(); 368 PrintS(" p1 = "); p_Write(h->p1,strat->tailRing); PrintLn(); 369 PrintS(" p2 = "); p_Write(h->p2,strat->tailRing); PrintLn(); 370 PrintS(" p = "); p_Write(h->p,strat->tailRing); PrintLn(); 371 PrintLn(); 372 PrintS(" The actual reducer T is: "); 364 PrintS("\n---------------------------- NEW REDRILOC COMPUTATION ----------------------------\n"); 365 PrintS(" The pair h :\n"); 366 PrintS("\n p1 = "); p_Write(h->p1,strat->tailRing); 367 PrintS("\n p2 = "); p_Write(h->p2,strat->tailRing); 368 PrintS("\n p = "); p_Write(h->p,strat->tailRing); 369 PrintS("\n The actual reducer T is: "); 373 370 if(strat->tl<0) 374 371 {PrintS(" Empty.\n");} … … 377 374 for (iii=0;iii<=strat->tl;iii++) 378 375 { 379 PrintLn(); 380 Print(" T[%i] = ",iii);p_Write(strat->T[iii].p,strat->tailRing); 381 PrintLn(); 376 Print("\n T[%i] = ",iii);p_Write(strat->T[iii].p,strat->tailRing); 382 377 } 383 378 } … … 409 404 if (j < 0) 410 405 { 411 #if ADIDEBUG_NF412 printf("\nNone was found. Exit\n");413 #endif414 if (strat->honey) h->SetLength(strat->length_pLength);415 406 // over ZZ: cleanup coefficients by complete reduction with monomials 416 407 postReduceByMon(h, strat); 417 if(h->p == NULL) 408 if(h->p == NULL) 418 409 { 419 410 if (h->lcm!=NULL) pLmDelete(h->lcm); … … 421 412 return 0; 422 413 } 414 if (strat->honey) h->SetLength(strat->length_pLength); 423 415 if(strat->tl >= 0) 424 416 h->i_r1 = strat->tl; … … 455 447 strat->T[i].length < li)) 456 448 && 457 p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], h->GetLmTailRing(), ~h->sev, strat->tailRing) 458 && 449 p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], h->GetLmTailRing(), ~h->sev, strat->tailRing) 450 && 459 451 n_DivBy(h->p->coef,strat->T[i].p->coef,strat->tailRing)) 460 452 #else … … 525 517 strat->fromT = FALSE; 526 518 return -1; 527 519 528 520 #else 529 521 530 522 LObject* h2; 531 523 pWrite(h->p); … … 541 533 if(h->IsNull()) 542 534 { 543 if (h->lcm!=NULL) 535 if (h->lcm!=NULL) 544 536 { 545 537 pLmDelete(h->lcm); … … 849 841 || ((strat->T[j].ecart == ei) 850 842 && (strat->T[j].length < li))) 851 && pLmShortDivisibleBy(strat->T[j].p,strat->sevT[j], H.p, not_sev) 843 && pLmShortDivisibleBy(strat->T[j].p,strat->sevT[j], H.p, not_sev) 852 844 #ifdef HAVE_RINGS 853 845 && (!rField_is_Ring(strat->tailRing) || … … 1666 1658 if (strat->homog && strat->red == redFirst) 1667 1659 if(!idIs0(F) &&(!rField_is_Ring(currRing))) 1668 kStratInitChangeTailRing(strat); 1660 kStratInitChangeTailRing(strat); 1669 1661 #endif 1670 1662 … … 2364 2356 poly pFmon = preIntegerCheck(FCopy, Q); 2365 2357 if(pFmon != NULL) 2366 { 2358 { 2367 2359 idInsertPoly(FCopy, pFmon); 2368 2360 #if ADIDEBUG -
kernel/GBEngine/kstd2.cc
r5bd9ec rfc58b5b 148 148 return j; 149 149 #endif 150 150 151 151 } 152 152 #endif … … 427 427 { 428 428 j = kFindDivisibleByInT(strat, h); 429 if (j < 0) 430 { 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 429 if (j < 0) 430 { 431 // over ZZ: cleanup coefficients by complete reduction with monomials 432 postReduceByMon(h, strat); 433 if(nIsZero(pGetCoeff(h->p))) return 2; 434 j = kFindDivisibleByInT(strat, h); 435 if(j < 0) 436 { 437 if(strat->tl >= 0) 438 h->i_r1 = strat->tl; 439 else 440 h->i_r1 = -1; 441 if (h->GetLmTailRing() == NULL) 442 { 443 if (h->lcm!=NULL) pLmDelete(h->lcm); 444 h->Clear(); 445 return 0; 446 } 447 return 1; 448 } 449 449 } 450 450 #if ADIDEBUG … … 1239 1239 { 1240 1240 if(p_GetComp(h->p,currRing)>strat->syzComp) 1241 1242 1243 1244 1241 { 1242 h->Delete(); 1243 return 0; 1244 } 1245 1245 } 1246 1246 else if (h->t_p!=NULL) 1247 1247 { 1248 1248 if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp) 1249 1250 1251 1252 1249 { 1250 h->Delete(); 1251 return 0; 1252 } 1253 1253 } 1254 1254 } -
kernel/GBEngine/kutil.cc
r5bd9ec rfc58b5b 1208 1208 *if the leading term of r devides lcm(s,p) then (s,p) will not enter B 1209 1209 */ 1210 1210 1211 1211 for(j = strat->Bl;j>=0;j--) 1212 1212 { … … 1351 1351 h.i_r = -1; 1352 1352 if(h.p == NULL) 1353 { 1353 { 1354 1354 if (strat->pairtest==NULL) initPairtest(strat); 1355 1355 strat->pairtest[i] = TRUE; … … 1465 1465 } 1466 1466 #endif 1467 1467 1468 1468 pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(si), m2, strat->tailRing), strat->tailRing); 1469 1469 p_LmDelete(m1, strat->tailRing); … … 4959 4959 return length+1; 4960 4960 if (set[length].FDeg == p->FDeg) 4961 if(set[length].GetpLength() > p->GetpLength()) 4961 if(set[length].GetpLength() > p->GetpLength()) 4962 4962 return length+1; 4963 4963 int i; … … 4970 4970 if(an == en) 4971 4971 return en; 4972 if (set[an].FDeg > p->FDeg) 4972 if (set[an].FDeg > p->FDeg) 4973 4973 return en; 4974 4974 if(set[an].FDeg == p->FDeg) 4975 4975 { 4976 if(set[an].GetpLength() > p->GetpLength()) 4976 if(set[an].GetpLength() > p->GetpLength()) 4977 4977 {return en;} 4978 4978 else … … 5008 5008 an=i; 5009 5009 else 5010 { 5010 { 5011 5011 if(set[i].GetpLength() == p->GetpLength()) 5012 5012 { 5013 if(nGreater(set[i].p->coef, p->p->coef)) 5013 if(nGreater(set[i].p->coef, p->p->coef)) 5014 5014 { 5015 5015 an = i; … … 5028 5028 else 5029 5029 en=i; 5030 } 5030 } 5031 5031 } 5032 5032 } … … 5128 5128 * set[length] is the smallest element in set with respect 5129 5129 * to the ordering-procedure pLmCmp,totaldegree,coefficient 5130 * For the same totaldegree, original pairs (from F) will 5130 * For the same totaldegree, original pairs (from F) will 5131 5131 * be put at the end and smalles coefficents 5132 5132 */ … … 5157 5157 { 5158 5158 number lcset,lcp; 5159 lcset = nCopy(set[an].p->coef);5160 lcp = nCopy(p->p->coef);5159 lcset = pGetCoeff(set[an].p); 5160 lcp = pGetCoeff(p->p); 5161 5161 if(!nGreaterZero(lcset)) 5162 lcset = nInpNeg(lcset); 5162 { 5163 set[an].p=p_Neg(set[an].p,currRing); 5164 if (set[an].t_p!=NULL) 5165 pSetCoeff0(set[an].t_p,pGetCoeff(set[an].p)); 5166 lcset=pGetCoeff(set[an].p); 5167 } 5163 5168 if(!nGreaterZero(lcp)) 5164 lcp = nInpNeg(lcp); 5169 { 5170 p->p=p_Neg(p->p,currRing); 5171 if (p->t_p!=NULL) 5172 pSetCoeff0(p->t_p,pGetCoeff(p->p)); 5173 lcp=pGetCoeff(p->p); 5174 } 5165 5175 if(nGreater(lcset, lcp)) 5166 5176 { 5167 nDelete(&lcset);5168 nDelete(&lcp);5169 5177 return en; 5170 5178 } 5171 5179 else 5172 5180 { 5173 nDelete(&lcset);5174 nDelete(&lcp);5175 5181 return an; 5176 5182 } … … 5185 5191 { 5186 5192 number lcset,lcp; 5187 lcset = nCopy(set[i].p->coef);5188 lcp = nCopy(p->p->coef);5193 lcset = pGetCoeff(set[i].p); 5194 lcp = pGetCoeff(p->p); 5189 5195 if(!nGreaterZero(lcset)) 5190 lcset = nInpNeg(lcset); 5196 { 5197 set[i].p=p_Neg(set[i].p,currRing); 5198 if (set[i].t_p!=NULL) 5199 pSetCoeff0(set[i].t_p,pGetCoeff(set[i].p)); 5200 lcset=pGetCoeff(set[i].p); 5201 } 5191 5202 if(!nGreaterZero(lcp)) 5192 lcp = nInpNeg(lcp); 5203 { 5204 p->p=p_Neg(p->p,currRing); 5205 if (p->t_p!=NULL) 5206 pSetCoeff0(p->t_p,pGetCoeff(p->p)); 5207 lcp=pGetCoeff(p->p); 5208 } 5193 5209 if(nGreater(lcset, lcp)) 5194 5210 { 5195 nDelete(&lcset);5196 nDelete(&lcp);5197 5211 an = i; 5198 5212 } 5199 5213 else 5200 5214 { 5201 nDelete(&lcset);5202 nDelete(&lcp);5203 5215 en = i; 5204 5216 } … … 5233 5245 { 5234 5246 number lcset,lcp; 5235 lcset = nCopy(set[an].p->coef);5236 lcp = nCopy(p->p->coef);5247 lcset = pGetCoeff(set[an].p); 5248 lcp = pGetCoeff(p->p); 5237 5249 if(!nGreaterZero(lcset)) 5238 lcset = nInpNeg(lcset); 5250 { 5251 set[an].p=p_Neg(set[an].p,currRing); 5252 if (set[an].t_p!=NULL) 5253 pSetCoeff0(set[an].t_p,pGetCoeff(set[an].p)); 5254 lcset=pGetCoeff(set[an].p); 5255 } 5239 5256 if(!nGreaterZero(lcp)) 5240 lcp = nInpNeg(lcp); 5257 { 5258 p->p=p_Neg(p->p,currRing); 5259 if (p->t_p!=NULL) 5260 pSetCoeff0(p->t_p,pGetCoeff(p->p)); 5261 lcp=pGetCoeff(p->p); 5262 } 5241 5263 if(nGreater(lcset, lcp)) 5242 5264 { 5243 nDelete(&lcset);5244 nDelete(&lcp);5245 5265 return en; 5246 5266 } 5247 5267 else 5248 5268 { 5249 nDelete(&lcset);5250 nDelete(&lcp);5251 5269 return an; 5252 5270 } … … 5261 5279 { 5262 5280 number lcset,lcp; 5263 lcset = nCopy(set[an].p->coef);5264 lcp = nCopy(p->p->coef);5281 lcset = pGetCoeff(set[i].p); 5282 lcp = pGetCoeff(p->p); 5265 5283 if(!nGreaterZero(lcset)) 5266 lcset = nInpNeg(lcset); 5284 { 5285 set[i].p=p_Neg(set[i].p,currRing); 5286 if (set[i].t_p!=NULL) 5287 pSetCoeff0(set[i].t_p,pGetCoeff(set[i].p)); 5288 lcset=pGetCoeff(set[i].p); 5289 } 5267 5290 if(!nGreaterZero(lcp)) 5268 lcp = nInpNeg(lcp); 5291 { 5292 p->p=p_Neg(p->p,currRing); 5293 if (p->t_p!=NULL) 5294 pSetCoeff0(p->t_p,pGetCoeff(p->p)); 5295 lcp=pGetCoeff(p->p); 5296 } 5269 5297 if(nGreater(lcset, lcp)) 5270 5298 { 5271 nDelete(&lcset);5272 nDelete(&lcp);5273 5299 an = i; 5274 5300 } 5275 5301 else 5276 5302 { 5277 nDelete(&lcset);5278 nDelete(&lcp);5279 5303 en = i; 5280 5304 } … … 8744 8768 if(pLmDivisibleBy(r->m[q],r->m[l]) 8745 8769 #ifdef HAVE_RINGS 8746 && ((rField_is_Ring(currRing) 8770 && ((rField_is_Ring(currRing) 8747 8771 && n_DivBy(r->m[q]->coef, r->m[l]->coef, currRing)) 8748 8772 || !(rField_is_Ring(currRing))) 8749 8773 #endif 8750 && (pLength(r->m[q]) < pLength(r->m[l]) || 8774 && (pLength(r->m[q]) < pLength(r->m[l]) || 8751 8775 (pLength(r->m[q]) == pLength(r->m[l]) && nGreaterZero(r->m[q]->coef)))) 8752 8776 { … … 9013 9037 /*! 9014 9038 used for GB over ZZ: look for constant and monomial elements in the ideal 9015 background: any known constant element of ideal suppresses 9039 background: any known constant element of ideal suppresses 9016 9040 intermediate coefficient swell 9017 9041 */ 9018 9042 poly preIntegerCheck(ideal FOrig, ideal Q) 9019 { 9043 { 9020 9044 assume(nCoeff_is_Ring_Z(currRing->cf)); 9021 9045 if(!nCoeff_is_Ring_Z(currRing->cf)) … … 9050 9074 idSkipZeroes(monred); 9051 9075 posconst = idPosConstant(monred); 9052 //the constant, if found, will be from Q 9076 //the constant, if found, will be from Q 9053 9077 if((posconst != -1) && (!nIsZero(monred->m[posconst]->coef))) 9054 9078 { … … 9080 9104 II->m[i+1] = II->m[i]; 9081 9105 II->m[0] = pOne(); 9082 ideal syz = idSyzygies(II, isNotHomog, NULL); 9106 ideal syz = idSyzygies(II, isNotHomog, NULL); 9083 9107 poly integer = NULL; 9084 9108 for(int i = IDELEMS(syz)-1;i>=0; i--) … … 9109 9133 { 9110 9134 if(idIs0(monred)) 9111 { 9135 { 9112 9136 poly mindegmon = NULL; 9113 9137 for(int i = 0; i<IDELEMS(one); i++) … … 9127 9151 { 9128 9152 for(int i = IDELEMS(II)-1; i>=0; i--) 9129 if(II->m[i] != NULL) 9153 if(II->m[i] != NULL) 9130 9154 II->m[i+1] = II->m[i]; 9131 9155 II->m[0] = mindegmon; … … 9186 9210 /*! 9187 9211 used for GB over ZZ: intermediate reduction by monomial elements 9188 background: any known constant element of ideal suppresses 9212 background: any known constant element of ideal suppresses 9189 9213 intermediate coefficient swell 9190 9214 */ … … 9219 9243 { 9220 9244 ok = TRUE; 9221 } 9245 } 9222 9246 } 9223 9247 pp = pNext(p); … … 9255 9279 /*! 9256 9280 used for GB over ZZ: final reduction by constant elements 9257 background: any known constant element of ideal suppresses 9281 background: any known constant element of ideal suppresses 9258 9282 intermediate coefficient swell and beautifies output 9259 9283 */ … … 9277 9301 p_SetCoeff(p,dummy,currRing); 9278 9302 } 9279 pp = pNext(p); 9303 pp = pNext(p); 9280 9304 if((pp == NULL) && (nIsZero(p->coef))) 9281 9305 {
Note: See TracChangeset
for help on using the changeset viewer.