Changeset 822445 in git
- Timestamp:
- Feb 21, 2007, 8:05:45 AM (17 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- af2ba96ba5dce1de2ed11faf0624dd9972ac71e4
- Parents:
- 421e42f64cacb50c3475fbbae08023fddb74803b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/tgb.cc
r421e42 r822445 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb.cc,v 1.14 1 2007-02-20 15:11:03bricken Exp $ */7 /* $Id: tgb.cc,v 1.142 2007-02-21 07:05:45 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: slimgb and F4 implementation … … 1935 1935 //assume(FALSE); 1936 1936 for(i=start;i<=lastIndex;i++){ 1937 other_row_array[i]=npAdd (npMult(coef2,row_array[i]),other_row_array[i]);1937 other_row_array[i]=npAddM(npMult(coef2,row_array[i]),other_row_array[i]); 1938 1938 } 1939 1939 } … … 1947 1947 assume((lower_bound<0)||(npIsZero(row_array[lower_bound]))); 1948 1948 int i; 1949 number zero=npInit(0); 1949 1950 for(i=lower_bound+1;i<ncols;i++){ 1950 if (!( npIsZero(row_array[i])))1951 if (!(row_array[i]==0)) 1951 1952 break; 1952 1953 } … … 2025 2026 if (upper_bound>nonZeroUntil) upper_bound=nonZeroUntil+1; 2026 2027 int i; 2028 number zero=npInit(0); 2027 2029 for(i=upper_bound-1;i>r;i--){ 2028 2030 int start=startIndices[i]; 2029 2031 assume(start<ncols); 2030 if (!( npIsZero(row_array[start]))){2032 if (!(row_array[start]==zero)){ 2031 2033 lastReducibleIndices[r]=start; 2032 2034 return; … … 2059 2061 assume(start>startIndices[other_row]); 2060 2062 for(i=start;i<=lastIndex;i++){ 2061 other_row_array[i]=npAdd (npMult(coef,row_array[i]),other_row_array[i]);2063 other_row_array[i]=npAddM(npMult(coef,row_array[i]),other_row_array[i]); 2062 2064 } 2063 2065 updateLastReducibleIndex(other_row,r); … … 2540 2542 number coef=place_holders[i].coef; 2541 2543 if (ref->value_len==backLinkCode){ 2542 row[ref->term_index]=npAdd (row[ref->term_index],coef);2544 row[ref->term_index]=npAddM(row[ref->term_index],coef); 2543 2545 } else { 2544 2546 #ifndef NORO_SPARSE_ROWS_PRE … … 2552 2554 while(ref_begin!=ref_end){ 2553 2555 2554 *my_pos=npAdd (*my_pos,npMult(coef,*ref_begin));2556 *my_pos=npAddM(*my_pos,npMult(coef,*ref_begin)); 2555 2557 ++ref_begin; 2556 2558 ++my_pos; … … 2560 2562 while(ref_begin!=ref_end){ 2561 2563 2562 *my_pos=npAdd (*my_pos,*ref_begin);2564 *my_pos=npAddM(*my_pos,*ref_begin); 2563 2565 ++ref_begin; 2564 2566 ++my_pos; … … 2578 2580 int idx=idx_array[j]; 2579 2581 number ref_coef=coef_array[j]; 2580 row[idx]=npAdd (row[idx],npMult(coef,ref_coef));2582 row[idx]=npAddM(row[idx],npMult(coef,ref_coef)); 2581 2583 } 2582 2584 #endif … … 2903 2905 } 2904 2906 2905 2907 number zero=npInit(0); 2906 2908 MonRedResNP* mon=(MonRedResNP*) omalloc(len*sizeof(MonRedResNP)); 2907 2909 int i=0; … … 2934 2936 number coef=red.coef; 2935 2937 int j; 2938 if (!(npIsOne(coef))){ 2936 2939 for(j=0;j<row->len;j++){ 2937 2940 int idx=row->idx_array[j]; 2938 temp_array[idx]=npAdd(temp_array[idx],npMult(row->coef_array[j],coef)); 2941 assume(!(npIsZero(coef))); 2942 assume(!(npIsZero(row->coef_array[j]))); 2943 temp_array[idx]=npAddM(temp_array[idx],npMultM(row->coef_array[j],coef)); 2939 2944 assume(idx<temp_size); 2945 }}else{ 2946 for(j=0;j<row->len;j++){ 2947 int idx=row->idx_array[j]; 2948 temp_array[idx]=npAddM(temp_array[idx],row->coef_array[j]); 2949 assume(idx<temp_size); 2950 } 2940 2951 } 2941 2952 } 2942 2953 else{ 2943 2954 if (red.ref->value_len==NoroCache::backLinkCode){ 2944 temp_array[red.ref->term_index]=npAdd (temp_array[red.ref->term_index],red.coef);2955 temp_array[red.ref->term_index]=npAddM(temp_array[red.ref->term_index],red.coef); 2945 2956 } else { 2946 2957 //PrintS("third case\n"); … … 2951 2962 int non_zeros=0; 2952 2963 for(i=0;i<cache->nIrreducibleMonomials;i++){ 2953 if (!( npIsZero(temp_array[i]))){2964 if (!(temp_array[i]==zero)){ 2954 2965 non_zeros++; 2955 2966 } … … 2958 2969 int pos=0; 2959 2970 for(i=0;i<cache->nIrreducibleMonomials;i++){ 2960 if (!( npIsZero(temp_array[i]))){2971 if (!(zero==temp_array[i])){ 2961 2972 2962 2973 res->idx_array[pos]=i;
Note: See TracChangeset
for help on using the changeset viewer.