Changeset a3cc3fc in git


Ignore:
Timestamp:
Dec 15, 2014, 5:19:38 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'd0474371d8c5d8068ab70bfb42719c97936b18a6')
Children:
fe6b623ec279088e48111ca37e0592c7d7a54822
Parents:
8104914d2d708e24127bd8e7c8155a42a11e2ee4
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-12-15 17:19:38+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-12-15 18:49:40+01:00
Message:
Fix slimgb (tgb*) to count the use of inline 'np[A-Z][a-z]*M' functions from modulop.h

CHG: internal (non-inline) np[A-Z][a-z]* calls replaced by corresponding inline wrapper n_[A-Z][a-z]*
Location:
kernel/GBEngine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/tgb.cc

    r810491 ra3cc3fc  
    2525#include <polys/nc/sca.h>
    2626#include <polys/prCopy.h>
    27 #include <coeffs/longrat.h>
    28 #include <coeffs/modulop.h>
     27
     28#include <coeffs/longrat.h> // nlQlogSize
    2929
    3030#include <stdlib.h>
  • kernel/GBEngine/tgb_internal.h

    r810491 ra3cc3fc  
    5353#include <stdlib.h>
    5454
     55#include <misc/options.h>
     56
     57#include <coeffs/modulop.h>
     58
    5559#include <polys/monomials/p_polys.h>
     60#include <polys/monomials/ring.h>
     61#include <polys/kbuckets.h>
    5662
    5763#include <kernel/ideals.h>
    58 #include <polys/monomials/ring.h>
    59 #include <misc/options.h>
    6064#include <kernel/polys.h>
     65
    6166#include <kernel/GBEngine/kutil.h>
    6267#include <kernel/GBEngine/kInline.h>
    6368#include <kernel/GBEngine/kstd1.h>
    64 #include <polys/kbuckets.h>
    65 #include <coeffs/modulop.h>
     69
     70
     71#if 1
     72
     73#define npInit n_Init
     74#define npNeg n_InpNeg
     75#define npInvers n_Invers
     76#define npMult n_Mult
     77#define npIsOne n_IsOne
     78#define npIsZero n_IsZero
     79
     80#else
     81#error Please do NOT call internal functions directly!
     82#endif
     83
    6684
    6785class PolySimple
     
    925943      assume(bpos<256);
    926944      assume(!(npIsZero((number)(long) buffer[bpos],currRing->cf)));
    927       temp_array[idx]=F4mat_to_number_type(npAddM((number)(long) temp_array[idx], (number)(long) buffer[bpos++],currRing->cf));
     945      STATISTIC(n_Add); temp_array[idx]=F4mat_to_number_type(npAddM((number)(long) temp_array[idx], (number)(long) buffer[bpos++],currRing->cf));
    928946      assume(idx<temp_size);
    929947    }
     
    971989      assume(bpos<256);
    972990      //assume(!(npIsZero((number) buffer[bpos])));
    973       temp_array[i]=F4mat_to_number_type(npAddM((number)(long) temp_array[i], (number)(long) buffer[bpos++],currRing->cf));
     991      STATISTIC(n_Add); temp_array[i]=F4mat_to_number_type(npAddM((number)(long) temp_array[i], (number)(long) buffer[bpos++],currRing->cf));
    974992      assume(i<temp_size);
    975993    }
     
    9961014  for(i=0;i<len;i++)
    9971015  {
    998       temp_array[i]=F4mat_to_number_type(npAddM((number)(long) temp_array[i], (number)(long) row[i],currRing->cf));
     1016      STATISTIC(n_Add); temp_array[i]=F4mat_to_number_type(npAddM((number)(long) temp_array[i], (number)(long) row[i],currRing->cf));
    9991017      assume(i<temp_size);
    10001018  }
     
    10211039  {
    10221040
    1023       temp_array[i]=F4mat_to_number_type(npSubM((number)(long) temp_array[i], (number)(long) row[i],currRing->cf));
     1041      STATISTIC(n_Sub); temp_array[i]=F4mat_to_number_type(npSubM((number)(long) temp_array[i], (number)(long) row[i],currRing->cf));
    10241042      assume(i<temp_size);
    10251043  }
     
    10411059        {
    10421060          int idx=idx_array[j];
    1043           temp_array[idx]=F4mat_to_number_type(   (number_type)(long)npAddM((number) (long)temp_array[idx],(number)(long) coef_array[j],currRing->cf));
     1061          STATISTIC(n_Add); temp_array[idx]=F4mat_to_number_type(   (number_type)(long)npAddM((number) (long)temp_array[idx],(number)(long) coef_array[j],currRing->cf));
    10441062          assume(idx<temp_size);
    10451063        }
     
    10591077        {
    10601078          int idx=idx_array[j];
    1061           temp_array[idx]=F4mat_to_number_type(  (number_type)(long) npSubM((number) (long)temp_array[idx],(number)(long) coef_array[j],currRing->cf));
     1079          STATISTIC(n_Sub); temp_array[idx]=F4mat_to_number_type(  (number_type)(long) npSubM((number) (long)temp_array[idx],(number)(long) coef_array[j],currRing->cf));
    10621080          assume(idx<temp_size);
    10631081        }
     
    11221140         if (red.ref->value_len==NoroCache<number_type>::backLinkCode)
    11231141         {
    1124            temp_array[red.ref->term_index]=F4mat_to_number_type( npAddM((number)(long) temp_array[red.ref->term_index],red.coef,currRing->cf));
     1142           STATISTIC(n_Add); temp_array[red.ref->term_index]=F4mat_to_number_type( npAddM((number)(long) temp_array[red.ref->term_index],red.coef,currRing->cf));
    11251143         }
    11261144         else
     
    11701188    assume(coef_array[j]!=0);
    11711189    CoefIdx<number_type> ci;
    1172     ci.coef=F4mat_to_number_type(npMultM((number)(long) coef,(number)(long) coef_array[j],currRing->cf));
     1190    STATISTIC(n_Mult); ci.coef=F4mat_to_number_type(npMultM((number)(long) coef,(number)(long) coef_array[j],currRing->cf));
    11731191    ci.idx=idx_array[j];
    11741192    pairs[pos++]=ci;
     
    11851203      assume(coef_array[j]!=0);
    11861204      CoefIdx<number_type> ci;
    1187       ci.coef=F4mat_to_number_type(npMultM((number)(long) coef,(number)(long) coef_array[j],currRing->cf));
     1205      STATISTIC(n_Mult); ci.coef=F4mat_to_number_type(npMultM((number)(long) coef,(number)(long) coef_array[j],currRing->cf));
    11881206      assume(ci.coef!=0);
    11891207      ci.idx=j;
     
    12201238      assume(coef_array[j]!=0);
    12211239      CoefIdx<number_type> ci;
    1222       ci.coef=F4mat_to_number_type(npNegM((number)(long) coef_array[j],currRing->cf));
     1240      STATISTIC(n_InpNeg); ci.coef=F4mat_to_number_type(npNegM((number)(long) coef_array[j],currRing->cf)); // FIXME: inplace negation! // TODO: check if this is not a bug!?
    12231241      assume(ci.coef!=0);
    12241242      ci.idx=j;
     
    12471265    assume(coef_array[j]!=0);
    12481266    CoefIdx<number_type> ci;
    1249     ci.coef=F4mat_to_number_type(npNegM((number)(unsigned long)coef_array[j],currRing->cf));
     1267    STATISTIC(n_InpNeg); ci.coef=F4mat_to_number_type(npNegM((number)(unsigned long)coef_array[j],currRing->cf));  // FIXME: inplace negation! // TODO: check if this is not a bug!?
    12501268    ci.idx=idx_array[j];
    12511269    pairs[pos++]=ci;
     
    13551373    else
    13561374    {
    1357       pairs[act].coef=F4mat_to_number_type(npAddM((number)(long)pairs[act].coef,(number)(long)pairs[i].coef,currRing->cf));
     1375      STATISTIC(n_Add); pairs[act].coef=F4mat_to_number_type(npAddM((number)(long)pairs[act].coef,(number)(long)pairs[i].coef,currRing->cf));
    13581376    }
    13591377  }
     
    15521570          {
    15531571            if (row_array[i]!=zero)
     1572            { STATISTIC(n_Sub);           
    15541573              other_row_array[i]=F4mat_to_number_type(npSubM((number)(long) other_row_array[i], (number)(long) row_array[i],currRing->cf));
     1574            }
     1575             
    15551576          }
    15561577      }
     
    15611582          {
    15621583            if (row_array[i]!=zero)
    1563             other_row_array[i]=F4mat_to_number_type(npAddM(npMult(coef2,(number)(long) row_array[i],currRing->cf),(number)(long) other_row_array[i],currRing->cf));
     1584            { STATISTIC(n_Add);
     1585              other_row_array[i]=F4mat_to_number_type(npAddM(npMult(coef2,(number)(long) row_array[i],currRing->cf),(number)(long) other_row_array[i],currRing->cf));
     1586            }
     1587             
    15641588          }
    15651589        }
     
    17091733        {
    17101734          if (row_array[i]!=zero)
     1735          {
     1736            STATISTIC(n_Add);
    17111737            other_row_array[i]=F4mat_to_number_type(npAddM(npMult(coef,(number)(long)row_array[i],currRing->cf),(number)(long)other_row_array[i],currRing->cf));
     1738          }       
    17121739        }
    17131740        updateLastReducibleIndex(other_row,r);
Note: See TracChangeset for help on using the changeset viewer.