Changeset c66a53 in git for kernel/GBEngine/kspoly.cc
- Timestamp:
- Jul 16, 2016, 9:42:28 AM (8 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
- Children:
- b6f42a8c2492312d1dd4f0c4c917fcf054636416
- Parents:
- 1798a00a38186e92d8d8d6dc786ccdf6aad508cd34183abab486cee38d70559e5cdcfbc307938f64
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kspoly.cc
r34183a rc66a53 22 22 #include <kernel/polys.h> 23 23 #endif 24 25 #define ADIDEBUG 0 24 26 25 27 #ifdef KDEBUG … … 180 182 kStrategy strat) 181 183 { 184 #if ADIDEBUG 185 printf("\nksReducePolySig\n"); 186 pWrite(PR->p);pWrite(PR->sig); 187 pWrite(PW->p);pWrite(PW->sig); 188 #endif 182 189 #ifdef KDEBUG 183 190 red_count++; … … 235 242 #endif 236 243 p_ExpVectorAddSub(sigMult,PR->GetLmCurrRing(),PW->GetLmCurrRing(),currRing); 244 //I have also to set the leading coeficient for sigMult (in the case of rings) 245 if(rField_is_Ring(currRing)) 246 { 247 pSetCoeff(sigMult,nMult(nDiv(pGetCoeff(PR->p),pGetCoeff(PW->p)), pGetCoeff(sigMult))); 248 } 237 249 //#if 1 238 250 #ifdef DEBUGF5 … … 244 256 printf("--------------\n"); 245 257 #endif 246 int sigSafe = p_LmCmp(PR->sig,sigMult,currRing); 258 int sigSafe; 259 if(!rField_is_Ring(currRing)) 260 sigSafe = p_LmCmp(PR->sig,sigMult,currRing); 247 261 // now we can delete the copied polynomial data used for checking for 248 262 // sig-safeness of the reduction step … … 252 266 253 267 #endif 268 if(rField_is_Ring(currRing)) 269 { 270 // Set the sig 271 poly origsig = pCopy(PR->sig); 272 PR->sig = pHead(pSub(PR->sig, sigMult)); 273 //The sigs have the same lm, have to substract 274 //It may happen that now the signature is 0 (drop) 275 if(PR->sig == NULL) 276 { 277 #if ADIDEBUG 278 printf("\nPossible sigdrop in ksreducepolysig (lost signature)\n"); 279 #endif 280 strat->sigdrop=TRUE; 281 } 282 else 283 { 284 if(pLtCmp(PR->sig,origsig) == 1) 285 { 286 // do not allow this reduction - it will increase it's signature 287 // and the partially standard basis is just till the old sig, not the new one 288 PR->is_redundant = TRUE; 289 pDelete(&PR->sig); 290 PR->sig = origsig; 291 strat->blockred++; 292 return 3; 293 } 294 if(pLtCmp(PR->sig,origsig) == -1) 295 { 296 #if ADIDEBUG 297 printf("\nSigdrop in ksreducepolysig from * to *\n");pWrite(origsig);pWrite(PR->sig); 298 #endif 299 strat->sigdrop=TRUE; 300 } 301 } 302 pDelete(&origsig); 303 } 254 304 //pDelete(&f1); 255 pDelete(&sigMult);256 305 // go on with the computations only if the signature of p2 is greater than the 257 306 // signature of fm*p1 258 if(sigSafe != 1 )307 if(sigSafe != 1 && !rField_is_Ring(currRing)) 259 308 { 260 309 PR->is_redundant = TRUE; … … 324 373 } 325 374 } 326 327 375 // take care of coef buisness 328 if (! n_IsOne(pGetCoeff(p2), tailRing)) 329 { 330 number bn = pGetCoeff(lm); 331 number an = pGetCoeff(p2); 332 int ct = ksCheckCoeff(&an, &bn, tailRing->cf); // Calculate special LC 333 p_SetCoeff(lm, bn, tailRing); 334 if ((ct == 0) || (ct == 2)) 335 PR->Tail_Mult_nn(an); 336 if (coef != NULL) *coef = an; 337 else n_Delete(&an, tailRing); 376 if(rField_is_Ring(currRing)) 377 { 378 p_SetCoeff(lm, nDiv(pGetCoeff(lm),pGetCoeff(p2)), tailRing); 379 if (coef != NULL) *coef = n_Init(1, tailRing); 338 380 } 339 381 else 340 382 { 341 if (coef != NULL) *coef = n_Init(1, tailRing); 342 } 343 383 if (! n_IsOne(pGetCoeff(p2), tailRing)) 384 { 385 number bn = pGetCoeff(lm); 386 number an = pGetCoeff(p2); 387 int ct = ksCheckCoeff(&an, &bn, tailRing->cf); // Calculate special LC 388 p_SetCoeff(lm, bn, tailRing); 389 if (((ct == 0) || (ct == 2))) 390 PR->Tail_Mult_nn(an); 391 if (coef != NULL) *coef = an; 392 else n_Delete(&an, tailRing); 393 } 394 else 395 { 396 if (coef != NULL) *coef = n_Init(1, tailRing); 397 } 398 } 344 399 345 400 // and finally, … … 361 416 } 362 417 #endif 363 364 418 #if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED) 365 419 if (TEST_OPT_DEBUG)
Note: See TracChangeset
for help on using the changeset viewer.