Changeset 9108d3 in git
- Timestamp:
- Jan 31, 2007, 4:22:22 PM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 1cc61e18c0d6c70b177099c23a52159afb280bb4
- Parents:
- dd60f3c49de7f734e4192d72024b962103c34c8e
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/tgb.cc
rdd60f3c r9108d3 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb.cc,v 1.1 19 2007-01-30 15:10:36bricken Exp $ */7 /* $Id: tgb.cc,v 1.120 2007-01-31 15:22:21 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: slimgb and F4 implementation … … 15 15 ///@TODO: delay nur auf Sugarvergrᅵerung 16 16 ///@TODO: grade aus ecartS, setze dazu strat->honey; und nutze p.ecart 17 //@TODO: no tail reductions in syz comp 17 18 #include "mod2.h" 18 19 #include "tgb.h" … … 330 331 if (c->lastDpBlockStart<=pVariables){ 331 332 int i; 332 for(i=1;i< =pVariables;i++){333 for(i=1;i<c->lastDpBlockStart;i++){ 333 334 if (p_GetExp(p,i,r)!=0){ 334 335 break; … … 910 911 for (i=old_pos; i>new_pos; i--) 911 912 strat->lenSw[i] = strat->lenSw[i-1]; 913 914 strat->S[new_pos]=p; 915 strat->ecartS[new_pos]=ecart; 916 strat->sevS[new_pos]=sev; 917 strat->S_2_R[new_pos]=s_2_r; 918 strat->lenS[new_pos]=length; 919 if(strat->lenSw!=NULL) 920 strat->lenSw[new_pos]=length_w; 921 //assume(lenS_correct(strat)); 922 } 923 924 static void move_backward_in_S(int old_pos, int new_pos,kStrategy strat) 925 { 926 assume(old_pos<=new_pos); 927 poly p=strat->S[old_pos]; 928 int ecart=strat->ecartS[old_pos]; 929 long sev=strat->sevS[old_pos]; 930 int s_2_r=strat->S_2_R[old_pos]; 931 int length=strat->lenS[old_pos]; 932 assume(length==pLength(strat->S[old_pos])); 933 wlen_type length_w; 934 if(strat->lenSw!=NULL) 935 length_w=strat->lenSw[old_pos]; 936 int i; 937 for (i=old_pos; i<new_pos; i++) 938 { 939 strat->S[i] = strat->S[i+1]; 940 strat->ecartS[i] = strat->ecartS[i+1]; 941 strat->sevS[i] = strat->sevS[i+1]; 942 strat->S_2_R[i] = strat->S_2_R[i+1]; 943 } 944 if (strat->lenS!=NULL) 945 for (i=old_pos; i<new_pos; i++) 946 strat->lenS[i] = strat->lenS[i+1]; 947 if (strat->lenSw!=NULL) 948 for (i=old_pos; i<new_pos; i++) 949 strat->lenSw[i] = strat->lenSw[i+1]; 912 950 913 951 strat->S[new_pos]=p; … … 1968 2006 1969 2007 //if (!c->nc) { 1970 if ( (TEST_OPT_REDTAIL)&&(c->S->rank<=1)){2008 if (c->tailReductions){ 1971 2009 p=redNFTail(p,c->strat->sl,c->strat, 0); 1972 2010 } else { … … 2263 2301 } 2264 2302 slimgb_alg::slimgb_alg(ideal I, int syz_comp,BOOLEAN F4){ 2303 lastCleanedDeg=-1; 2265 2304 completed=FALSE; 2266 2305 this->syz_comp=syz_comp; … … 2288 2327 } 2289 2328 } 2290 eliminationProblem=((!(is_homog))&&((pLexOrder)||(I->rank> 0)));2291 2329 eliminationProblem=((!(is_homog))&&((pLexOrder)||(I->rank>1))); 2330 tailReductions=((is_homog)||((TEST_OPT_REDTAIL)&&(!(I->rank>1)))); 2292 2331 // Print("is homog:%d",c->is_homog); 2293 2332 void* h; … … 2784 2823 else return (c->apairs[c->pair_top--]); 2785 2824 } 2825 void slimgb_alg::cleanDegs(int lower, int upper){ 2826 assume(is_homog); 2827 int deg; 2828 if (TEST_OPT_PROT){ 2829 PrintS("C"); 2830 } 2831 for(deg=lower;deg<=upper;deg++){ 2832 int i; 2833 for(i=0;i<n;i++){ 2834 if (T_deg[i]==deg){ 2835 poly h; 2836 h=S->m[i]; 2837 h=redNFTail(h,strat->sl,strat,lengths[i]); 2838 if (!rField_is_Zp(r)) 2839 { 2840 pContent(h); 2841 pCleardenom(h);//should be unnecessary 2842 } else pNorm(h); 2843 //TODO:GCD of TERMS 2844 poly got=::gcd_of_terms(h,r); 2845 p_Delete(&gcd_of_terms[i],r); 2846 gcd_of_terms[i]=got; 2847 int len=pLength(h); 2848 wlen_type wlen=pQuality(h,this,len); 2849 if (weighted_lengths) 2850 weighted_lengths[i]=wlen; 2851 lengths[i]=len; 2852 assume(h==S->m[i]); 2853 int j; 2854 for(j=0;j<=strat->sl;j++){ 2855 if (h==strat->S[j]){ 2856 int new_pos=simple_posInS(strat, h,len, wlen); 2857 if (strat->lenS){ 2858 strat->lenS[j]=len; 2859 } 2860 if (strat->lenSw){ 2861 strat->lenSw[j]=wlen; 2862 } 2863 if (new_pos<j){ 2864 move_forward_in_S(j,new_pos,strat); 2865 }else{ 2866 if (new_pos>j) 2867 new_pos=new_pos-1;//is identical with one element 2868 if (new_pos>j) 2869 move_backward_in_S(j,new_pos,strat); 2870 } 2871 break; 2872 } 2873 } 2874 } 2875 2876 } 2877 2878 } 2879 { 2880 int i,j; 2881 for(i=0;i<this->n;i++){ 2882 for(j=0;j<i;j++){ 2883 if (T_deg[i]+T_deg[j]<=upper){ 2884 now_t_rep(i,j,this); 2885 } 2886 } 2887 } 2888 } 2889 //TODO resort and update strat->S,strat->lenSw 2890 //TODO mark pairs 2891 } 2786 2892 sorted_pair_node* top_pair(slimgb_alg* c){ 2787 super_clean_top_of_pair_list(c);//yeah, I know, it's odd that I use a different proc here 2893 while(c->pair_top>=0){ 2894 super_clean_top_of_pair_list(c);//yeah, I know, it's odd that I use a different proc here 2895 if ((c->is_homog)&&(c->pair_top>=0)&&(c->apairs[c->pair_top]->deg>=c->lastCleanedDeg+2)){ 2896 int upper=c->apairs[c->pair_top]->deg-1; 2897 c->cleanDegs(c->lastCleanedDeg+1,upper); 2898 c->lastCleanedDeg=upper; 2899 } else{ 2900 break; 2901 } 2902 2903 } 2904 2788 2905 2789 2906 if(c->pair_top<0) return NULL; -
kernel/tgb_internal.h
rdd60f3c r9108d3 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb_internal.h,v 1.4 7 2006-11-09 11:14:50bricken Exp $ */7 /* $Id: tgb_internal.h,v 1.48 2007-01-31 15:22:22 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: tgb internal .h file … … 103 103 void introduceDelayedPairs(poly* pa,int s); 104 104 virtual ~slimgb_alg(); 105 void cleanDegs(int lower, int upper); 105 106 #ifndef HAVE_BOOST 106 107 #ifdef USE_STDVECBOOL … … 158 159 int average_length; 159 160 int lastDpBlockStart; 161 int lastCleanedDeg; 160 162 BOOLEAN isDifficultField; 161 163 BOOLEAN completed; 162 164 BOOLEAN is_homog; 163 165 BOOLEAN tailReductions; 164 166 BOOLEAN eliminationProblem; 165 167 BOOLEAN F4_mode;
Note: See TracChangeset
for help on using the changeset viewer.