Changeset b9642b1 in git


Ignore:
Timestamp:
Jan 6, 2009, 3:00:57 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
Children:
577c14692ef00b8a6d8470158473aeb6af6b08b3
Parents:
939cb2de97b36ac54735806ce7150c37d0450106
Message:
*hannes: remove OrdSgn, part 1


git-svn-id: file:///usr/local/Singular/svn/trunk@11277 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r939cb2 rb9642b1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.197 2008-10-13 12:45:29 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.198 2009-01-06 14:00:57 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    14091409  if(!idIsZeroDim(I)) return NULL; // not zero-dim.
    14101410  poly po=NULL;
    1411   if (currRing->OrdSgn== -1)
     1411  if (rHasLocalOrMixedOrdering(currRing))
    14121412  {
    14131413    scComputeHC(I,currQuotient,ak,po);
  • kernel/gring.h

    r939cb2 rb9642b1  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: gring.h,v 1.25 2008-07-15 16:27:58 motsak Exp $ */
     6/* $Id: gring.h,v 1.26 2009-01-06 13:59:35 Singular Exp $ */
    77/*
    88* ABSTRACT additional defines etc for --with-plural
     
    231231
    232232/*
    233   if (pOrdSgn==-1)
     233  if (rHasLocalOrMixedOrder(currRing))
    234234  {
    235235    assume(currRing->GetNC()->p_Procs.LocalGB!=NULL);
  • kernel/ideals.cc

    r939cb2 rb9642b1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.62 2008-11-12 16:06:50 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.63 2009-01-06 13:59:35 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    687687
    688688  homog = idHomModule(h1,currQuotient,&wth);
    689   if ((currRing->OrdSgn == 1) && (!homog))
    690   {
    691     Warn("minbase applies only to the local or homogeneous case");
     689  if (rHasGlobalOrdering() && (!homog))
     690  {
     691    WarnS("minbase applies only to the local or homogeneous case");
    692692    e=idCopy(h1);
    693693    return e;
  • kernel/ring.cc

    r939cb2 rb9642b1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.105 2008-11-12 12:38:59 Singular Exp $ */
     4/* $Id: ring.cc,v 1.106 2009-01-06 13:59:35 Singular Exp $ */
    55
    66/*
     
    14631463  int i,j;
    14641464  ring res=(ring)omAllocBin(ip_sring_bin);
     1465  res->idroot=NULL; /* local objects */
     1466  //int*       order;  /* array of orderings */
     1467  //int*       block0; /* starting pos.*/
     1468  //int*       block1; /* ending pos.*/
     1469  //char**     parameter; /* names of parameters */
     1470  //number     minpoly;
     1471  //ideal      minideal;
     1472  //int**      wvhdl;  /* array of weight vectors */
     1473  //char **    names;  /* array of variable names */
     1474
     1475  res->options=r->options; /* ring dependent options */
     1476
     1477  // what follows below here should be set by rComplete, _only_
     1478  //long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
     1479                       /*  ExpL_Size entries*/
     1480
     1481  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
     1482  //sro_ord*   typ;   /* array of orderings + sizes, OrdSize entries */
     1483
     1484  //ideal      qideal; /* extension to the ring structure: qring */
     1485
     1486
     1487  //int*     VarOffset;
     1488  //int*     firstwv;
     1489
     1490  //struct omBin_s*   PolyBin; /* Bin from where monoms are allocated */
     1491  res->ch=r->ch;     /* characteristic */
     1492#ifdef HAVE_RINGS
     1493  res->ringtype=r->ringtype;  /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */
     1494  //res->ringflaga=mpz_copy(r->ringflaga);
     1495  res->ringflagb=r->ringflagb;
     1496#endif
     1497  res->ref=0; /* reference counter to the ring */
     1498
     1499  res->float_len=r->float_len; /* additional char-flags */
     1500  res->float_len2=r->float_len2; /* additional char-flags */
     1501
     1502  res->N=r->N;      /* number of vars */
     1503
     1504  res->P=r->P;      /* number of pars */
     1505  res->OrdSgn=r->OrdSgn; /* 1 for polynomial rings, -1 otherwise */
     1506
     1507  res->firstBlockEnds=r->firstBlockEnds;
     1508#ifdef HAVE_PLURAL
     1509  res->real_var_start=r->real_var_start;
     1510  res->real_var_end=r->real_var_end;
     1511#endif
     1512
     1513#ifdef HAVE_SHIFTBBA
     1514  res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
     1515#endif
     1516
     1517  res->VectorOut=r->VectorOut;
     1518  res->ShortOut=r->ShortOut;
     1519  res->CanShortOut=r->CanShortOut;
     1520  res->LexOrder=r->LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
     1521  res->MixedOrder=r->MixedOrder; // ?? 1 for lex ordering (except ls), -1 otherwise
     1522  res->ComponentOrder=r->ComponentOrder;
     1523
     1524
     1525  // what follows below here should be set by rComplete, _only_
     1526  // contains component, but no weight fields in E */
     1527  //short      ExpL_Size; // size of exponent vector in long
     1528  //short      CmpL_Size; // portions which need to be compared
     1529  /* number of long vars in exp vector:
     1530     long vars are those longs in the exponent vector which are
     1531     occupied by variables, only */
     1532  //short     VarL_Size;
     1533
     1534  //short      BitsPerExp; /* number of bits per exponent */
     1535  //short      ExpPerLong; /* maximal number of Exponents per long */
     1536
     1537  //short      pCompIndex; /* p->exp.e[pCompIndex] is the component */
     1538  //short      pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */
     1539
     1540  //short      OrdSize; /* size of ord vector (in sro_ord) */
     1541
     1542
     1543  /* if >= 0, long vars in exp vector are consecutive and start there
     1544     if <  0, long vars in exp vector are not consecutive */
     1545  //short     VarL_LowIndex;
     1546  // number of exponents in r->VarL_Offset[0]
     1547  // is minimal number of exponents in a long var
     1548  //short     MinExpPerLong;
     1549
     1550  /* if this is > 0, then NegWeightL_Offset[0..size_1] is index of longs in
     1551   ExpVector whose values need an offset due to negative weights */
     1552  //short     NegWeightL_Size;
     1553  /* array of NegWeigtL_Size indicies */
     1554  //int*      NegWeightL_Offset;
     1555
     1556  /* array of size VarL_Size,
     1557     VarL_Offset[i] gets i-th long var in exp vector */
     1558  //int*      VarL_Offset;
     1559
     1560  /* mask for getting single exponents */
     1561  //unsigned long bitmask;
     1562  /* mask used for divisiblity tests */
     1563  //unsigned long divmask;
     1564
     1565  //p_Procs_s*    p_Procs;
     1566
     1567  /* FDeg and LDeg */
     1568  //pFDegProc     pFDeg;
     1569  //pLDegProc     pLDeg;
     1570
     1571  /* as it was determined by rComplete */
     1572  //pFDegProc     pFDegOrig;
     1573  /* and as it was determined before rOptimizeLDeg */
     1574  //pLDegProc     pLDegOrig;
     1575
     1576  //p_SetmProc    p_Setm;
     1577  //n_Procs_s*    cf;
     1578  //ring          algring;
     1579#ifdef HAVE_PLURAL
     1580  //  nc_struct*    _nc; // private
     1581#endif
    14651582
    14661583  memcpy4(res,r,sizeof(ip_sring));
     
    17441861}
    17451862
    1746 BOOLEAN rHasSimpleOrder(ring r)
     1863BOOLEAN rHasSimpleOrder(const ring r)
    17471864{
    17481865  if (r->order[0] == ringorder_unspec) return TRUE;
     
    17631880
    17641881// returns TRUE, if simple lp or ls ordering
    1765 BOOLEAN rHasSimpleLexOrder(ring r)
     1882BOOLEAN rHasSimpleLexOrder(const ring r)
    17661883{
    17671884  return rHasSimpleOrder(r) &&
     
    17721889}
    17731890
    1774 BOOLEAN rOrder_is_DegOrdering(rRingOrder_t order)
     1891BOOLEAN rOrder_is_DegOrdering(const rRingOrder_t order)
    17751892{
    17761893  switch(order)
  • kernel/ring.h

    r939cb2 rb9642b1  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.33 2008-07-20 15:12:35 Singular Exp $ */
     9/* $Id: ring.h,v 1.34 2009-01-06 13:59:36 Singular Exp $ */
    1010
    1111/* includes */
     
    339339int rGetMaxSyzComp(int i);
    340340
    341 BOOLEAN rHasSimpleOrder(ring r);
     341BOOLEAN rHasSimpleOrder(const ring r);
    342342// returns TRUE, if simple lp or ls ordering
    343 BOOLEAN rHasSimpleLexOrder(ring r);
     343BOOLEAN rHasSimpleLexOrder(const ring r);
    344344// return TRUE if p->exp[r->pOrdIndex] holds total degree of p */
     345inline BOOLEAN rHasGlobalOrdering(const ring r=currRing)
     346{ return (r->OrdSgn==1); }
     347inline BOOLEAN rHasLocalOrMixedOrdering(const ring r=currRing)
     348{ return (r->OrdSgn==-1); }
    345349BOOLEAN rOrd_is_Totaldegree_Ordering(ring r =currRing);
    346350// return TRUE if p_SetComp requires p_Setm
  • kernel/walkProc.cc

    r939cb2 rb9642b1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: walkProc.cc,v 1.1 2005-05-04 15:41:27 Singular Exp $ */
     4/* $Id: walkProc.cc,v 1.2 2009-01-06 13:59:36 Singular Exp $ */
    55
    66#include "mod2.h"
     
    6666        state= WalkIncompatibleRings;
    6767    }
    68     else if ( (sring->OrdSgn != 1) || (dring->OrdSgn != 1) )
     68    else if ( (rHasLocalOrMixedOrdering(sring))
     69    || (rHasLocalOrMixedOrdering(dring)) )
    6970    {
    7071        WerrorS( "only works for global orderings" );
     
    8687    // check if the names of the variables resp. parameters do agree:
    8788
    88     int nvar = sring->N;
     89    int nvar = rVar(sring);
    8990    int npar = rPar(sring);
    9091    int * pperm;
     
    99100
    100101    for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
    101         if ( vperm[k] <= 0 ) {
     102        if ( vperm[k] <= 0 )
     103        {
    102104            WerrorS( "variable names do not agree" );
    103105            state= WalkIncompatibleRings;
     
    105107
    106108    for ( k= npar-1; (k >= 0) && (state == WalkOk); k-- )
    107         if ( pperm[k] >= 0 ) {
     109        if ( pperm[k] >= 0 )
     110        {
    108111            WerrorS( "paramater names do not agree" );
    109112            state= WalkIncompatibleRings;
     
    112115    //remove this to if you want to allow permutations of variables
    113116    for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
    114       if ( vperm[k] != (k) ) {
     117      if ( vperm[k] != (k) )
     118      {
    115119        WerrorS( "orders of variables do not agree" );
    116120        state= WalkIncompatibleRings;
     
    119123    //remove this to if you want to allow permutations of parameters
    120124    for ( k= npar; (k > 0) && (state == WalkOk); k-- )
    121       if ( pperm[k-1] != (-k) ) {
     125      if ( pperm[k-1] != (-k) )
     126      {
    122127        WerrorS( "orders of parameters do not agree" );
    123128        state= WalkIncompatibleRings;
     
    130135
    131136    // check if any of the rings are qrings or not
    132     if ( (sring->qideal != NULL) || (dring->qideal != NULL) ){
    133           Werror( "rings are not allowed to be qrings");
     137    if ( (sring->qideal != NULL) || (dring->qideal != NULL) )
     138    {
     139          WerrorS( "rings are not allowed to be qrings");
    134140          return WalkIncompatibleRings;
    135141    }
    136142
    137143    int i=0;
    138     while(dring->order[i]!=0){
     144    while(dring->order[i]!=0)
     145    {
    139146      if(
    140147           !(dring->order[i]==ringorder_a) &&
     
    147154           !(dring->order[i]==ringorder_C)  &&
    148155           !(dring->order[i]==ringorder_M)
    149          ) {
    150 
     156         )
     157      {
    151158        state=WalkIncompatibleDestRing;
    152159      }
     
    155162
    156163    i=0;
    157     while(sring->order[i]!=0){
     164    while(sring->order[i]!=0)
     165    {
    158166      if(
    159167           !(sring->order[i]==ringorder_a) &&
     
    166174           !(sring->order[i]==ringorder_C)  &&
    167175           !(sring->order[i]==ringorder_M)
    168          ) {
     176         )
     177      {
    169178       state=WalkIncompatibleSourceRing;
    170179      }
     
    210219    ring sring = IDRING( sringHdl );
    211220
    212     if ( rChar(sring) != rChar(dring) ) {
     221    if ( rChar(sring) != rChar(dring) )
     222    {
    213223        WerrorS( "rings must have same characteristic" );
    214224        state= WalkIncompatibleRings;
    215225    }
    216226
    217     if ( (sring->OrdSgn != 1) || (dring->OrdSgn != 1) ) {
     227    if ( (rHasLocalOrMixedOrdering(sring))
     228    || (rHasLocalOrMixedOrdering(dring)) )
     229    {
    218230        WerrorS( "only works for global orderings" );
    219231        state= WalkIncompatibleRings;
    220232    }
    221233
    222     if ( sring->N != dring->N )
     234    if ( rVar(sring) != rVar(dring) )
    223235    {
    224236        WerrorS( "rings must have same number of variables" );
     
    250262
    251263    for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
    252       if ( vperm[k] <= 0 ) {
     264      if ( vperm[k] <= 0 )
     265      {
    253266        WerrorS( "variable names do not agree" );
    254267        state= WalkIncompatibleRings;
     
    256269
    257270    for ( k= npar; (k > 0) && (state == WalkOk); k-- )
    258       if ( pperm[k-1] >= 0 ){
     271      if ( pperm[k-1] >= 0 )
     272      {
    259273        WerrorS( "parameter names do not agree" );
    260274        state= WalkIncompatibleRings;
     
    264278    //remove this to if you want to allow permutations of variables
    265279    for ( k= nvar; (k > 0) && (state == WalkOk); k-- )
    266       if ( vperm[k] != (k) ) {
     280      if ( vperm[k] != (k) )
     281      {
    267282        WerrorS( "orders of variables do not agree" );
    268283        state= WalkIncompatibleRings;
     
    271286    //remove this to if you want to allow permutations of parameters
    272287    for ( k= npar; (k > 0) && (state == WalkOk); k-- )
    273       if ( pperm[k-1] != (-k) ) {
     288      if ( pperm[k-1] != (-k) )
     289      {
    274290        WerrorS( "orders of parameters do not agree" );
    275291        state= WalkIncompatibleRings;
     
    282298
    283299    // check if any of the rings are qrings or not
    284     if ( (sring->qideal != NULL) || (dring->qideal != NULL) ){
    285           Werror( "rings are not allowed to be qrings");
     300    if ( (sring->qideal != NULL) || (dring->qideal != NULL) )
     301    {
     302          WerrorS( "rings are not allowed to be qrings");
    286303          return WalkIncompatibleRings;
    287304    }
     
    296313           !(dring->order[i]==ringorder_C)  &&
    297314           !(dring->order[0]==ringorder_M)
    298          ) {
     315         )
     316      {
    299317        state=WalkIncompatibleDestRing;
    300318      }
     
    303321
    304322    i=0;
    305     while(sring->order[i]!=0){
     323    while(sring->order[i]!=0)
     324    {
    306325      if(  !(sring->order[i]==ringorder_lp) &&
    307326           !(sring->order[i]==ringorder_dp) &&
     
    311330           !(sring->order[i]==ringorder_C)  &&
    312331           !(dring->order[0]==ringorder_M)
    313          ) {
     332         )
     333      {
    314334        state=WalkIncompatibleSourceRing;
    315335      }
  • kernel/walkSupport.cc

    r939cb2 rb9642b1  
    11101110  int n=rVar(r);
    11111111  int64vec* res=new int64vec(n,n,(int64)0);
    1112   if (r->OrdSgn != 1) return res;
     1112  if (rHasLocalOrMixedOrdering(r)) return res;
    11131113  int pos1=0;
    11141114  int pos2=0;
     
    11881188  int64vec* res=new int64vec(n);
    11891189
    1190   if (r->OrdSgn != 1) return res;
     1190  if (rHasLocalOrMixedOrdering(r)) return res;
    11911191
    11921192  int length;
  • kernel/weight.cc

    r939cb2 rb9642b1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: weight.cc,v 1.6 2008-07-08 11:26:50 Singular Exp $ */
     4/* $Id: weight.cc,v 1.7 2009-01-06 13:59:36 Singular Exp $ */
    55
    66/*
     
    189189  *eweight = 0;
    190190  n = pVariables;
    191   if (pOrdSgn == -1)
     191  if (rHasLocalOrMixedOrdering())
    192192    wFunctional = wFunctionalMora;
    193193  else
Note: See TracChangeset for help on using the changeset viewer.