Changeset b158b77 in git


Ignore:
Timestamp:
Aug 15, 2014, 7:30:57 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
7e57e1137da523924bcff7f5387d9b00e599679a8664f3a2ab7076c6ef0da4380e7c25276945221f
Parents:
9da0b07b27964cfe1c3008ebfe22189d1d052727
Message:
rewrite of rCheckOrdSgn and setting of r->OrdSgn
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r9da0b0 rb158b77  
    15681568  /* the last block: everything is 0 */
    15691569  r->order[2]  = 0;
    1570   /*polynomial ring*/
    1571   r->OrdSgn    = 1;
    15721570
    15731571  /* complete ring intializations */
     
    23072305      R->order[j] = (int) ringorder_unspec;
    23082306    // orderings
    2309     R->OrdSgn=1;
    23102307    for(j=0;j<n-1;j++)
    23112308    {
  • libpolys/polys/monomials/ring.cc

    r9da0b0 rb158b77  
    134134  r->block0 = block0;
    135135  r->block1 = block1;
    136   /*polynomial ring*/
    137   r->OrdSgn    = 1;
    138136
    139137  /* complete ring intializations */
     
    28252823  /* the last block: everything is 0 */
    28262824  res->order[2]  = 0;
    2827   /*polynomial ring*/
    2828   res->OrdSgn    = 1;
    28292825
    28302826  //int tmpref=r->cf->ref;
     
    33603356  r->ExpPerLong = BIT_SIZEOF_LONG / bits;
    33613357  r->divmask=rGetDivMask(bits);
     3358  if (r->OrdSgn!=-1) r->OrdSgn=1; //rCheckOrdSgn will changed that, if needed
    33623359
    33633360  // will be used for ordsgn:
     
    37513748}
    37523749
    3753 static void rCheckOrdSgn(ring r,int i/*current block*/)
    3754 { // set r->OrdSgn
    3755   int jj;
    3756   int oo=-1;
    3757   int notfound=1;
    3758   for(jj=i-1;jj>=0;jj--)
    3759   {
    3760     if(((r->order[jj]==ringorder_a)
    3761       ||(r->order[jj]==ringorder_aa)
    3762       ||(r->order[jj]==ringorder_a64))
    3763     &&(r->block0[jj]<=r->block0[i])
    3764     &&(r->block1[jj]>=r->block1[i]))
    3765     {
    3766       int res=1;
    3767       if (r->order[jj]!=ringorder_a64)
    3768       {
    3769         for(int j=r->block1[jj]-r->block0[jj]; j>=0;j--)
     3750static void rCheckOrdSgn(ring r,int b/*current block*/)
     3751{ // set r->OrdSgn, return, if already checked
     3752  if (r->OrdSgn==-1) return;
     3753  // for each variable:
     3754  for(int i=1;i<=r->N;i++)
     3755  {
     3756    int found=0;
     3757    // for all blocks:
     3758    for(int j=0;(j<=b) && (found==0);j++)
     3759    {
     3760      // search the first block containing var(i)
     3761      if ((r->block0[j]<=i)&&(r->block1[j]>=i))
     3762      {
     3763        // what kind if block is it?
     3764        if ((r->order[j]==ringorder_ls)
     3765        || (r->order[j]==ringorder_ds)
     3766        || (r->order[j]==ringorder_Ds)
     3767        || (r->order[j]==ringorder_ws)
     3768        || (r->order[j]==ringorder_Ws)
     3769        || (r->order[j]==ringorder_rs))
    37703770        {
    3771           if(r->wvhdl[jj][j]<=0) { res=-1; break;}
    3772         }
    3773       }
    3774       oo=res;
    3775       notfound=0;
    3776     }
    3777     r->OrdSgn=oo;
    3778   }
    3779   if (notfound
    3780   && ((r->order[i]==ringorder_ls)
    3781      || (r->order[i]==ringorder_ds)
    3782      || (r->order[i]==ringorder_Ds)
    3783      || (r->order[i]==ringorder_ws)
    3784      || (r->order[i]==ringorder_Ws)
    3785      || (r->order[i]==ringorder_rs))
    3786   )
    3787     r->OrdSgn=-1;
    3788 }
    3789 
     3771          r->OrdSgn=-1;
     3772          return;
     3773        }
     3774        if((r->order[j]==ringorder_a)
     3775        ||(r->order[j]==ringorder_aa))
     3776        {
     3777          // <0: local/mixed ordering return
     3778          // >0: var(i) is okay, look at other vars
     3779          // ==0: look at other blocks for var(i)
     3780          if(r->wvhdl[j][i-r->block0[j]]<0) { r->OrdSgn=-1; return;}
     3781          if(r->wvhdl[j][i-r->block0[j]]>0) { found=1; break;}
     3782        }
     3783      }
     3784    }
     3785  }
     3786  // no local var found in 1..N:
     3787  //r->OrdSgn=1;
     3788}
    37903789
    37913790void rUnComplete(ring r)
     
    46974696    res->block1[0] = r->N;
    46984697  }
    4699   // HANNES: This sould be set in rComplete
    4700   res->OrdSgn = 1;
    47014698  rComplete(res, 1);
    47024699#ifdef HAVE_PLURAL
Note: See TracChangeset for help on using the changeset viewer.