Changeset b2c236 in git for kernel/kstd2.cc
- Timestamp:
- Nov 27, 2006, 5:11:23 PM (17 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 9e9ec3df945106169f8daf8b55033fea8579fa1b
- Parents:
- 9550253271625a21c0e4629145949aa74007ac56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
r955025 rb2c236 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.2 6 2006-11-17 14:47:37Singular Exp $ */4 /* $Id: kstd2.cc,v 1.27 2006-11-27 16:09:46 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 93 93 #else 94 94 int ende=strat->sl; 95 #endif 95 #endif 96 96 (*max_ind)=ende; 97 97 loop … … 601 601 d = reddeg = h->GetpFDeg() + h->ecart; 602 602 h->SetShortExpVector(); 603 int li; 603 604 h_p = h->GetLmTailRing(); 604 605 not_sev = ~ h->sev; … … 609 610 610 611 ei = strat->T[j].ecart; 612 li = strat->T[j].pLength; 611 613 ii = j; 612 614 /* … … 621 623 if (i > strat->tl) 622 624 break; 623 if (ei < =h->ecart)625 if (ei < h->ecart) 624 626 break; 625 if ((strat->T[i].ecart < ei) && 627 if (li==1) 628 break; 629 if (((strat->T[i].ecart < ei) 630 || ((strat->T[i].ecart <= h->ecart) && (strat->T[i].pLength < li))) 631 && 626 632 p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], 627 633 h_p, not_sev, strat->tailRing)) … … 631 637 */ 632 638 ei = strat->T[i].ecart; 639 li = strat->T[i].pLength; 633 640 ii = i; 634 641 } … … 672 679 assume(strat->fromT == FALSE); 673 680 681 #if 0 // test poly exchange 682 if (strat->inStdFac==0) 683 { 684 int ll; 685 poly t_p; 686 if (strat->tailRing==currRing) 687 t_p=strat->T[ii].p; 688 else 689 t_p=strat->T[ii].t_p; 690 if ((p_LmCmp(h_p,t_p,strat->tailRing)==0) 691 && ((ll=h->GuessLength()) < strat->T[ii].pLength)) 692 { 693 h->GetP(); 694 if ((h->pLength=h->GetpLength()) < strat->T[ii].pLength) 695 { 696 if (TEST_OPT_PROT) PrintS("e"); 697 h->GetP(); 698 if (h->p!=NULL) 699 { 700 if (strat->T[ii].p!=NULL) 701 { 702 poly swap; 703 omTypeAlloc0Bin(poly,swap,currRing->PolyBin); 704 memcpy(swap,h->p,currRing->PolyBin->sizeW*sizeof(long)); 705 memcpy(h->p,strat->T[ii].p,currRing->PolyBin->sizeW*sizeof(long)); 706 memcpy(strat->T[ii].p,swap,currRing->PolyBin->sizeW*sizeof(long)); 707 omFreeBinAddr(swap); 708 } 709 else 710 { 711 strat->T[ii].p=h->p; 712 h->p=NULL; 713 } 714 } 715 else 716 { 717 if (strat->T[ii].p!=NULL) 718 { 719 h->p=strat->T[ii].p; 720 strat->T[ii].p=NULL; 721 } 722 // else: all NULL 723 } 724 if (h->t_p!=NULL) 725 { 726 if (strat->T[ii].t_p!=NULL) 727 { 728 poly swap; 729 omTypeAlloc0Bin(poly,swap,strat->tailRing->PolyBin); 730 memcpy(swap,h->t_p,strat->tailRing->PolyBin->sizeW*sizeof(long)); 731 memcpy(h->t_p,strat->T[ii].t_p,strat->tailRing->PolyBin->sizeW*sizeof(long)); 732 memcpy(strat->T[ii].t_p,swap,strat->tailRing->PolyBin->sizeW*sizeof(long)); 733 omFreeBinAddr(swap); 734 } 735 else 736 { 737 strat->T[ii].t_p=h->t_p; 738 h->t_p=NULL; 739 } 740 } 741 else 742 { 743 if (strat->T[ii].t_p!=NULL) 744 { 745 h->t_p=strat->T[ii].t_p; 746 strat->T[ii].t_p=NULL; 747 } 748 // else: all NULL 749 } 750 if (strat->tailRing != currRing && (strat->T[ii].p != NULL) 751 && pNext(strat->T[ii].p) != NULL) 752 strat->T[ii].max =p_GetMaxExpP(pNext(strat->T[ii].p), strat->tailRing); 753 else 754 strat->T[ii].max = NULL; 755 h->pLength=0;h->pLength=h->GetpLength(); 756 strat->T[ii].pLength=0;strat->T[ii].pLength=strat->T[ii].GetpLength(); 757 if (strat->T[ii].is_normalized) 758 { 759 strat->T[ii].is_normalized=0; 760 strat->T[ii].pNorm(); 761 } 762 else 763 { 764 if (TEST_OPT_INTSTRATEGY) 765 strat->T[ii].pCleardenom(); 766 } 767 h->PrepareRed(strat->use_buckets); 768 } 769 } 770 } 771 #endif // test poly exchange 674 772 ksReducePoly(h, &(strat->T[ii]), NULL, NULL, strat); 675 773 … … 923 1021 } 924 1022 925 #ifdef HAVE_RING2TOM926 1023 if (strat->P.p == NULL && strat->P.t_p == NULL) 927 1024 { … … 929 1026 } 930 1027 else 931 #endif932 1028 { 933 1029 if (TEST_OPT_PROT) … … 1009 1105 strat->enterS(strat->P, pos, strat, strat->tl); 1010 1106 #endif 1107 int pl=pLength(strat->P.p); 1108 if (pl==1) 1109 { 1110 //if (TEST_OPT_PROT) 1111 //PrintS("<1>"); 1112 } 1113 else if (pl==2) 1114 { 1115 //if (TEST_OPT_PROT) 1116 //PrintS("<2>"); 1117 } 1011 1118 if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat); 1012 1119 // Print("[%d]",hilbeledeg);
Note: See TracChangeset
for help on using the changeset viewer.