Changeset 6b4fbf7 in git
- Timestamp:
- Feb 20, 2006, 12:57:04 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 3ecd5f3896116e2d2af74944f70fd2d4b7ae5d17
- Parents:
- aa6d69c2d3807dc274cbd64e632685f1ea81a6d7
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/numbers.h
raa6d69 r6b4fbf7 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: numbers.h,v 1. 4 2005-05-25 13:03:31bricken Exp $ */6 /* $Id: numbers.h,v 1.5 2006-02-20 11:57:03 bricken Exp $ */ 7 7 /* 8 8 * ABSTRACT: interface to coefficient aritmetics … … 33 33 #define n_InpMult(a, b, r) (r)->cf->nInpMult(a,b,r) 34 34 #define n_Power(a, b, res, r) (r)->cf->nPower(a,b,res) 35 35 #define n_Size(n,r) (r)->cf->nSize(n) 36 36 37 37 /* variables */ -
kernel/tgb.cc
raa6d69 r6b4fbf7 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb.cc,v 1.5 7 2006-02-17 11:32:58bricken Exp $ */7 /* $Id: tgb.cc,v 1.58 2006-02-20 11:57:03 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: slimgb and F4 implementation … … 22 22 static const int bundle_size=100; 23 23 static const int delay_factor=3; 24 int QlogSize(number n); 24 25 #if 1 25 26 static omBin lm_bin=NULL; 26 27 //static const BOOLEAN up_to_radical=TRUE; 27 28 29 static int slim_nsize(number n, ring r) { 30 if (rField_is_Zp(r)){ 31 return 1; 32 } 33 if (rField_is_Q(r)){ 34 return QlogSize(n); 35 36 } 37 else{ 38 return n_Size(n,r); 39 40 } 41 } 28 42 static BOOLEAN monomial_root(poly m, ring r){ 29 43 BOOLEAN changed=FALSE; … … 961 975 return 0; 962 976 } 963 977 static wlen_type pair_weighted_length(int i, int j, slimgb_alg* c){ 978 if ((c->is_char0) && (pLexOrder)) { 979 int c1=slim_nsize(p_GetCoeff(c->S->m[i],c->r),c->r); 980 int c2=slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r); 981 wlen_type el1=c->weighted_lengths[i]/c1; 982 assume(el1!=0); 983 assume(c->weighted_lengths[j] %c1==0); 984 wlen_type el2=c->weighted_lengths[i]/c2; 985 assume(el2!=0); 986 assume(c->weighted_lengths[j] %c2==0); 987 //should be * for function fields 988 return (c1+c2) * (el1+el2-2); 989 990 991 } 992 if (c->is_char0) { 993 int cs=slim_nsize(p_GetCoeff(c->S->m[i],c->r),c->r)+ 994 slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r); 995 return (c->lengths[i]+c->lengths[j]-2)*cs; 996 } 997 return c->lengths[i]+c->lengths[j]-2; 998 999 } 964 1000 sorted_pair_node** add_to_basis_ideal_quotient(poly h, int i_pos, int j_pos,slimgb_alg* c, int* ip) 965 1001 { … … 1007 1043 ENLARGE(c->states, char*); 1008 1044 ENLARGE(c->gcd_of_terms,poly); 1045 //if (c->weighted_lengths!=NULL) { 1046 ENLARGE(c->weighted_lengths,wlen_type); 1047 //} 1009 1048 //ENLARGE(c->S->m,poly); 1010 1049 … … 1026 1065 1027 1066 c->lengths[i]=pLength(h); 1028 1067 1068 //necessary for correct weighted length 1069 1070 if (!rField_is_Zp(c->r)){ 1071 pCleardenom(h); 1072 pContent(h); //is a duplicate call, but belongs here 1073 1074 } 1075 else 1076 pNorm(h); 1077 c->weighted_lengths[i]=pQuality(h, c, c->lengths[i]); 1029 1078 c->gcd_of_terms[i]=got; 1030 1079 … … 1123 1172 s->j=si_min(i,j); 1124 1173 assume(s->j==j); 1125 s->expected_length= c->lengths[i]+c->lengths[j]-2;1174 s->expected_length=pair_weighted_length(i,j,c);//c->lengths[i]+c->lengths[j]-2; 1126 1175 1127 1176 poly lm=c->tmp_pair_lm[spc];//=pOne_Special(); … … 1902 1951 h=omalloc(n*sizeof(int)); 1903 1952 lengths=(int*) h; 1904 1953 weighted_lengths=(wlen_type*)omalloc(n*sizeof(wlen_type)); 1905 1954 gcd_of_terms=(poly*) omalloc(n*sizeof(poly)); 1906 1955 -
kernel/tgb_internal.h
raa6d69 r6b4fbf7 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb_internal.h,v 1.2 2 2006-02-17 10:26:35bricken Exp $ */7 /* $Id: tgb_internal.h,v 1.23 2006-02-20 11:57:04 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: tgb internal .h file … … 92 92 ring r; 93 93 int* lengths; 94 wlen_type* weighted_lengths; 94 95 long* short_Exps; 95 96 kStrategy strat; … … 152 153 HASTREP, 153 154 UNIMPORTANT, 154 SOONTREP155 //SOONTREP 155 156 }; 156 157 template <class len_type, class set_type> int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set);
Note: See TracChangeset
for help on using the changeset viewer.