Changeset 89e45b in git
- Timestamp:
- Feb 26, 2007, 1:52:45 PM (16 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 08932b1c52841085c67412beca95f77ba46d4014
- Parents:
- f529246505a5d745330cbb08ffc3f1db543d3ed3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/tgb_internal.h
rf52924 r89e45b 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb_internal.h,v 1.6 4 2007-02-26 10:57:39bricken Exp $ */7 /* $Id: tgb_internal.h,v 1.65 2007-02-26 12:52:45 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: tgb internal .h file … … 922 922 int idx; 923 923 bool operator<(const CoefIdx<number_type>& other) const{ 924 return idx<other.idx; 925 } 926 }; 924 return (idx<other.idx); 925 } 926 }; 927 template<class number_type> void write_coef_times_xx_idx_to_buffer(CoefIdx<number_type>* const pairs,int& pos,int* const idx_array, number_type* const coef_array,const int rlen, const number coef){ 928 int j; 929 for(j=0;j<rlen;j++){ 930 assume(coef_array[j]!=0); 931 CoefIdx<number_type> ci; 932 ci.coef=F4mat_to_number_type(npMultM((number) coef,(number) coef_array[j])); 933 ci.idx=idx_array[j]; 934 pairs[pos++]=ci; 935 } 936 } 937 template<class number_type> void write_coef_idx_to_buffer(CoefIdx<number_type>* const pairs,int& pos,int* const idx_array, number_type* const coef_array,const int rlen){ 938 int j; 939 for(j=0;j<rlen;j++){ 940 assume(coef_array[j]!=0); 941 CoefIdx<number_type> ci; 942 ci.coef=coef_array[j]; 943 ci.idx=idx_array[j]; 944 pairs[pos++]=ci; 945 } 946 } 947 948 template<class number_type> void write_minus_coef_idx_to_buffer(CoefIdx<number_type>* const pairs,int& pos,int* const idx_array, number_type* const coef_array,const int rlen){ 949 int j; 950 for(j=0;j<rlen;j++){ 951 assume(coef_array[j]!=0); 952 CoefIdx<number_type> ci; 953 ci.coef=F4mat_to_number_type(npNegM(coef_array[j])); 954 ci.idx=idx_array[j]; 955 pairs[pos++]=ci; 956 } 957 } 927 958 template <class number_type> SparseRow<number_type>* noro_red_to_non_poly_sparse(MonRedResNP<number_type>* mon, int len,NoroCache<number_type>* cache){ 928 959 int i; … … 944 975 int pos=0; 945 976 int j; 977 const number one=npInit(1); 978 const number minus_one=npInit(-1); 946 979 for(i=0;i<len;i++){ 947 980 MonRedResNP<number_type> red=mon[i]; … … 951 984 number_type* coef_array=red.ref->row->coef_array; 952 985 int rlen=red.ref->row->len; 953 for(j=0;j<rlen;j++){ 954 assume(coef_array[j]!=0); 955 CoefIdx<number_type> ci; 956 ci.coef=F4mat_to_number_type(npMultM((number) red.coef,(number) coef_array[j])); 957 ci.idx=idx_array[j]; 958 pairs[pos++]=ci; 986 number coef=red.coef; 987 if ((coef!=one)&&(coef!=minus_one)){ 988 write_coef_times_xx_idx_to_buffer(pairs,pos,idx_array, coef_array,rlen, coef); 989 } else 990 { 991 if (coef==one){ 992 write_coef_idx_to_buffer(pairs,pos,idx_array, coef_array,rlen); 993 } else { 994 assume(coef==minus_one); 995 write_minus_coef_idx_to_buffer(pairs,pos,idx_array, coef_array,rlen); 959 996 } 997 } 960 998 } else { 961 999 if ((red.ref) &&(red.ref->value_len==NoroCache<number_type>::backLinkCode)){ … … 1038 1076 len=i; 1039 1077 bool dense=true; 1040 if (max_density<0. 1) dense=false;1078 if (max_density<0.05) dense=false; 1041 1079 if (dense){ 1042 1080 SparseRow<number_type>* res=noro_red_to_non_poly_dense(mon,len,cache);
Note: See TracChangeset
for help on using the changeset viewer.