Changeset f53fdf in git
- Timestamp:
- Nov 12, 2008, 1:42:12 PM (15 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f13d949e655e53400261250ef5a9a2c2f11e2585
- Parents:
- 10ed4a32f6e1ce3b10d657bf4a383d3f98265df2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
r10ed4a3 rf53fdf 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.7 5 2008-08-14 13:00:34 wienandExp $ */4 /* $Id: kstd2.cc,v 1.76 2008-11-12 12:42:12 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 631 631 //if (h->GetLmTailRing()==NULL) return 0; // HS: SHOULD NOT BE NEEDED! 632 632 assume(h->FDeg == h->pFDeg()); 633 634 633 poly h_p; 635 634 int i,j,at,pass,ei, ii, h_d; … … 643 642 h_p = h->GetLmTailRing(); 644 643 not_sev = ~ h->sev; 644 645 h->PrepareRed(strat->use_buckets); 645 646 loop 646 647 { 647 j =kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);648 j=kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h); 648 649 if (j < 0) return 1; 649 650 650 651 ei = strat->T[j].ecart; 651 652 li = strat->T[j].pLength; 652 #if 0653 if (li==0)654 {655 //PrintS("!");656 li=strat->T[j].pLength=pLength(strat->T[j].p);657 }658 #endif659 653 ii = j; 660 654 /* … … 694 688 if (!K_TEST_OPT_REDTHROUGH && (pass!=0) && (ei > h->ecart)) 695 689 { 690 h->GetTP(); // clears bucket 696 691 h->SetLmCurrRing(); 697 692 /* … … 726 721 assume(strat->fromT == FALSE); 727 722 728 #if 0 // test poly exchange 729 if (strat->inStdFac==0) 730 { 731 int ll; 732 poly t_p; 733 if (strat->tailRing==currRing) 734 t_p=strat->T[ii].p; 735 else 736 t_p=strat->T[ii].t_p; 737 if ((p_LmCmp(h_p,t_p,strat->tailRing)==0) 738 && ((ll=h->GuessLength()) < strat->T[ii].pLength)) 739 { 740 h->GetP(); 741 if ((h->pLength=h->GetpLength()) < strat->T[ii].pLength) 742 { 743 if (TEST_OPT_PROT) PrintS("e"); 744 h->GetP(); 745 if (h->p!=NULL) 746 { 747 if (strat->T[ii].p!=NULL) 748 { 749 poly swap; 750 omTypeAlloc0Bin(poly,swap,currRing->PolyBin); 751 memcpy(swap,h->p,currRing->PolyBin->sizeW*sizeof(long)); 752 memcpy(h->p,strat->T[ii].p,currRing->PolyBin->sizeW*sizeof(long)); 753 memcpy(strat->T[ii].p,swap,currRing->PolyBin->sizeW*sizeof(long)); 754 omFreeBinAddr(swap); 755 } 756 else 757 { 758 strat->T[ii].p=h->p; 759 h->p=NULL; 760 } 761 } 762 else 763 { 764 if (strat->T[ii].p!=NULL) 765 { 766 h->p=strat->T[ii].p; 767 strat->T[ii].p=NULL; 768 } 769 // else: all NULL 770 } 771 if (h->t_p!=NULL) 772 { 773 if (strat->T[ii].t_p!=NULL) 774 { 775 poly swap; 776 omTypeAlloc0Bin(poly,swap,strat->tailRing->PolyBin); 777 memcpy(swap,h->t_p,strat->tailRing->PolyBin->sizeW*sizeof(long)); 778 memcpy(h->t_p,strat->T[ii].t_p,strat->tailRing->PolyBin->sizeW*sizeof(long)); 779 memcpy(strat->T[ii].t_p,swap,strat->tailRing->PolyBin->sizeW*sizeof(long)); 780 omFreeBinAddr(swap); 781 } 782 else 783 { 784 strat->T[ii].t_p=h->t_p; 785 h->t_p=NULL; 786 } 787 } 788 else 789 { 790 if (strat->T[ii].t_p!=NULL) 791 { 792 h->t_p=strat->T[ii].t_p; 793 strat->T[ii].t_p=NULL; 794 } 795 // else: all NULL 796 } 797 if (strat->tailRing != currRing && (strat->T[ii].p != NULL) 798 && pNext(strat->T[ii].p) != NULL) 799 strat->T[ii].max =p_GetMaxExpP(pNext(strat->T[ii].p), strat->tailRing); 800 else 801 strat->T[ii].max = NULL; 802 h->length=h->pLength=pLength(h->p); 803 strat->T[ii].length=strat->T[ii].pLength=pLength(strat->T[ii].p); 804 if (strat->T[ii].is_normalized) 805 { 806 strat->T[ii].is_normalized=0; 807 strat->T[ii].pNorm(); 808 } 809 else 810 { 811 if (TEST_OPT_INTSTRATEGY) 812 strat->T[ii].pCleardenom(); 813 } 814 h->PrepareRed(strat->use_buckets); 815 } 816 } 817 } 818 #endif // test poly exchange 819 ksReducePoly(h, &(strat->T[ii]), NULL, NULL, strat); 820 723 number coef; 724 ksReducePoly(h,&(strat->T[ii]),strat->kNoetherTail(),&coef,strat); 821 725 #ifdef KDEBUG 822 726 if (TEST_OPT_DEBUG) 823 727 { 824 PrintS("\nto 728 PrintS("\nto:"); 825 729 h->wrp(); 826 730 PrintLn(); 827 731 } 828 732 #endif 829 830 h_p = h->GetLmTailRing(); 831 if (h_p == NULL) 832 { 733 if(h->IsNull()) 734 { 735 h->Clear(); 833 736 if (h->lcm!=NULL) pLmFree(h->lcm); 834 #ifdef KDEBUG737 #ifdef KDEBUG 835 738 h->lcm=NULL; 836 #endif739 #endif 837 740 return 0; 838 741 } … … 843 746 if (ei <= h->ecart) 844 747 h->ecart = d-h_d; 845 else 748 else 846 749 h->ecart = d-h_d+ei-h->ecart; 750 847 751 /* 848 752 * try to reduce the s-polynomial h … … 855 759 if (!K_TEST_OPT_REDTHROUGH && (strat->Ll >= 0) && ((d > reddeg) || (pass > strat->LazyPass))) 856 760 { 761 h->GetTP(); // clear bucket 857 762 h->SetLmCurrRing(); 858 763 at = strat->posInL(strat->L,strat->Ll,h,strat); … … 873 778 else if (TEST_OPT_PROT && (strat->Ll < 0) && (d > reddeg)) 874 779 { 780 h->wrp(); Print("<%d>\n",h->GetpLength()); 875 781 reddeg = d; 876 782 Print(".%d",d); mflush();
Note: See TracChangeset
for help on using the changeset viewer.