Changeset 48aa42 in git for Singular/kutil.cc
- Timestamp:
- Dec 14, 2000, 5:38:55 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- de99f1185094a2e1b309d4e78f838d6692f38f51
- Parents:
- d84b58726ff416e01f33ee72cac5d136ef2515c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/kutil.cc
rd84b58 r48aa42 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.8 2 2000-12-12 08:44:46obachman Exp $ */4 /* $Id: kutil.cc,v 1.83 2000-12-14 16:38:51 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 28 28 // system memmove -- it does not seem to pay off, though 29 29 // #define ENTER_USE_MYMEMMOVE 30 31 // define if redtailBba should use buckets 32 #define HAVE_REDTAIL_BUCKETS 30 33 31 34 #include "tok.h" … … 2657 2660 } 2658 2661 2659 // #define OLD_RED_TAIL2660 #ifdef OLD_RED_TAIL2661 /*22662 * reduces h using the set S2663 * procedure used in redtail2664 */2665 /*22666 *compute the normalform of the tail p->next of p2667 *with respect to S2668 */2669 poly redtail (poly p, int pos, kStrategy strat)2670 {2671 if ((!strat->noTailReduction) && (pNext(p)!=NULL))2672 {2673 int j, e, l;2674 unsigned long not_sev;2675 2676 poly h = p;2677 poly hn = pNext(h); // !=NULL2678 int op = pFDeg(hn);2679 BOOLEAN save_HE=strat->kHEdgeFound;2680 strat->kHEdgeFound |= ((Kstd1_deg>0) && (op<=Kstd1_deg))2681 || TEST_OPT_INFREDTAIL;2682 loop2683 {2684 not_sev = ~ pGetShortExpVector(hn);2685 e = pLDeg(hn,&l)-op;2686 j = 0;2687 while (j <= pos)2688 {2689 if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)2690 &&2691 ((e >= strat->ecartS[j]) || strat->kHEdgeFound))2692 {2693 strat->redTailChange=TRUE;2694 ksOldSpolyTail(strat->S[j], p, h, strat->kNoether);2695 hn = pNext(h);2696 if (hn == NULL) goto all_done;2697 not_sev = ~ pGetShortExpVector(hn);2698 op = pFDeg(hn);2699 if ((Kstd1_deg>0)&&(op>Kstd1_deg)) goto all_done;2700 e = pLDeg(hn,&l)-op;2701 j = 0;2702 }2703 else2704 {2705 j++;2706 }2707 } /* while (j <= pos) */2708 h = hn; /* better for: pIter(h); */2709 hn = pNext(h);2710 if (hn==NULL) break;2711 op = pFDeg(hn);2712 if ((Kstd1_deg>0)&&(op>Kstd1_deg)) break;2713 }2714 all_done:2715 strat->kHEdgeFound = save_HE;2716 }2717 return p;2718 }2719 #else2720 2662 poly redtail (poly p, int pos, kStrategy strat) 2721 2663 { … … 2723 2665 return redtail(&L, pos, strat); 2724 2666 } 2667 2668 2669 #ifndef OLD_REDTAIL_BBA 2670 poly redtailBba (LObject* L, int pos, kStrategy strat, BOOLEAN withT) 2671 { 2672 strat->redTailChange=FALSE; 2673 if (strat->noTailReduction) return L->GetLmCurrRing(); 2674 poly h, p; 2675 2676 TObject* With; 2677 // placeholder in case strat->tl < 0 2678 TObject With_s(strat->tailRing); 2679 2680 h = L->GetLmTailRing(); 2681 p = h; 2682 LObject Ln(pNext(h), strat->tailRing); 2683 Ln.pLength = L->GetpLength() - 1; 2684 2685 pNext(h) = NULL; 2686 if (L->p != NULL) pNext(L->p) = NULL; 2687 L->pLength = 1; 2688 2689 #ifdef HAVE_REDTAIL_BUCKETS 2690 Ln.PrepareRed(strat->use_buckets); 2725 2691 #endif 2726 2692 2727 poly redtailBba (LObject* L, int pos, kStrategy strat) 2693 while(!Ln.IsNull()) 2694 { 2695 while (1) 2696 { 2697 Ln.SetShortExpVector(); 2698 if (! withT) 2699 { 2700 With = kFindDivisibleByInS(strat, pos, &Ln, &With_s); 2701 if (With == NULL) break; 2702 } 2703 else 2704 { 2705 int j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln); 2706 if (j < 0) break; 2707 With = &(strat->T[j]); 2708 } 2709 if (ksReducePolyTail(L, With, &Ln)) 2710 { 2711 // reducing the tail would violate the exp bound 2712 pNext(h) = Ln.GetTP(); 2713 L->pLength += Ln.GetpLength(); 2714 if (L->p != NULL) pNext(L->p) = pNext(p); 2715 if (kStratChangeTailRing(strat, L)) 2716 return redtailBba(L, pos, strat, withT); 2717 else 2718 { // should never get here -- need to fix this 2719 assume(0); 2720 return NULL; 2721 } 2722 } 2723 strat->redTailChange=TRUE; 2724 if (Ln.IsNull()) goto all_done; 2725 } 2726 pNext(h) = Ln.LmExtractAndIter(); 2727 pIter(h); 2728 L->pLength++; 2729 } 2730 2731 all_done: 2732 if (L->p != NULL) pNext(L->p) = pNext(p); 2733 assume(pLength(L->p != NULL ? L->p : L->t_p) == L->pLength); 2734 2735 if (strat->redTailChange) 2736 { 2737 L->last = NULL; 2738 L->length = 0; 2739 } 2740 kTest_L(L); 2741 return L->GetLmCurrRing(); 2742 } 2743 #else 2744 poly redtailBba (LObject* L, int pos, kStrategy strat, BOOLEAN withT) 2728 2745 { 2729 2746 poly h, hn; … … 2747 2764 Ln.Set(hn, strat->tailRing); 2748 2765 Ln.sev = p_GetShortExpVector(hn, strat->tailRing); 2749 With = kFindDivisibleByInS(strat, pos, &Ln, &With_s); 2750 if (With == NULL) break; 2766 if (! withT) 2767 { 2768 With = kFindDivisibleByInS(strat, pos, &Ln, &With_s); 2769 if (With == NULL) break; 2770 } 2771 else 2772 { 2773 int j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln); 2774 if (j < 0) break; 2775 With = &(strat->T[j]); 2776 } 2751 2777 if (ksReducePolyTail(L, With, h, strat->kNoether)) 2752 2778 { … … 2780 2806 return p; 2781 2807 } 2782 2808 #endif 2783 2809 /*2 2784 2810 *checks the change degree and write progress report
Note: See TracChangeset
for help on using the changeset viewer.