Changeset 822445 in git


Ignore:
Timestamp:
Feb 21, 2007, 8:05:45 AM (17 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
af2ba96ba5dce1de2ed11faf0624dd9972ac71e4
Parents:
421e42f64cacb50c3475fbbae08023fddb74803b
Message:
*bricken: some modp op optimizations


git-svn-id: file:///usr/local/Singular/svn/trunk@9871 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    r421e42 r822445  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.141 2007-02-20 15:11:03 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.142 2007-02-21 07:05:45 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    19351935          //assume(FALSE);
    19361936          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]);
    19381938          }
    19391939        }
     
    19471947    assume((lower_bound<0)||(npIsZero(row_array[lower_bound])));
    19481948    int i;
     1949    number zero=npInit(0);
    19491950    for(i=lower_bound+1;i<ncols;i++){
    1950       if (!(npIsZero(row_array[i])))
     1951      if (!(row_array[i]==0))
    19511952        break;
    19521953    }
     
    20252026    if (upper_bound>nonZeroUntil) upper_bound=nonZeroUntil+1;
    20262027    int i;
     2028    number zero=npInit(0);
    20272029    for(i=upper_bound-1;i>r;i--){
    20282030      int start=startIndices[i];
    20292031      assume(start<ncols);
    2030       if (!(npIsZero(row_array[start]))){
     2032      if (!(row_array[start]==zero)){
    20312033        lastReducibleIndices[r]=start;
    20322034        return;
     
    20592061        assume(start>startIndices[other_row]);
    20602062        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]);
    20622064        }
    20632065        updateLastReducibleIndex(other_row,r);
     
    25402542    number coef=place_holders[i].coef;
    25412543    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);
    25432545    } else {
    25442546      #ifndef NORO_SPARSE_ROWS_PRE
     
    25522554        while(ref_begin!=ref_end){
    25532555
    2554           *my_pos=npAdd(*my_pos,npMult(coef,*ref_begin));
     2556          *my_pos=npAddM(*my_pos,npMult(coef,*ref_begin));
    25552557          ++ref_begin;
    25562558          ++my_pos;
     
    25602562        while(ref_begin!=ref_end){
    25612563
    2562           *my_pos=npAdd(*my_pos,*ref_begin);
     2564          *my_pos=npAddM(*my_pos,*ref_begin);
    25632565          ++ref_begin;
    25642566          ++my_pos;
     
    25782580      int idx=idx_array[j];
    25792581      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));
    25812583    }
    25822584    #endif
     
    29032905  }
    29042906 
    2905  
     2907  number zero=npInit(0);
    29062908  MonRedResNP* mon=(MonRedResNP*) omalloc(len*sizeof(MonRedResNP));
    29072909  int i=0;
     
    29342936        number coef=red.coef;
    29352937        int j;
     2938        if (!(npIsOne(coef))){
    29362939        for(j=0;j<row->len;j++){
    29372940          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));
    29392944          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          }
    29402951        }
    29412952      }
    29422953      else{
    29432954        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);
    29452956        } else {
    29462957          //PrintS("third case\n");
     
    29512962  int non_zeros=0;
    29522963  for(i=0;i<cache->nIrreducibleMonomials;i++){
    2953     if (!(npIsZero(temp_array[i]))){
     2964    if (!(temp_array[i]==zero)){
    29542965      non_zeros++;
    29552966    }
     
    29582969  int pos=0;
    29592970  for(i=0;i<cache->nIrreducibleMonomials;i++){
    2960     if (!(npIsZero(temp_array[i]))){
     2971    if (!(zero==temp_array[i])){
    29612972   
    29622973      res->idx_array[pos]=i;
Note: See TracChangeset for help on using the changeset viewer.