Changeset b085fba in git
- Timestamp:
- Nov 25, 2013, 9:15:32 AM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
- Children:
- 576f5bba463748c5f51eebf368f6184847882508
- Parents:
- f59aaade492b9527e048de83ffcb97228e48208b
- git-author:
- Christian Eder <ederc@mathematik.uni-kl.de>2013-11-25 09:15:32+01:00
- git-committer:
- Christian Eder <ederc@mathematik.uni-kl.de>2013-12-12 13:51:25+01:00
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kInline.h
rf59aaa rb085fba 1074 1074 } 1075 1075 1076 KINLINE int ksReducePolyTailSig(LObject* PR, TObject* PW, LObject* Red) 1077 { 1078 BOOLEAN ret; 1079 number coef; 1080 1081 assume(PR->GetLmCurrRing() != PW->GetLmCurrRing()); 1082 Red->HeadNormalize(); 1083 printf("------------------------\n"); 1084 pWrite(Red->GetLmCurrRing()); 1085 ret = ksReducePolySig(Red, PW, 1, NULL, &coef); 1086 if (ret == 3) { 1087 pWrite(Red->GetLmCurrRing()); 1088 printf("not sig-safe\n"); 1089 printf("------------------------\n"); 1090 } 1091 if (!ret) 1092 { 1093 if (! n_IsOne(coef, currRing->cf)) 1094 { 1095 PR->Mult_nn(coef); 1096 // HANNES: mark for Normalize 1097 } 1098 n_Delete(&coef, currRing->cf); 1099 } 1100 return ret; 1101 } 1102 1076 1103 /*************************************************************** 1077 1104 * -
kernel/kstd2.cc
rf59aaa rb085fba 53 53 #endif 54 54 55 #define SBA_TAIL_RED 0 55 56 #define SBA_PRODUCT_CRITERION 0 56 57 #define SBA_PRINT_ZERO_REDUCTIONS 1 … … 1818 1819 // in the ring case we cannot expect LC(f) = 1, 1819 1820 // therefore we call pContent instead of pNorm 1820 /* 1821 #if SBA_TAIL_RED 1822 pWrite(strat->P.p); 1821 1823 if ((TEST_OPT_INTSTRATEGY) || (rField_is_Ring(currRing))) 1822 1824 { … … 1824 1826 if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL)) 1825 1827 { 1826 strat->P.p = redtail Bba(&(strat->P),pos-1,strat, withT);1828 strat->P.p = redtailSba(&(strat->P),pos-1,strat, withT); 1827 1829 strat->P.pCleardenom(); 1828 1830 } … … 1832 1834 strat->P.pNorm(); 1833 1835 if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL)) 1834 strat->P.p = redtailBba(&(strat->P),pos-1,strat, withT); 1835 } 1836 */ 1836 strat->P.p = redtailSba(&(strat->P),pos-1,strat, withT); 1837 } 1838 pWrite(strat->P.p); 1839 printf("-\n"); 1840 #endif 1837 1841 #ifdef KDEBUG 1838 1842 if (TEST_OPT_DEBUG){PrintS("new s:");strat->P.wrp();PrintLn();} … … 1934 1938 // posInS only depends on the leading term 1935 1939 strat->enterS(strat->P, pos, strat, strat->tl); 1936 //#if 11937 #if DEBUGF501940 #if 1 1941 //#if DEBUGF50 1938 1942 printf("---------------------------\n"); 1939 1943 Print(" %d. ELEMENT ADDED TO GCURR:\n",strat->sl+1); -
kernel/kutil.cc
rf59aaa rb085fba 5469 5469 strat->redTailChange=TRUE; 5470 5470 if (ksReducePolyTail(L, With, &Ln)) 5471 { 5472 // reducing the tail would violate the exp bound 5473 // set a flag and hope for a retry (in bba) 5474 strat->completeReduce_retry=TRUE; 5475 if ((Ln.p != NULL) && (Ln.t_p != NULL)) Ln.p=NULL; 5476 do 5477 { 5478 pNext(h) = Ln.LmExtractAndIter(); 5479 pIter(h); 5480 L->pLength++; 5481 } while (!Ln.IsNull()); 5482 goto all_done; 5483 } 5484 if (Ln.IsNull()) goto all_done; 5485 if (! withT) With_s.Init(currRing); 5486 } 5487 pNext(h) = Ln.LmExtractAndIter(); 5488 pIter(h); 5489 pNormalize(h); 5490 L->pLength++; 5491 } 5492 5493 all_done: 5494 Ln.Delete(); 5495 if (L->p != NULL) pNext(L->p) = pNext(p); 5496 5497 if (strat->redTailChange) 5498 { 5499 L->length = 0; 5500 } 5501 5502 //if (TEST_OPT_PROT) { PrintS("N"); mflush(); } 5503 //L->Normalize(); // HANNES: should have a test 5504 assume(kTest_L(L)); 5505 return L->GetLmCurrRing(); 5506 } 5507 5508 // tail reduction for SBA 5509 poly redtailSba (LObject* L, int pos, kStrategy strat, BOOLEAN withT, BOOLEAN normalize) 5510 { 5511 #define REDTAIL_CANONICALIZE 100 5512 strat->redTailChange=FALSE; 5513 if (strat->noTailReduction) return L->GetLmCurrRing(); 5514 poly h, p; 5515 p = h = L->GetLmTailRing(); 5516 if ((h==NULL) || (pNext(h)==NULL)) 5517 return L->GetLmCurrRing(); 5518 5519 TObject* With; 5520 // placeholder in case strat->tl < 0 5521 TObject With_s(strat->tailRing); 5522 5523 LObject Ln(pNext(h), strat->tailRing); 5524 Ln.sig = L->sig; 5525 Ln.sevSig = L->sevSig; 5526 Ln.pLength = L->GetpLength() - 1; 5527 5528 pNext(h) = NULL; 5529 if (L->p != NULL) pNext(L->p) = NULL; 5530 L->pLength = 1; 5531 5532 Ln.PrepareRed(strat->use_buckets); 5533 5534 int cnt=REDTAIL_CANONICALIZE; 5535 while(!Ln.IsNull()) 5536 { 5537 loop 5538 { 5539 Ln.SetShortExpVector(); 5540 if (withT) 5541 { 5542 int j; 5543 j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln); 5544 if (j < 0) break; 5545 With = &(strat->T[j]); 5546 } 5547 else 5548 { 5549 With = kFindDivisibleByInS(strat, pos, &Ln, &With_s); 5550 if (With == NULL) break; 5551 } 5552 cnt--; 5553 if (cnt==0) 5554 { 5555 cnt=REDTAIL_CANONICALIZE; 5556 /*poly tmp=*/Ln.CanonicalizeP(); 5557 if (normalize) 5558 { 5559 Ln.Normalize(); 5560 //pNormalize(tmp); 5561 //if (TEST_OPT_PROT) { PrintS("n"); mflush(); } 5562 } 5563 } 5564 if (normalize && (!TEST_OPT_INTSTRATEGY) && (!nIsOne(pGetCoeff(With->p)))) 5565 { 5566 With->pNorm(); 5567 } 5568 strat->redTailChange=TRUE; 5569 if (ksReducePolyTailSig(L, With, &Ln)) 5471 5570 { 5472 5571 // reducing the tail would violate the exp bound -
kernel/kutil.h
rf59aaa rb085fba 467 467 poly redtailBba (LObject *L, int pos,kStrategy strat, 468 468 BOOLEAN withT = FALSE,BOOLEAN normalize=FALSE); 469 poly redtailSba (LObject *L, int pos,kStrategy strat, 470 BOOLEAN withT = FALSE,BOOLEAN normalize=FALSE); 469 471 poly redtailBba (TObject *T, int pos,kStrategy strat); 470 472 poly redtail (poly p,int pos,kStrategy strat);
Note: See TracChangeset
for help on using the changeset viewer.