Changeset 4c7d73 in git


Ignore:
Timestamp:
May 4, 2005, 5:25:46 PM (18 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
28543b21d1a59aaa89526434e42b6376b8886667
Parents:
50c4143c24b16b5b07afa95f93b9bb62cd380180
Message:
*hannes: frwalk stuff


git-svn-id: file:///usr/local/Singular/svn/trunk@8045 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile.in

    r50c414 r4c7d73  
    107107    timer.cc weight.cc \
    108108    GMPrat.cc multicnt.cc npolygon.cc semic.cc spectrum.cc splist.cc \
    109     mod_raw.cc sing_win.cc\
     109    mod_raw.cc sing_win.cc walkProc.cc walkMain.cc walkSupport.cc\
    110110    eigenval.cc units.cc kbuckets.cc sbuckets.cc\
    111111    mpr_inout.cc mpr_base.cc mpr_numeric.cc \
     
    150150        ring.h timer.h dError.h fast_maps.h \
    151151        febase.h shortfl.h mpr_complex.h mpr_global.h \
    152         gring.h \
     152        gring.h walkProc.h walkMain.h walkSupport.h\
    153153        ffields.h khstd.h sparsmat.h gnumpfl.h gnumpc.h \
    154154        fglm.h kstd1.h modulop.h sing_dbm.h weight.h \
  • kernel/mod_raw.cc

    r50c414 r4c7d73  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mod_raw.cc,v 1.2 2004-08-13 10:40:53 Singular Exp $ */
     4/* $Id: mod_raw.cc,v 1.3 2005-05-04 15:25:45 Singular Exp $ */
    55/*
    66 * ABSTRACT: machine depend code for dynamic modules
     
    99 *           dynl_sym()
    1010 *           dynl_error()
    11  *           dunl_close()
     11 *           dynl_close()
    1212*/
    1313
  • kernel/ring.cc

    r50c414 r4c7d73  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.36 2005-05-04 14:13:16 Singular Exp $ */
     4/* $Id: ring.cc,v 1.37 2005-05-04 15:25:45 Singular Exp $ */
    55
    66/*
     
    294294    ||(r->order[l] == ringorder_M)
    295295    ||(r->order[l] == ringorder_a)
     296    ||(r->order[l] == ringorder_a64)
    296297    ||(r->order[l] == ringorder_aa))
    297298    {
     
    319320        for (i = 0; i<=r->block1[l]-r->block0[l]; i++)
    320321        {
    321           Print("%*d " ,nlen,r->wvhdl[l][i+j],i+j);
     322          if (r->order[l] == ringorder_a64)
     323          { int64 *w=(int64 *)r->wvhdl[l];
     324            Print("%*lld " ,nlen,w[i+j],i+j);
     325          }
     326          else
     327            Print("%*d " ,nlen,r->wvhdl[l][i+j],i+j);
    322328        }
    323329        if (r->order[l]!=ringorder_M) break;
     
    473479        {
    474480          char c=',';
    475           for (i = 0; i<r->block1[l]-r->block0[l]; i++)
     481          if(r->order[l]==ringorder_a64)
    476482          {
    477             StringAppend("%d," ,r->wvhdl[l][i+j]);
     483            int64 * w=(int64 *)r->wvhdl[l];
     484            for (i = 0; i<r->block1[l]-r->block0[l]; i++)
     485            {
     486              StringAppend("%lld," ,w[i]);
     487            }
     488            StringAppend("%lld)" ,w[i]);
     489            break;
     490          }
     491          else
     492          {
     493            for (i = 0; i<r->block1[l]-r->block0[l]; i++)
     494            {
     495              StringAppend("%d," ,r->wvhdl[l][i+j]);
     496            }
    478497          }
    479498          if (r->order[l]!=ringorder_M)
     
    12801299 * DOES NOT CALL rComplete
    12811300 */
    1282 static ring rCopy0(ring r, BOOLEAN copy_qideal = TRUE,
    1283                    BOOLEAN copy_ordering = TRUE)
     1301ring rCopy0(ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
    12841302{
    12851303  if (r == NULL) return NULL;
     
    16301648        case ringorder_M:
    16311649          return 2; /*don't know*/
     1650        case ringorder_a64: /* assume: all weight are non-negative!*/
    16321651        case ringorder_lp:
    16331652        case ringorder_rp:
     
    18251844    }
    18261845  }
     1846}
     1847
     1848static void rO_WDegree64(int &place, int &bitplace, int start, int end,
     1849    long *o, sro_ord &ord_struct, int64 *weights)
     1850{
     1851  // weighted degree (aligned) of variables v_start..v_end, ordsgn 1,
     1852  // reserved 2 places
     1853  rO_Align(place,bitplace);
     1854  ord_struct.ord_typ=ro_wp64;
     1855  ord_struct.data.wp64.start=start;
     1856  ord_struct.data.wp64.end=end;
     1857  ord_struct.data.wp64.place=place;
     1858  ord_struct.data.wp64.weights64=weights;
     1859  o[place]=1;
     1860  place++;
     1861  o[place]=1;
     1862  place++;
     1863  rO_Align(place,bitplace);
     1864  int i;
    18271865}
    18281866
     
    24022440    case ringorder_a:
    24032441    case ringorder_aa:
     2442    case ringorder_a64:
    24042443      if (r->OrdSgn==-1) r->MixedOrder=TRUE;
    24052444      break;
     
    24412480  r->firstBlockEnds=block1[i];
    24422481  r->firstwv = wvhdl[i];
    2443   if ((order[i]== ringorder_ws) || (order[i]==ringorder_Ws))
     2482  if ((order[i]== ringorder_ws) || (order[i]==ringorder_Ws)
     2483  || (order[i]== ringorder_wp) || (order[i]==ringorder_Wp)
     2484  || (order[i]== ringorder_a) /*|| (order[i]==ringorder_A)*/)
    24442485  {
    24452486    int j;
    24462487    for(j=block1[i]-r->block0[i];j>=0;j--)
    2447       if (r->firstwv[j]<0) { r->MixedOrder=TRUE; break; }
     2488    {
     2489      if (r->firstwv[j]<0) r->MixedOrder=TRUE;
     2490      if (r->firstwv[j]==0) r->LexOrder=TRUE;
     2491    }
     2492  }
     2493  else if (order[i]==ringorder_a64)
     2494  {
     2495    int j;
     2496    int64 *w=rGetWeightVec(r);
     2497    for(j=block1[i]-r->block0[i];j>=0;j--)
     2498    {
     2499      if (w[j]==0) r->LexOrder=TRUE;
     2500    }
    24482501  }
    24492502}
     
    26792732        break;
    26802733
     2734      case ringorder_a64:
     2735        rO_WDegree64(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,
     2736                     tmp_typ[typ_i], (int64 *)(r->wvhdl[i]));
     2737        typ_i++;
     2738        break;
     2739
    26812740      case ringorder_c:
    26822741        rO_Align(j, j_bits);
     
    31023161    return;
    31033162  }
    3104   char *TYP[]={"ro_dp","ro_wp","ro_wp_neg","ro_cp",
     3163  char *TYP[]={"ro_dp","ro_wp","ro_wp64","ro_wp_neg","ro_cp",
    31053164               "ro_syzcomp", "ro_syz", "ro_none"};
    31063165  int i,j;
     
    31393198          Print(" %d",r->typ[j].data.wp.weights[l-r->typ[j].data.wp.start]);
    31403199      }
     3200      else if (r->typ[j].ord_typ==ro_wp64)
     3201      {
     3202        Print(" w64:");
     3203        int l;
     3204        for(l=r->typ[j].data.wp64.start;l<=r->typ[j].data.wp64.end;l++)
     3205          Print(" %l",(long)(((int64*)r->typ[j].data.wp64.weights64)+l-r->typ[j].data.wp64.start));
     3206      }
    31413207    }
    31423208    PrintLn();
     
    35553621}
    35563622
    3557 int * rGetWeightVec(ring r)
     3623int64 * rGetWeightVec(ring r)
    35583624{
    35593625  assume(r!=NULL);
    35603626  assume(r->OrdSize>0);
    3561   assume(r->typ[0].ord_typ==ro_wp);
    3562   return (r->typ[0].data.wp.weights);
    3563 }
    3564 
    3565 void rSetWeightVec(ring r, int *wv)
     3627  int i=0;
     3628  while((r->typ[i].ord_typ!=ro_wp64) && (r->typ[i].ord_typ>0)) i++;
     3629  assume(r->typ[i].ord_typ==ro_wp64);
     3630  return (int64*)(r->typ[i].data.wp64.weights64);
     3631}
     3632
     3633void rSetWeightVec(ring r, int64 *wv)
    35663634{
    35673635  assume(r!=NULL);
    35683636  assume(r->OrdSize>0);
    3569   assume(r->typ[0].ord_typ==ro_wp);
    3570   memcpy(r->typ[0].data.wp.weights,wv,r->N*sizeof(int));
     3637  assume(r->typ[0].ord_typ==ro_wp64);
     3638  memcpy(r->typ[0].data.wp64.weights64,wv,r->N*sizeof(int64));
    35713639}
    35723640
     
    39604028  return FALSE;
    39614029}
     4030
     4031void rModify_a_to_A(ring r)
     4032// to be called BEFORE rComplete:
     4033// changes every Block with a(...) to A(...)
     4034{
     4035   int i=0;
     4036   int j;
     4037   while(r->order[i]!=0)
     4038   {
     4039      if (r->order[i]==ringorder_a)
     4040      {
     4041        r->order[i]=ringorder_a64;
     4042        int *w=r->wvhdl[i];
     4043        int64 *w64=(int64 *)omAlloc((r->block1[i]-r->block0[i]+1)*sizeof(int64));
     4044        for(j=r->block1[i]-r->block0[i];j>=0;j--)
     4045                w64[j]=(int64)w[j];
     4046        r->wvhdl[i]=(int*)w64;
     4047        omFreeSize(w,(r->block1[i]-r->block0[i]+1)*sizeof(int));
     4048      }
     4049      i++;
     4050   }
     4051}
  • kernel/ring.h

    r50c414 r4c7d73  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.9 2005-05-04 14:13:17 Singular Exp $ */
     9/* $Id: ring.h,v 1.10 2005-05-04 15:25:46 Singular Exp $ */
    1010
    1111/* includes */
     
    2828void   rKill(ring r);
    2929ring   rCopy(ring r);
     30ring rCopy0(ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE);
    3031ring   rOpposite(ring r);
    3132ring   rEnvelope(ring r);
     33
    3234
    3335
     
    272274// construct Wp, C ring
    273275ring rModifyRing_Wp(ring r, int* weights);
     276void rModify_a_to_A(ring r);
    274277
    275278void rKillModifiedRing(ring r);
     
    283286void pDebugPrint(poly p);
    284287
    285 int * rGetWeightVec(ring r);
    286 void rSetWeightVec(ring r, int *);
     288int64 * rGetWeightVec(ring r);
     289void rSetWeightVec(ring r, int64 *wv);
    287290
    288291lists rDecompose(const ring r);
Note: See TracChangeset for help on using the changeset viewer.