Changeset ab4778 in git


Ignore:
Timestamp:
Jul 5, 2007, 6:14:37 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
dbbae8ad9d24434738b0b3ea68b2b59f3601865d
Parents:
87ca280121eddcc2c20db318c497a45145dd11ec
Message:
*hannes: optim.


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

Legend:

Unmodified
Added
Removed
  • kernel/p_polys.cc

    r87ca280 rab4778  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_polys.cc,v 1.7 2007-07-05 10:00:10 Singular Exp $
     9 *  Version: $Id: p_polys.cc,v 1.8 2007-07-05 16:14:37 Singular Exp $
    1010 *******************************************************************/
    1111
     
    7676             if (ord<ai) pSetm_error=TRUE;
    7777          }
    78 #endif 
     78#endif
    7979          p->exp[o->data.wp.place]=ord;
    8080          break;
     
    8282      case ro_wp64:
    8383        {
    84           int64 ord=0;
     84          int64 ord=0;
    8585          int a,e;
    8686          a=o->data.wp64.start;
     
    9494            wi=w[i-a];
    9595            ai=ei*wi;
    96             if(ei!=0 && ai/ei!=wi){
     96            if(ei!=0 && ai/ei!=wi){
    9797              pSetm_error=TRUE;
    9898              Print("ai %lld, wi %lld\n",ai,wi);
     
    108108          long a_1=(long)(ord >>31 ); /*(ord/(mask+1));*/
    109109
    110           //Print("mask: %x,  ord: %d,  a_0: %d,  a_1: %d\n"
    111           //,(int)mask,(int)ord,(int)a_0,(int)a_1);
    112                     //Print("mask: %d",mask);
     110          //Print("mask: %x,  ord: %d,  a_0: %d,  a_1: %d\n"
     111          //,(int)mask,(int)ord,(int)a_0,(int)a_1);
     112                    //Print("mask: %d",mask);
    113113
    114114          p->exp[o->data.wp64.place]=a_1;
    115           p->exp[o->data.wp64.place+1]=a_0;
     115          p->exp[o->data.wp64.place+1]=a_0;
    116116//            if(p_Setm_error) Print("***************************\n
    117117//                                    ***************************\n
     
    134134          int c=p_GetComp(p,r);
    135135          long sc = c;
    136           int* Components = (_ExternalComponents ? _Components : 
     136          int* Components = (_ExternalComponents ? _Components :
    137137                             o->data.syzcomp.Components);
    138           long* ShiftedComponents = (_ExternalComponents ? _ShiftedComponents: 
     138          long* ShiftedComponents = (_ExternalComponents ? _ShiftedComponents:
    139139                                     o->data.syzcomp.ShiftedComponents);
    140140          if (ShiftedComponents != NULL)
     
    203203p_SetmProc p_GetSetmProc(ring r)
    204204{
    205   // covers lp, rp, ls, 
     205  // covers lp, rp, ls,
    206206  if (r->typ == NULL) return p_Setm_Dummy;
    207207
    208208  if (r->OrdSize == 1)
    209209  {
    210     if (r->typ[0].ord_typ == ro_dp && 
     210    if (r->typ[0].ord_typ == ro_dp &&
    211211        r->typ[0].data.dp.start == 1 &&
    212212        r->typ[0].data.dp.end == r->N &&
    213213        r->typ[0].data.dp.place == r->pOrdIndex)
    214214      return p_Setm_TotalDegree;
    215     if (r->typ[0].ord_typ == ro_wp && 
     215    if (r->typ[0].ord_typ == ro_wp &&
    216216        r->typ[0].data.wp.start == 1 &&
    217217        r->typ[0].data.wp.end == r->N &&
     
    258258}
    259259
    260 // pWTotalDegree for weighted orderings 
     260// pWTotalDegree for weighted orderings
    261261// whose first block covers all variables
    262262inline long _pWFirstTotalDegree(poly p, ring r)
     
    264264  int i;
    265265  long sum = 0;
    266  
     266
    267267  for (i=1; i<= r->firstBlockEnds; i++)
    268268  {
     
    287287  int i, k;
    288288  long j =0;
    289   int factor;
    290289
    291290  // iterate through each block:
    292291  for (i=0;r->order[i]!=0;i++)
    293292  {
    294     factor=1;
     293    int b0=r->block0[i];
     294    int b1=r->block1[i];
    295295    switch(r->order[i])
    296296    {
    297297      case ringorder_M:
    298            factor=r->OrdSgn;
     298        for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
     299        { // in jedem block:
     300          j+= p_GetExp(p,k,r)*r->wvhdl[i][k - b0 /*r->block0[i]*/]*r->OrdSgn;
     301        }
     302        break;
    299303      case ringorder_wp:
    300304      case ringorder_ws:
    301305      case ringorder_Wp:
    302306      case ringorder_Ws:
    303         for (k=r->block0[i];k<=r->block1[i];k++)
     307        for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
    304308        { // in jedem block:
    305           j+= p_GetExp(p,k,r)*r->wvhdl[i][k - r->block0[i]]*factor;
     309          j+= p_GetExp(p,k,r)*r->wvhdl[i][k - b0 /*r->block0[i]*/];
    306310        }
    307311        break;
     
    313317      case ringorder_Ds:
    314318      case ringorder_rp:
    315         for (k=r->block0[i];k<=r->block1[i];k++)
     319        for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
    316320        {
    317321          j+= p_GetExp(p,k,r);
     
    321325        {
    322326          int64* w=(int64*)r->wvhdl[i];
    323           for (k=0;k<=(r->block1[i] - r->block0[i]);k++)
    324           { 
     327          for (k=0;k<=(b1 /*r->block1[i]*/ - b0 /*r->block0[i]*/);k++)
     328          {
    325329            //there should be added a line which checks if w[k]>2^31
    326330            j+= p_GetExp(p,k+1, r)*(long)w[k];
     
    336340        break;
    337341      case ringorder_a:
    338         for (k=r->block0[i];k<=r->block1[i];k++)
     342        for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
    339343        { // only one line
    340           j+= p_GetExp(p,k, r)*r->wvhdl[i][ k- r->block0[i]];
     344          j+= p_GetExp(p,k, r)*r->wvhdl[i][ k- b0 /*r->block0[i]*/];
    341345        }
    342346        //break;
     
    430434  if (! rIsSyzIndexRing(r))
    431435  {
    432     while (pNext(p) != NULL) 
     436    while (pNext(p) != NULL)
    433437    {
    434438      pIter(p);
     
    758762 ***************************************************************/
    759763
    760 static inline unsigned long 
    761 p_GetMaxExpL2(unsigned long l1, unsigned long l2, ring r, 
     764static inline unsigned long
     765p_GetMaxExpL2(unsigned long l1, unsigned long l2, ring r,
    762766              unsigned long number_of_exp)
    763767{
     
    800804  unsigned long l_p, l_max;
    801805  unsigned long divmask = r->divmask;
    802  
     806
    803807  do
    804808  {
     
    807811    l_max = max->exp[offset];
    808812    // do the divisibility trick to find out whether l has an exponent
    809     if (l_p > l_max || 
     813    if (l_p > l_max ||
    810814        (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
    811815      max->exp[offset] = p_GetMaxExpL2(l_max, l_p, r);
     
    817821      l_max = max->exp[offset];
    818822      // do the divisibility trick to find out whether l has an exponent
    819       if (l_p > l_max || 
     823      if (l_p > l_max ||
    820824          (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
    821825        max->exp[offset] = p_GetMaxExpL2(l_max, l_p, r);
     
    831835  unsigned long l_p, divmask = r->divmask;
    832836  int i;
    833  
     837
    834838  while (p != NULL)
    835839  {
     
    842846      l_p = p->exp[r->VarL_Offset[i]];
    843847      // do the divisibility trick to find out whether l has an exponent
    844       if (l_p > l_max || 
     848      if (l_p > l_max ||
    845849          (((l_max & divmask) ^ (l_p & divmask)) != ((l_max-l_p) & divmask)))
    846850        l_max = p_GetMaxExpL2(l_max, l_p, r);
     
    853857
    854858
    855    
     859
    856860/***************************************************************
    857861 *
Note: See TracChangeset for help on using the changeset viewer.