Changeset 41b473 in git for Singular


Ignore:
Timestamp:
Apr 23, 1998, 8:17:40 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'd1b01e9d51ade4b46b745d3bada5c5f3696be3a8')
Children:
356dc3d199dbfae000f47b6c6d67ce4cffcb5771
Parents:
1d202e7f25871522d0ff3683f371e598b0a40eed
Message:
* hannes: fixed bug in rKill of Q-rings (polys.cc, ring.cc)


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

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r1d202e r41b473  
     1Thu Apr 23 20:16:24 MET DST 1998 hannes
     2  * fixed bug in rKill of Q-rings (ring.cc, polys.cc)
    13Wed Apr 22 09:42:35 MET DST 1998 hannes
    24  * several changes concerning stdfac
  • Singular/polys.cc

    r1d202e r41b473  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.22 1998-04-08 16:04:31 Singular Exp $ */
     4/* $Id: polys.cc,v 1.23 1998-04-23 18:17:39 Singular Exp $ */
    55
    66/*
     
    3434pCompProc pComp0;
    3535
    36 int pVariables;     // number of variables 
     36int pVariables;     // number of variables
    3737int pVariablesW;    // number of words of pVariables exponents
    3838int pVariables1W;   // number of words of (pVariables+1) exponents
     
    4141int pLexSgn;        // 1, for lex monom comps; -1 otherwise (exception: ls)
    4242int pVarOffset;     // controls the way exponents are stored in a vector
    43 int pVarLowIndex;   // lowest exponent index 
    44 int pVarHighIndex;  // highest exponent index 
     43int pVarLowIndex;   // lowest exponent index
     44int pVarHighIndex;  // highest exponent index
    4545int pVarCompIndex;  // Location of component in exponent vector
    4646
     
    116116{
    117117  p->Order = (((Order_t)pGetExp(p,1))<<(sizeof(Exponent_t)*8))
    118     + (Order_t)pGetExp(p,2); 
     118    + (Order_t)pGetExp(p,2);
    119119}
    120120
     
    157157}                                               \
    158158while(0)
    159  
     159
    160160#define Mreturn(d, multiplier)                      \
    161161{                                                   \
    162162  if (d > 0) return multiplier;                     \
    163163  return -multiplier;                               \
    164 }                                               
     164}
    165165
    166166static int pComp_otEXP_nwONE(poly p1, poly p2);
     
    177177static int pComp_otEXPCOMP_nwODD(poly p1, poly p2);
    178178
    179  
     179
    180180// comp_nwONE is used if pVariables1W == 1 and component is compatible
    181181// with ordering
    182 static int pComp_otEXP_nwONE(poly p1, poly p2) 
     182static int pComp_otEXP_nwONE(poly p1, poly p2)
    183183{
    184184  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    193193// comp_otEXPCOMP_nwONE :  pVariables1W == 1, priority is
    194194// given to exponents, component is incompatible with ordering
    195 static int pComp_otEXPCOMP_nwONE(poly p1, poly p2) 
     195static int pComp_otEXPCOMP_nwONE(poly p1, poly p2)
    196196{
    197197  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    206206// comp_otEXPCOMP_nwONE :  pVariables1W == 1, priority is given to component,
    207207// component is incompatible with ordering
    208 static int pComp_otCOMPEXP_nwONE(poly p1, poly p2) 
     208static int pComp_otCOMPEXP_nwONE(poly p1, poly p2)
    209209{
    210210  register long d = pGetComp(p2) - pGetComp(p1);
     
    213213  if (d) Mreturn(d, pOrdSgn);
    214214  _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual , return 0);
    215  
     215
    216216  NotEqual:
    217217  Mreturn(d, pLexSgn);
     
    219219
    220220// comp_nwTWO :  pVariables1W == 2 and component is compatible with ordering
    221 static int pComp_otEXP_nwTWO(poly p1, poly p2) 
     221static int pComp_otEXP_nwTWO(poly p1, poly p2)
    222222{
    223223  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    232232// comp_otEXPCOMP_nwTWO :  pVariables1W == 2, priority is given to exponents,
    233233// component is incompatible with ordering
    234 static int pComp_otEXPCOMP_nwTWO(poly p1, poly p2) 
     234static int pComp_otEXPCOMP_nwTWO(poly p1, poly p2)
    235235{
    236236  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    238238  if (d) Mreturn(d, pOrdSgn);
    239239  _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, goto NotEqual, return 0);
    240  
     240
    241241  NotEqual:
    242242  Mreturn(d, pLexSgn);
     
    245245// comp_otEXPCOMP_nwTWO :  pVariables1W == 2, priority is given to component,
    246246// component is incompatible with ordering
    247 static int pComp_otCOMPEXP_nwTWO(poly p1, poly p2) 
     247static int pComp_otCOMPEXP_nwTWO(poly p1, poly p2)
    248248{
    249249  register long d = pGetComp(p2) - pGetComp(p1);
     
    252252  if (d) Mreturn(d, pOrdSgn);
    253253  _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0);
    254  
     254
    255255  NotEqual:
    256256  Mreturn(d, pLexSgn);
     
    259259// comp_nwEVEN :  pVariables1W == 2*i and component is compatible
    260260// with ordering
    261 static int pComp_otEXP_nwEVEN(poly p1, poly p2) 
     261static int pComp_otEXP_nwEVEN(poly p1, poly p2)
    262262{
    263263  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    272272// comp_otEXPCOMP_nwEVEN : pVariables1W == 2*i, priority is given to exponents,
    273273// component is incompatible with ordering
    274 static int pComp_otEXPCOMP_nwEVEN(poly p1, poly p2) 
     274static int pComp_otEXPCOMP_nwEVEN(poly p1, poly p2)
    275275{
    276276  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    285285// comp_otEXPCOMP_nwEVEN : pVariables1W == 2*i, priority is given to component,
    286286// component is incompatible with ordering
    287 static int pComp_otCOMPEXP_nwEVEN(poly p1, poly p2) 
     287static int pComp_otCOMPEXP_nwEVEN(poly p1, poly p2)
    288288{
    289289  register long d = pGetComp(p2) - pGetComp(p1);
     
    292292  if (d) Mreturn(d, pOrdSgn);
    293293  _pMonComp_otEXP_nwEVEN(p1, p2, pVariablesW, d, goto NotEqual, return 0);
    294  
     294
    295295  NotEqual:
    296296  Mreturn(d, pLexSgn);
     
    299299// comp_nwODD : pVariables1W == 2*i and component is compatible
    300300// with ordering
    301 static int pComp_otEXP_nwODD(poly p1, poly p2) 
     301static int pComp_otEXP_nwODD(poly p1, poly p2)
    302302{
    303303  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    312312// comp_otEXPCOMP_nwODD : pVariables1W == 2*i, priority is given to exponents,
    313313// component is incompatible with ordering
    314 static int pComp_otEXPCOMP_nwODD(poly p1, poly p2) 
     314static int pComp_otEXPCOMP_nwODD(poly p1, poly p2)
    315315{
    316316  register long d = pGetOrder(p1) - pGetOrder(p2);
    317   if (d) 
     317  if (d)
    318318  {
    319319    if (d > 0) return pOrdSgn;
    320320    return -pOrdSgn;
    321321  }
    322  
     322
    323323  _pMonComp_otEXPCOMP_nwODD(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    324  
     324
    325325  NotEqual:
    326326  Mreturn(d, pLexSgn);
     
    329329// comp_otCOMPEXP_nwODD : pVariables1W == 2*i, priority is given to component,
    330330// component is incompatible with ordering
    331 static int pComp_otCOMPEXP_nwODD(poly p1, poly p2) 
     331static int pComp_otCOMPEXP_nwODD(poly p1, poly p2)
    332332{
    333333  register long d = pGetComp(p2) - pGetComp(p1);
     
    336336  if (d) Mreturn(d, pOrdSgn);
    337337  _pMonComp_otEXP_nwODD(p1, p2, pVariablesW, d, goto NotEqual, return 0);
    338  
     338
    339339  NotEqual:
    340340  Mreturn(d, pLexSgn);
     
    924924int pTotaldegree(poly p)
    925925{
    926   return pExpQuerSum(p); 
     926  return pExpQuerSum(p);
    927927}
    928928
     
    11271127        else
    11281128        {
    1129           // component is compatible with exponent vector 
     1129          // component is compatible with exponent vector
    11301130          if (pVariables1W == 1)        *p = pComp_otEXP_nwONE;
    11311131          else if (pVariables1W == 2)   *p = pComp_otEXP_nwTWO;
     
    11341134        }
    11351135        break;
    1136        
     1136
    11371137#ifdef PDEBUG
    11381138      case ringorder_lp:
     
    11551155        else
    11561156        {
    1157           // component is compatible with exponent vector 
     1157          // component is compatible with exponent vector
    11581158          if (pVariables1W == 1)        *p = pComp_otEXP_nwONE;
    11591159          else if (pVariables1W == 2)   *p = pComp_otEXP_nwTWO;
     
    11671167#endif
    11681168  }
    1169  
     1169
    11701170  if (o_r == ringorder_lp || o_r == ringorder_ls)
    11711171  {
     
    12021202          *p = pComp_otCOMPEXP_nwEVEN;
    12031203        break;
    1204        
     1204
    12051205#ifdef PDEBUG
    12061206      case ringorder_lp:
     
    13731373{
    13741374  int i;
    1375   pComponentOrder=1;
    1376   if (ppNoether!=NULL) pDelete(&ppNoether);
     1375  pVariables = r->N;
     1376  if (complete)
     1377  {
     1378    pComponentOrder=1;
     1379    if (ppNoether!=NULL) pDelete(&ppNoether);
    13771380#ifdef SRING
    1378   pSRING=FALSE;
    1379   pAltVars=r->N+1;
     1381    pSRING=FALSE;
     1382    pAltVars=r->N+1;
    13801383#endif
    1381   pVariables = r->N;
    1382 
    1383   // set the various size parameters and initialize memory
    1384   if ((((pVariables+1)*sizeof(Exponent_t)) % sizeof(void*)) == 0)
    1385     pVariables1W = (pVariables+1)*sizeof(Exponent_t) / sizeof(void*);
    1386   else
    1387     pVariables1W = ((pVariables+1)*sizeof(Exponent_t) / sizeof(void*)) + 1;
    1388 
    1389   if ((((pVariables)*sizeof(Exponent_t)) % sizeof(void*)) == 0)
    1390     pVariablesW = (pVariables)*sizeof(Exponent_t) / sizeof(void*);
    1391   else
    1392     pVariablesW = ((pVariables)*sizeof(Exponent_t) / sizeof(void*)) + 1;
     1384
     1385    // set the various size parameters and initialize memory
     1386    if ((((pVariables+1)*sizeof(Exponent_t)) % sizeof(void*)) == 0)
     1387      pVariables1W = (pVariables+1)*sizeof(Exponent_t) / sizeof(void*);
     1388    else
     1389      pVariables1W = ((pVariables+1)*sizeof(Exponent_t) / sizeof(void*)) + 1;
     1390
     1391    if ((((pVariables)*sizeof(Exponent_t)) % sizeof(void*)) == 0)
     1392      pVariablesW = (pVariables)*sizeof(Exponent_t) / sizeof(void*);
     1393    else
     1394      pVariablesW = ((pVariables)*sizeof(Exponent_t) / sizeof(void*)) + 1;
     1395  }
    13931396
    13941397  pMonomSize = POLYSIZE + (pVariables + 1) * sizeof(Exponent_t);
    1395   if ((pMonomSize % sizeof(void*)) == 0)
    1396   {
    1397     pMonomSizeW = pMonomSize/sizeof(void*);
    1398   }
    1399   else
    1400   {
    1401     pMonomSizeW = pMonomSize/sizeof(void*) + 1;
    1402     pMonomSize = pMonomSizeW*sizeof(void*);
    1403   }
    1404  
    1405   // Set default Var Indicies
    1406   pSetVarIndicies(pVariables);
    1407 
    1408   // Initialize memory management
     1398
     1399  // Initialize memory management
    14091400  mmSpecializeBlock(pMonomSize);
    1410  
    1411   pOrdSgn = r->OrdSgn;
    1412   pVectorOut=(r->order[0]==ringorder_c);
    1413   order=r->order;
    1414   block0=r->block0;
    1415   block1=r->block1;
    1416   firstwv=NULL;
    1417   polys_wv=r->wvhdl;
    1418   /*------- only one real block ----------------------*/
    1419   pLexOrder=FALSE;
    1420   pMixedOrder=FALSE;
    1421   pFDeg=pDeg;
    1422   if (pOrdSgn == 1) pLDeg = ldegb;
    1423   else              pLDeg = ldeg0;
    1424   /*======== ordering type is (_,c) =========================*/
    1425   if ((order[0]==ringorder_unspec)
    1426   ||(
    1427     ((order[1]==ringorder_c)||(order[1]==ringorder_C))
    1428     && (order[0]!=ringorder_M)
    1429     && (order[2]==0))
    1430   )
    1431   {
    1432     if ((order[0]!=ringorder_unspec)
    1433     && (order[1]==ringorder_C))
    1434       pComponentOrder=-1;
    1435     if (pOrdSgn == -1) pLDeg = ldeg0c;
    1436     SimpleChoose(order[0],order[1], &pComp0);
    1437     SetpSetm(order[0],0);
    1438   }
    1439   /*======== ordering type is (c,_) =========================*/
    1440   else if (((order[0]==ringorder_c)||(order[0]==ringorder_C))
    1441   && (order[1]!=ringorder_M)
    1442   &&  (order[2]==0))
    1443   {
    1444     /* pLDeg = ldeg0; is standard*/
    1445     if (order[0]==ringorder_C)
    1446       pComponentOrder=-1;
    1447     SimpleChooseC(order[1], &pComp0);
    1448     SetpSetm(order[1],1);
    1449   }
    1450   /*------- more than one block ----------------------*/
    1451   else
    1452   {
    1453     //pLexOrder=TRUE;
    1454     pVectorOut=order[0]==ringorder_c;
    1455     if ((pVectorOut)||(order[0]==ringorder_C))
    1456     {
    1457       if(block1[1]!=pVariables) pLexOrder=TRUE;
    1458     } 
     1401
     1402  if (complete)
     1403  {
     1404    if ((pMonomSize % sizeof(void*)) == 0)
     1405    {
     1406      pMonomSizeW = pMonomSize/sizeof(void*);
     1407    }
    14591408    else
    14601409    {
    1461       if(block1[0]!=pVariables) pLexOrder=TRUE;
    1462     }
    1463     /*the number of orderings:*/
    1464     i = 0;
    1465     while (order[++i] != 0);
    1466     do
    1467     {
    1468       i--;
    1469       HighSet(i, order[i]);/*sets also pMixedOrder to TRUE, if...*/
    1470       SetpSetm(order[i],i);
    1471     }
    1472     while (i != 0);
    1473 
    1474     pComp0 = BlockComp;
    1475     if ((order[0]!=ringorder_c)&&(order[0]!=ringorder_C))
    1476     {
    1477       pLDeg = ldeg1c;
    1478     }
     1410      pMonomSizeW = pMonomSize/sizeof(void*) + 1;
     1411      pMonomSize = pMonomSizeW*sizeof(void*);
     1412    }
     1413
     1414    // Set default Var Indicies
     1415    pSetVarIndicies(pVariables);
     1416
     1417    pOrdSgn = r->OrdSgn;
     1418    pVectorOut=(r->order[0]==ringorder_c);
     1419    order=r->order;
     1420    block0=r->block0;
     1421    block1=r->block1;
     1422    firstwv=NULL;
     1423    polys_wv=r->wvhdl;
     1424    /*------- only one real block ----------------------*/
     1425    pLexOrder=FALSE;
     1426    pMixedOrder=FALSE;
     1427    pFDeg=pDeg;
     1428    if (pOrdSgn == 1) pLDeg = ldegb;
     1429    else              pLDeg = ldeg0;
     1430    /*======== ordering type is (_,c) =========================*/
     1431    if ((order[0]==ringorder_unspec)
     1432    ||(
     1433      ((order[1]==ringorder_c)||(order[1]==ringorder_C))
     1434      && (order[0]!=ringorder_M)
     1435      && (order[2]==0))
     1436    )
     1437    {
     1438      if ((order[0]!=ringorder_unspec)
     1439      && (order[1]==ringorder_C))
     1440        pComponentOrder=-1;
     1441      if (pOrdSgn == -1) pLDeg = ldeg0c;
     1442      SimpleChoose(order[0],order[1], &pComp0);
     1443      SetpSetm(order[0],0);
     1444    }
     1445    /*======== ordering type is (c,_) =========================*/
     1446    else if (((order[0]==ringorder_c)||(order[0]==ringorder_C))
     1447    && (order[1]!=ringorder_M)
     1448    &&  (order[2]==0))
     1449    {
     1450      /* pLDeg = ldeg0; is standard*/
     1451      if (order[0]==ringorder_C)
     1452        pComponentOrder=-1;
     1453      SimpleChooseC(order[1], &pComp0);
     1454      SetpSetm(order[1],1);
     1455    }
     1456    /*------- more than one block ----------------------*/
    14791457    else
    14801458    {
    1481       pLDeg = ldeg1;
    1482     }
    1483     pFDeg = pWTotaldegree; // may be improved: pTotaldegree for lp/dp/ls/.. blocks
    1484   }
    1485   if ((pLexOrder) || (pOrdSgn==-1))
    1486   {
    1487     test &= ~Sy_bit(OPT_REDTAIL); /* noredTail */
     1459      //pLexOrder=TRUE;
     1460      pVectorOut=order[0]==ringorder_c;
     1461      if ((pVectorOut)||(order[0]==ringorder_C))
     1462      {
     1463        if(block1[1]!=pVariables) pLexOrder=TRUE;
     1464      }
     1465      else
     1466      {
     1467        if(block1[0]!=pVariables) pLexOrder=TRUE;
     1468      }
     1469      /*the number of orderings:*/
     1470      i = 0;
     1471      while (order[++i] != 0);
     1472      do
     1473      {
     1474        i--;
     1475        HighSet(i, order[i]);/*sets also pMixedOrder to TRUE, if...*/
     1476        SetpSetm(order[i],i);
     1477      }
     1478      while (i != 0);
     1479
     1480      pComp0 = BlockComp;
     1481      if ((order[0]!=ringorder_c)&&(order[0]!=ringorder_C))
     1482      {
     1483        pLDeg = ldeg1c;
     1484      }
     1485      else
     1486      {
     1487        pLDeg = ldeg1;
     1488      }
     1489      // may be improved: pTotaldegree for lp/dp/ls/.. blocks
     1490      pFDeg = pWTotaldegree;
     1491    }
     1492    if ((pLexOrder) || (pOrdSgn==-1))
     1493    {
     1494      test &= ~Sy_bit(OPT_REDTAIL); /* noredTail */
     1495    }
    14881496  }
    14891497}
  • Singular/ring.cc

    r1d202e r41b473  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.21 1998-04-03 17:38:41 Singular Exp $ */
     4/* $Id: ring.cc,v 1.22 1998-04-23 18:17:37 Singular Exp $ */
    55
    66/*
     
    4242
    4343// internally changes the gloabl ring and resets the relevant
    44 // global variables: 
     44// global variables:
    4545// complete == FALSE : only delete operations are enabled
    4646// complete == TRUE  : full reset of all variables
    4747void rChangeCurrRing(ring r, BOOLEAN complete)
    4848{
     49  /*------------ set global ring vars --------------------------------*/
     50  currRing = r;
    4951  if (r != NULL)
    5052  {
     53    /*------------ set global ring vars --------------------------------*/
     54    currQuotient=r->qideal;
     55
    5156    /*------------ set redTail, except reset by nSetChar or pChangeRing */
    52     test |= Sy_bit(OPT_REDTAIL);
     57    if (complete)
     58    {
     59      test |= Sy_bit(OPT_REDTAIL);
     60    }
    5361
    5462    /*------------ global variables related to coefficients ------------*/
     
    5866    pSetGlobals(r, complete);
    5967
     68
     69    if (complete)
     70    {
    6071    /*------------ set naMinimalPoly -----------------------------------*/
    61     if (r->minpoly!=NULL)
    62     {
    63       naMinimalPoly=((lnumber)r->minpoly)->z;
    64     }
    65    
    66     /*------------ set global ring vars --------------------------------*/
    67     currRing = r;
    68     currQuotient=r->qideal;
     72      if (r->minpoly!=NULL)
     73      {
     74        naMinimalPoly=((lnumber)r->minpoly)->z;
     75      }
    6976
    7077#ifdef DRING
    71     pDRING=FALSE;
    72     pSDRING=FALSE;
    73     if (hasFlag(h,FLAG_DRING)) rDSet();
     78      pDRING=FALSE;
     79      pSDRING=FALSE;
     80      if (hasFlag(h,FLAG_DRING)) rDSet();
    7481#endif // DRING
    7582
    7683#ifdef SRING
    77     if ((currRing->partN<=currRing->N)
     84      if ((currRing->partN<=currRing->N)
    7885#ifdef DRING
    79         && (!hasFlag(h,FLAG_DRING))
     86          && (!hasFlag(h,FLAG_DRING))
    8087#endif
    81         )
    82     {
    83       pAltVars=currRing->partN;
    84       pSRING=TRUE;
    85       pSDRING=TRUE;
    86     }
    87     else
    88     {
    89       pAltVars=currRing->N+1;
    90     }
     88          )
     89      {
     90        pAltVars=currRing->partN;
     91        pSRING=TRUE;
     92        pSDRING=TRUE;
     93      }
     94      else
     95      {
     96        pAltVars=currRing->N+1;
     97      }
    9198#endif // SRING
    9299
    93100    /*------------ set spolys ------------------------------------------*/
    94     if (complete) spSet(r);
    95   }
    96 }
    97  
     101      spSet(r);
     102    }
     103  }
     104  else
     105  {
     106    currQuotient=NULL;
     107  }
     108}
     109
    98110void rSetHdl(idhdl h, BOOLEAN complete)
    99111{
     
    115127  }
    116128  else complete=FALSE;
    117    
     129
    118130  // clean up history
    119131    if (((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING))
    120         || ((sLastPrinted.rtyp==LIST_CMD)&&(lRingDependend((lists)sLastPrinted.data))))
     132        || ((sLastPrinted.rtyp==LIST_CMD)&&(lRingDependend((lists)sLastPrinted.data))))
    121133    {
    122134      sLastPrinted.CleanUp();
    123135      memset(&sLastPrinted,0,sizeof(sleftv));
    124136    }
    125  
     137
    126138   /*------------ change the global ring -----------------------*/
    127139  rChangeCurrRing(rg,complete);
     
    143155      if ((rg->parameter!=NULL) && (rg->ch<2))
    144156      {
    145         for (i=0;i<rg->P;i++)
    146         {
    147           if(strlen(rg->parameter[i])>1)
    148           {
    149             pShortOut=(int)FALSE;
    150             break;
    151           }
    152         }
     157        for (i=0;i<rg->P;i++)
     158        {
     159          if(strlen(rg->parameter[i])>1)
     160          {
     161            pShortOut=(int)FALSE;
     162            break;
     163          }
     164        }
    153165      }
    154166      if (pShortOut)
    155167      {
    156         for (i=(rg->N-1);i>=0;i--)
    157         {
    158           if(strlen(rg->names[i])>1)
    159           {
    160             pShortOut=(int)FALSE;
    161             break;
    162           }
    163         }
    164       }
    165     }
    166   }
    167  
     168        for (i=(rg->N-1);i>=0;i--)
     169        {
     170          if(strlen(rg->names[i])>1)
     171          {
     172            pShortOut=(int)FALSE;
     173            break;
     174          }
     175        }
     176      }
     177    }
     178  }
     179
    168180}
    169181
     
    171183{
    172184  idhdl tmp=NULL;
    173  
     185
    174186  if (s!=NULL) tmp = enterid(s, myynest, RING_CMD, &idroot);
    175187  if (tmp==NULL) return NULL;
    176  
     188
    177189  if (ppNoether!=NULL) pDelete(&ppNoether);
    178190  if ((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING))
     
    181193    memset(&sLastPrinted,0,sizeof(sleftv));
    182194  }
    183  
     195
    184196  currRing = IDRING(tmp);
    185  
     197
    186198  currRing->ch    = 32003;
    187199  currRing->N     = 3;
     
    219231  /*polynomial ring*/
    220232  currRing->OrdSgn    = 1;
    221  
     233
    222234  /* complete ring intializations */
    223235  rComplete(currRing);
     
    243255  int i=0,j,typ=1;
    244256  int sz = (int)sqrt((double)(order->length()-2));
    245  
     257
    246258  while ((i<sz) && (typ==1))
    247259  {
     
    267279 */
    268280idhdl rInit(char *s, sleftv* pn, sleftv* rv, sleftv* ord,
    269             BOOLEAN isDRing)
     281            BOOLEAN isDRing)
    270282{
    271283  int ch;
     
    286298  }
    287299  pn=pn->next;
    288  
     300
    289301  int l, last;
    290302  int typ = 1;
     
    294306  BOOLEAN ffChar=FALSE;
    295307  /*every entry in the new ring is initialized to 0*/
    296  
     308
    297309  /* characteristic -----------------------------------------------*/
    298310  /* input: 0 ch=0 : Q     parameter=NULL    ffChar=FALSE
     
    315327      if (fftable[l]==0)
    316328      {
    317         ch = IsPrime(ch);
    318       } 
     329        ch = IsPrime(ch);
     330      }
    319331      else
    320332      {
    321         char *m[1]={(char *)sNoName};
    322         nfSetChar(ch,m);
    323         if(errorreported)
    324         {
    325           errorreported=0;
    326           ch=IsPrime(ch);
    327         }
    328         else
    329         {
    330           ffChar=TRUE;
    331         } 
     333        char *m[1]={(char *)sNoName};
     334        nfSetChar(ch,m);
     335        if(errorreported)
     336        {
     337          errorreported=0;
     338          ch=IsPrime(ch);
     339        }
     340        else
     341        {
     342          ffChar=TRUE;
     343        }
    332344      }
    333345    }
     
    338350  }
    339351  memset(&tmpR,0,sizeof(tmpR));
    340  
     352
    341353  tmpR.ch = ch;
    342  
     354
    343355  /* parameter -------------------------------------------------------*/
    344356  sleftv* hs;
    345357  const char* h;
    346  
     358
    347359  if ((pn!=NULL)&& (ffChar||(ch==-1)))
    348360  {
     
    351363    {
    352364      WarnS("too many parameters");
    353       if (ffChar) hs=pn->next; 
     365      if (ffChar) hs=pn->next;
    354366      else hs=pn;
    355367      hs->CleanUp();
    356       if (ffChar) 
    357       {
    358         pn->next=NULL;
    359         Free((ADDRESS)hs,sizeof(sleftv));
    360       } 
     368      if (ffChar)
     369      {
     370        pn->next=NULL;
     371        Free((ADDRESS)hs,sizeof(sleftv));
     372      }
    361373      else pn=NULL;
    362374    }
     
    365377   * and for deallocating sleftv*-lists:
    366378   *  don't deallocate the first but all other entries*/
    367  
     379
    368380  if (pn!=NULL)
    369381  {
     
    374386      tmpR.P=ffChar; /* GF(q): 1, R: 0 */
    375387      WarnS("too many parameters");
    376       if (ffChar) hs=pn->next; 
     388      if (ffChar) hs=pn->next;
    377389      else hs=pn;
    378390      hs->CleanUp();
     
    390402      if ((h==sNoName)&&(sl->Typ()==POLY_CMD))
    391403      {
    392         hs=(leftv)Alloc(sizeof(sleftv));
    393         iiConvert(POLY_CMD,ANY_TYPE,-1,sl,hs);
    394         sl->next=hs->next;
    395         hs->next=NULL;
    396         h=hs->Name();
     404        hs=(leftv)Alloc(sizeof(sleftv));
     405        iiConvert(POLY_CMD,ANY_TYPE,-1,sl,hs);
     406        sl->next=hs->next;
     407        hs->next=NULL;
     408        h=hs->Name();
    397409      }
    398410      if (h==sNoName)
    399411      {
    400         WerrorS("parameter expected");
    401         pn->CleanUp();
    402         rv->CleanUp();
    403         ord->CleanUp();
    404         return NULL;
     412        WerrorS("parameter expected");
     413        pn->CleanUp();
     414        rv->CleanUp();
     415        ord->CleanUp();
     416        return NULL;
    405417      }
    406418      *p=mstrdup(h);
     
    408420      if (hs!=NULL)
    409421      {
    410         hs->CleanUp();
    411         Free((ADDRESS)hs,sizeof(sleftv));
     422        hs->CleanUp();
     423        Free((ADDRESS)hs,sizeof(sleftv));
    412424      }
    413425      hs=sl;
     
    420432    if (ch==0) tmpR.ch=1;
    421433  }
    422  
     434
    423435  /* names and number of variables-------------------------------------*/
    424436  {
     
    442454      if (sl==NULL)
    443455      {
    444         if (i==tmpR.N-1)
    445           tmpname=mstrdup("");
    446         else
    447         {
    448           tmpname=(char*)AllocL(strlen(tmpR.names[i-tmpR.partN])+2);
    449           strcpy(tmpname,"d");
    450           strcat(tmpname,tmpR.names[i-tmpR.partN]);
    451         }
    452         h=tmpname;
     456        if (i==tmpR.N-1)
     457          tmpname=mstrdup("");
     458        else
     459        {
     460          tmpname=(char*)AllocL(strlen(tmpR.names[i-tmpR.partN])+2);
     461          strcpy(tmpname,"d");
     462          strcat(tmpname,tmpR.names[i-tmpR.partN]);
     463        }
     464        h=tmpname;
    453465      }
    454466      else
    455467#endif
    456         h=sl->Name();
     468        h=sl->Name();
    457469      if ((h==sNoName)&&(sl->Typ()==POLY_CMD))
    458470      {
    459         hs=(leftv)Alloc(sizeof(sleftv));
    460         iiConvert(POLY_CMD,ANY_TYPE,-1,sl,hs);
    461         sl->next=hs->next;
    462         hs->next=NULL;
    463         h=hs->Name();
     471        hs=(leftv)Alloc(sizeof(sleftv));
     472        iiConvert(POLY_CMD,ANY_TYPE,-1,sl,hs);
     473        sl->next=hs->next;
     474        hs->next=NULL;
     475        h=hs->Name();
    464476      }
    465477      if (h==sNoName)
    466478      {
    467         WerrorS("expected name of ring variable");
    468         sl->CleanUp();
    469         ord->CleanUp();
    470         return NULL;
     479        WerrorS("expected name of ring variable");
     480        sl->CleanUp();
     481        ord->CleanUp();
     482        return NULL;
    471483      }
    472484      tmpR.names[i] = mstrdup(h);
    473485      if (hs!=NULL)
    474486      {
    475         hs->CleanUp();
    476         Free((ADDRESS)hs,sizeof(sleftv));
     487        hs->CleanUp();
     488        Free((ADDRESS)hs,sizeof(sleftv));
    477489      }
    478490      hs=sl;
     
    481493      {
    482494#endif
    483         sl=sl->next;
    484         hs->next=NULL;
    485         hs->CleanUp();
    486         if (hs!=rv) Free((ADDRESS)hs,sizeof(sleftv));
     495        sl=sl->next;
     496        hs->next=NULL;
     497        hs->CleanUp();
     498        if (hs!=rv) Free((ADDRESS)hs,sizeof(sleftv));
    487499#ifdef DRING
    488500      }
    489501      if (tmpname!=NULL)
    490502      {
    491         FreeL((ADDRESS)tmpname);
    492         tmpname=NULL;
     503        FreeL((ADDRESS)tmpname);
     504        tmpname=NULL;
    493505      }
    494506#endif
    495507    }
    496    
     508
    497509    /* ordering -------------------------------------------------------------*/
    498510    sl = ord;
     
    517529    else if (i!=1)
    518530      WarnS("more than one ordering c/C -- ignored");
    519    
     531
    520532    /* allocating */
    521533    tmpR.order=(int *)Alloc0(n*sizeof(int));
     
    523535    tmpR.block1=(int *)Alloc0(n*sizeof(int));
    524536    tmpR.wvhdl=(short**)Alloc0(n*sizeof(short*));
    525    
     537
    526538    /* init orders */
    527539    sl=ord;
     
    532544      intvec *iv;
    533545      iv = (intvec *)(sl->data);
    534      
     546
    535547      /* the format of an ordering:
    536548       *  iv[0]: factor
     
    543555      case ringorder_ws:
    544556      case ringorder_Ws:
    545         typ=-1;
     557        typ=-1;
    546558      case ringorder_wp:
    547559      case ringorder_Wp:
    548         tmpR.wvhdl[n]=(short*)AllocL((iv->length()-1)*sizeof(short));
    549         for (l=2;l<iv->length();l++)
    550           tmpR.wvhdl[n][l-2]=(short)(*iv)[l];
    551         tmpR.block0[n]=last+1;
    552         last+=iv->length()-2;
    553         tmpR.block1[n]=last;
    554         break;
     560        tmpR.wvhdl[n]=(short*)AllocL((iv->length()-1)*sizeof(short));
     561        for (l=2;l<iv->length();l++)
     562          tmpR.wvhdl[n][l-2]=(short)(*iv)[l];
     563        tmpR.block0[n]=last+1;
     564        last+=iv->length()-2;
     565        tmpR.block1[n]=last;
     566        break;
    555567      case ringorder_ls:
    556568      case ringorder_ds:
    557569      case ringorder_Ds:
    558         typ=-1;
     570        typ=-1;
    559571      case ringorder_lp:
    560572      case ringorder_dp:
    561573      case ringorder_Dp:
    562         tmpR.block0[n]=last+1;
    563         //last+=(*iv)[0];
    564         if (iv->length()==3) last+=(*iv)[2];
    565         else last+=(*iv)[0];
    566         tmpR.block1[n]=last;
    567         if (rCheckIV(iv)) return NULL;
    568         break;
     574        tmpR.block0[n]=last+1;
     575        //last+=(*iv)[0];
     576        if (iv->length()==3) last+=(*iv)[2];
     577        else last+=(*iv)[0];
     578        tmpR.block1[n]=last;
     579        if (rCheckIV(iv)) return NULL;
     580        break;
    569581      case ringorder_c:
    570582      case ringorder_C:
    571         if (rCheckIV(iv)) return NULL;
    572         break;
     583        if (rCheckIV(iv)) return NULL;
     584        break;
    573585      case ringorder_a:
    574         tmpR.block0[n]=last+1;
    575         tmpR.block1[n]=last+iv->length()-2;
    576         tmpR.wvhdl[n]=(short*)AllocL((iv->length()-1)*sizeof(short));
    577         for (l=2;l<iv->length();l++)
    578         {
    579           tmpR.wvhdl[n][l-2]=(short)(*iv)[l];
    580           if ((*iv)[l]<0) typ=-1;
    581         }
    582         break;
     586        tmpR.block0[n]=last+1;
     587        tmpR.block1[n]=last+iv->length()-2;
     588        tmpR.wvhdl[n]=(short*)AllocL((iv->length()-1)*sizeof(short));
     589        for (l=2;l<iv->length();l++)
     590        {
     591          tmpR.wvhdl[n][l-2]=(short)(*iv)[l];
     592          if ((*iv)[l]<0) typ=-1;
     593        }
     594        break;
    583595      case ringorder_M:
    584         {
    585           int Mtyp=rTypeOfMatrixOrder(iv);
    586           if (Mtyp==0) return NULL;
    587           if (Mtyp==-1) typ=-1;
    588           tmpR.wvhdl[n]=(short*)AllocL((iv->length()-1)*sizeof(short));
    589           for (l=2;l<iv->length();l++)
    590             tmpR.wvhdl[n][l-2]=(short)(*iv)[l];
    591           tmpR.block0[n]=last+1;
    592           last+=(int)sqrt((double)(iv->length()-2));
    593           tmpR.block1[n]=last;
    594           break;
    595         }
     596        {
     597          int Mtyp=rTypeOfMatrixOrder(iv);
     598          if (Mtyp==0) return NULL;
     599          if (Mtyp==-1) typ=-1;
     600          tmpR.wvhdl[n]=(short*)AllocL((iv->length()-1)*sizeof(short));
     601          for (l=2;l<iv->length();l++)
     602            tmpR.wvhdl[n][l-2]=(short)(*iv)[l];
     603          tmpR.block0[n]=last+1;
     604          last+=(int)sqrt((double)(iv->length()-2));
     605          tmpR.block1[n]=last;
     606          break;
     607        }
    596608#ifdef TEST
    597609      default:
    598         Print("order ??? %d\n",(*iv)[1]);
    599         break;
     610        Print("order ??? %d\n",(*iv)[1]);
     611        break;
    600612#endif
    601613      }
     
    611623    else n--;
    612624    while ((tmpR.order[n]==ringorder_c)
    613            ||(tmpR.order[n]==ringorder_C))
     625           ||(tmpR.order[n]==ringorder_C))
    614626      n--;
    615627    if (tmpR.block1[n]!=tmpR.N)
    616628    {
    617629      if ((tmpR.order[n]==ringorder_dp) ||
    618           (tmpR.order[n]==ringorder_ds) ||
    619           (tmpR.order[n]==ringorder_Dp) ||
    620           (tmpR.order[n]==ringorder_Ds) ||
    621           (tmpR.order[n]==ringorder_lp) ||
    622           (tmpR.order[n]==ringorder_ls))
    623       {
    624         tmpR.block1[n]=tmpR.N;
    625         if (tmpR.block0[n]>tmpR.N/*tmpR.block1[n]*/)
    626         {
    627           tmpR.block1[n]=tmpR.block0[n];
    628           goto ord_mismatch;
    629           //Werror("mismatch of number of vars (%d) and ordering (>=%d vars)",
    630           //  tmpR.N,tmpR.block0[n]);
    631           //return NULL;
    632         }
     630          (tmpR.order[n]==ringorder_ds) ||
     631          (tmpR.order[n]==ringorder_Dp) ||
     632          (tmpR.order[n]==ringorder_Ds) ||
     633          (tmpR.order[n]==ringorder_lp) ||
     634          (tmpR.order[n]==ringorder_ls))
     635      {
     636        tmpR.block1[n]=tmpR.N;
     637        if (tmpR.block0[n]>tmpR.N/*tmpR.block1[n]*/)
     638        {
     639          tmpR.block1[n]=tmpR.block0[n];
     640          goto ord_mismatch;
     641          //Werror("mismatch of number of vars (%d) and ordering (>=%d vars)",
     642          //  tmpR.N,tmpR.block0[n]);
     643          //return NULL;
     644        }
    633645      }
    634646      else
    635647      {
    636648      ord_mismatch:
    637         Werror("mismatch of number of vars (%d) and ordering (%d vars)",
    638                tmpR.N,tmpR.block1[n]);
    639         return NULL;
     649        Werror("mismatch of number of vars (%d) and ordering (%d vars)",
     650               tmpR.N,tmpR.block1[n]);
     651        return NULL;
    640652      }
    641653    }
     
    649661    return NULL;
    650662  }
    651  
     663
    652664  memcpy(IDRING(tmp),&tmpR,sizeof(tmpR));
    653665  rSetHdl(tmp,TRUE);
    654  
     666
    655667#ifdef RDEBUG
    656668  rNumber++;
    657669  currRing->no    =rNumber;
    658 #endif 
    659  
     670#endif
     671
    660672  return currRingHdl;
    661673}
    662674
    663675// set those fields of the ring, which can be computed from other fields:
    664 // More particularly, sets r->VarOffset 
     676// More particularly, sets r->VarOffset
    665677
    666678void rComplete(ring r)
     
    671683  r->VarCompIndex = (short) VarCompIndex;
    672684}
    673  
     685
    674686/*2
    675687 * set a new ring from the data:
     
    685697}
    686698#endif
    687  
     699
    688700int rIsRingVar(char *n)
    689701{
     
    708720  if ((r==NULL)||(r->order==NULL))
    709721    return; /*to avoid printing after errors....*/
    710  
     722
    711723  int nblocks=rBlocks(r);
    712  
     724
    713725  mmTestP(r,sizeof(ip_sring));
    714726  mmTestP(r->order,nblocks*sizeof(int));
     
    717729  mmTestP(r->wvhdl,nblocks*sizeof(short *));
    718730  mmTestP(r->names,r->N*sizeof(char *));
    719  
     731
    720732  nblocks--;
    721  
    722  
     733
     734
    723735  if ((r->parameter!=NULL)&&(r->ch>1))
    724736    PrintS("//   # ground field : ");
     
    738750      while (nop<r->P)
    739751      {
    740         PrintS(*sp);
    741         PrintS(" ");
    742         sp++; nop++;
     752        PrintS(*sp);
     753        PrintS(" ");
     754        sp++; nop++;
    743755      }
    744756      PrintS("\n//   minpoly        : ");
    745757      if (r==currRing)
    746758      {
    747         StringSetS(""); nWrite(r->minpoly); PrintS(StringAppendS("\n"));
     759        StringSetS(""); nWrite(r->minpoly); PrintS(StringAppendS("\n"));
    748760      }
    749761      else if (r->minpoly==NULL)
    750762      {
    751         PrintS("0\n");
     763        PrintS("0\n");
    752764      }
    753765      else
    754766      {
    755         PrintS("...\n");
     767        PrintS("...\n");
    756768      }
    757769    }
     
    759771    {
    760772      Print("//   primitive element : %s\n", r->parameter[0]);
    761       if (r==currRing) 
    762       {
    763         StringSetS("//   minpoly        : ");
    764         nfShowMipo();PrintS(StringAppend("\n"));
    765       } 
    766     } 
     773      if (r==currRing)
     774      {
     775        StringSetS("//   minpoly        : ");
     776        nfShowMipo();PrintS(StringAppend("\n"));
     777      }
     778    }
    767779  }
    768780  Print("//   number of vars : %d",r->N);
    769  
     781
    770782  //for (nblocks=0; r->order[nblocks]; nblocks++);
    771783  nblocks=rBlocks(r)-1;
    772  
     784
    773785  for (int l=0, nlen=0 ; l<nblocks; l++)
    774786  {
    775787    int i;
    776788    Print("\n//        block %3d : ",l+1);
    777    
     789
    778790    Print("ordering %c", (" acCMldDwWldDwWu")[r->order[l]]);
    779791    if ((r->order[l]>=ringorder_lp)&&(r->order[l]!=ringorder_unspec))
    780792    {
    781793      if (r->order[l]>=ringorder_ls)
    782         PrintS("s");
     794        PrintS("s");
    783795      else
    784         PrintS("p");
    785     }
    786    
     796        PrintS("p");
     797    }
     798
    787799    if ((r->order[l] != ringorder_c) && (r->order[l] != ringorder_C))
    788800    {
     
    790802      for (i = r->block0[l]-1; i<r->block1[l]; i++)
    791803      {
    792         nlen = strlen(r->names[i]);
    793         Print("%s ",r->names[i]);
    794       }
    795     }
    796    
     804        nlen = strlen(r->names[i]);
     805        Print("%s ",r->names[i]);
     806      }
     807    }
     808
    797809    if (r->wvhdl[l]!=NULL)
    798810    {
    799811      for (int j= 0;
    800            j<(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1);
    801            j+=i)
    802       {
    803         PrintS("\n//                  : weights  ");
    804         for (i = 0; i<=r->block1[l]-r->block0[l]; i++)
    805         {
    806           Print("%*d " ,nlen,r->wvhdl[l][i+j],i+j);
    807         }
    808         if (r->order[l]!=ringorder_M) break;
     812           j<(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1);
     813           j+=i)
     814      {
     815        PrintS("\n//                  : weights  ");
     816        for (i = 0; i<=r->block1[l]-r->block0[l]; i++)
     817        {
     818          Print("%*d " ,nlen,r->wvhdl[l][i+j],i+j);
     819        }
     820        if (r->order[l]!=ringorder_M) break;
    809821      }
    810822    }
     
    833845      if (r->qideal!=NULL)
    834846      {
    835         idDelete(&r->qideal);
    836         r->qideal=NULL;
    837         currQuotient=NULL;
     847        idDelete(&r->qideal);
     848        r->qideal=NULL;
     849        currQuotient=NULL;
    838850      }
    839851      if (ppNoether!=NULL) pDelete(&ppNoether);
    840852      if ((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING))
    841853      {
    842         sLastPrinted.CleanUp();
    843         memset(&sLastPrinted,0,sizeof(sleftv));
     854        sLastPrinted.CleanUp();
     855        memset(&sLastPrinted,0,sizeof(sleftv));
    844856      }
    845857      currRing=NULL;
     
    852864      idDelete(&r->qideal);
    853865      r->qideal=NULL;
    854       if (savecurrRing!=NULL) rChangeCurrRing(savecurrRing,FALSE);
     866      rChangeCurrRing(savecurrRing,FALSE);
    855867    }
    856868    int i=1;
     
    861873      if (iiLocalRing[j]==r)
    862874      {
    863         if (j<myynest) Warn("killing the basering for level %d",j);
    864         iiLocalRing[j]=NULL;
     875        if (j<myynest) Warn("killing the basering for level %d",j);
     876        iiLocalRing[j]=NULL;
    865877      }
    866878    }
     
    874886      for (j=0; j<i; j++)
    875887      {
    876         if (r->wvhdl[j]!=NULL)
    877           FreeL(r->wvhdl[j]);
     888        if (r->wvhdl[j]!=NULL)
     889          FreeL(r->wvhdl[j]);
    878890      }
    879891      Free((ADDRESS)r->wvhdl,i*sizeof(short *));
    880892      if(r->names!=NULL)
    881893      {
    882         for (i=0; i<r->N; i++)
    883         {
    884           FreeL((ADDRESS)r->names[i]);
    885         }
    886         Free((ADDRESS)r->names,r->N*sizeof(char *));
     894        for (i=0; i<r->N; i++)
     895        {
     896          FreeL((ADDRESS)r->names[i]);
     897        }
     898        Free((ADDRESS)r->names,r->N*sizeof(char *));
    887899      }
    888900      if (r->parameter!=NULL)
    889901      {
    890         int len=0;
    891         char **s=r->parameter;
    892         while (len<r->P)
    893         {
    894           FreeL((ADDRESS)*s);
    895           s++;
    896           len++;
    897         }
    898         Free((ADDRESS)r->parameter,r->P*sizeof(char *));
     902        int len=0;
     903        char **s=r->parameter;
     904        while (len<r->P)
     905        {
     906          FreeL((ADDRESS)*s);
     907          s++;
     908          len++;
     909        }
     910        Free((ADDRESS)r->parameter,r->P*sizeof(char *));
    899911      }
    900912    }
     
    920932    {
    921933      if ((currRingHdl!=h)
    922           && (IDTYP(currRingHdl)==IDTYP(h))
    923           && (h->data.uring==currRingHdl->data.uring))
    924         break;
     934          && (IDTYP(currRingHdl)==IDTYP(h))
     935          && (h->data.uring==currRingHdl->data.uring))
     936        break;
    925937      currRingHdl=IDNEXT(currRingHdl);
    926938    }
     
    934946  {
    935947    if (((IDTYP(h)==RING_CMD)||(IDTYP(h)==QRING_CMD))
    936         && (h->data.uring==r)
    937         && (h!=n))
     948        && (h->data.uring==r)
     949        && (h!=n))
    938950      return h;
    939951    h=IDNEXT(h);
     
    945957{
    946958  int order=0;
    947  
     959
    948960  switch (*ordername)
    949961  {
     
    982994{
    983995  int nblocks,l,i;
    984  
     996
    985997  for (nblocks=0; r->order[nblocks]; nblocks++);
    986998  nblocks--;
    987  
     999
    9881000  StringSetS("");
    9891001  for (l=0; ; l++)
     
    9931005    {
    9941006      if (r->order[l]>=ringorder_ls)
    995         StringAppendS("s");
     1007        StringAppendS("s");
    9961008      else
    997         StringAppendS("p");
     1009        StringAppendS("p");
    9981010    }
    9991011    if ((r->order[l] != ringorder_c) && (r->order[l] != ringorder_C))
     
    10011013      if (r->wvhdl[l]!=NULL)
    10021014      {
    1003         StringAppendS("(");
    1004         for (int j= 0;
    1005              j<(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1);
    1006              j+=i+1)
    1007         {
    1008           char c=',';
    1009           for (i = 0; i<r->block1[l]-r->block0[l]; i++)
    1010           {
    1011             StringAppend("%d," ,r->wvhdl[l][i+j]);
    1012           }
    1013           if (r->order[l]!=ringorder_M)
    1014           {
    1015             StringAppend("%d)" ,r->wvhdl[l][i+j]);
    1016             break;
    1017           }
    1018           if (j+i+1==(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1))
    1019             c=')';
    1020           StringAppend("%d%c" ,r->wvhdl[l][i+j],c);
    1021         }
     1015        StringAppendS("(");
     1016        for (int j= 0;
     1017             j<(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1);
     1018             j+=i+1)
     1019        {
     1020          char c=',';
     1021          for (i = 0; i<r->block1[l]-r->block0[l]; i++)
     1022          {
     1023            StringAppend("%d," ,r->wvhdl[l][i+j]);
     1024          }
     1025          if (r->order[l]!=ringorder_M)
     1026          {
     1027            StringAppend("%d)" ,r->wvhdl[l][i+j]);
     1028            break;
     1029          }
     1030          if (j+i+1==(r->block1[l]-r->block0[l]+1)*(r->block1[l]-r->block0[l]+1))
     1031            c=')';
     1032          StringAppend("%d%c" ,r->wvhdl[l][i+j],c);
     1033        }
    10221034      }
    10231035      else
    1024         StringAppend("(%d)",r->block1[l]-r->block0[l]+1);
     1036        StringAppend("(%d)",r->block1[l]-r->block0[l]+1);
    10251037    }
    10261038    if (l==nblocks) return mstrdup(StringAppendS(""));
     
    10341046  int l=2;
    10351047  char *s;
    1036  
     1048
    10371049  for (i=0; i<r->N; i++)
    10381050  {
     
    10541066  char *s;
    10551067  int i;
    1056  
     1068
    10571069  if (r->parameter==NULL)
    10581070  {
     
    10951107{
    10961108  if (r->parameter==NULL) return mstrdup("");
    1097  
     1109
    10981110  int i;
    10991111  int l=2;
    1100  
     1112
    11011113  for (i=0; i<r->P; i++)
    11021114  {
     
    11251137  FreeL((ADDRESS)ord);
    11261138  return res;
    1127 } 
     1139}
    11281140
    11291141int rChar(ring r)
     
    11821194      if (r1->parameter!=NULL)
    11831195      {
    1184         if (strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    1185         {
    1186           tmpR.parameter=(char **)Alloc(sizeof(char *));
    1187           tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    1188           tmpR.P=1;
    1189         }
    1190         else
    1191         {
    1192           WerrorS("GF(p,n)+GF(p,n)");
    1193           return -1;
    1194         }
     1196        if (strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
     1197        {
     1198          tmpR.parameter=(char **)Alloc(sizeof(char *));
     1199          tmpR.parameter[0]=mstrdup(r1->parameter[0]);
     1200          tmpR.P=1;
     1201        }
     1202        else
     1203        {
     1204          WerrorS("GF(p,n)+GF(p,n)");
     1205          return -1;
     1206        }
    11951207      }
    11961208    }
     
    11991211      if (r1->minpoly!=NULL)
    12001212      {
    1201         if (r2->minpoly!=NULL)
    1202         {
    1203           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
    1204           if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    1205               && naEqual(r1->minpoly,r2->minpoly))
    1206           {
    1207             tmpR.parameter=(char **)Alloc(sizeof(char *));
    1208             tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    1209             tmpR.minpoly=naCopy(r1->minpoly);
    1210             tmpR.P=1;
    1211             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1212           }
    1213           else
    1214           {
    1215             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1216             WerrorS("different minpolys");
    1217             return -1;
    1218           }
    1219         }
    1220         else
    1221         {
    1222           if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    1223               && (r2->P==1))
    1224           {
    1225             tmpR.parameter=(char **)Alloc0(sizeof(char *));
    1226             tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    1227             tmpR.P=1;
    1228             nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
    1229             tmpR.minpoly=naCopy(r1->minpoly);
    1230             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1231           }
    1232           else
    1233           {
    1234             WerrorS("different parameters and minpoly!=0");
    1235             return -1;
    1236           }
    1237         }
     1213        if (r2->minpoly!=NULL)
     1214        {
     1215          nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1216          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
     1217              && naEqual(r1->minpoly,r2->minpoly))
     1218          {
     1219            tmpR.parameter=(char **)Alloc(sizeof(char *));
     1220            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
     1221            tmpR.minpoly=naCopy(r1->minpoly);
     1222            tmpR.P=1;
     1223            nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1224          }
     1225          else
     1226          {
     1227            nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1228            WerrorS("different minpolys");
     1229            return -1;
     1230          }
     1231        }
     1232        else
     1233        {
     1234          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
     1235              && (r2->P==1))
     1236          {
     1237            tmpR.parameter=(char **)Alloc0(sizeof(char *));
     1238            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
     1239            tmpR.P=1;
     1240            nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1241            tmpR.minpoly=naCopy(r1->minpoly);
     1242            nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1243          }
     1244          else
     1245          {
     1246            WerrorS("different parameters and minpoly!=0");
     1247            return -1;
     1248          }
     1249        }
    12381250      }
    12391251      else /* r1->minpoly==NULL */
    12401252      {
    1241         if (r2->minpoly!=NULL)
    1242         {
    1243           if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    1244               && (r1->P==1))
    1245           {
    1246             tmpR.parameter=(char **)Alloc(sizeof(char *));
    1247             tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    1248             tmpR.P=1;
    1249             nSetChar(r2->ch,TRUE,r2->parameter,r2->P);
    1250             tmpR.minpoly=naCopy(r2->minpoly);
    1251             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1252           }
    1253           else
    1254           {
    1255             WerrorS("different parameters and minpoly!=0");
    1256             return -1;
    1257           }
    1258         }
    1259         else
    1260         {
    1261           int len=rPar(r1)+rPar(r2);
    1262           tmpR.parameter=(char **)Alloc(len*sizeof(char *));
    1263           int i;
    1264           for (i=0;i<r1->P;i++)
    1265           {
    1266             tmpR.parameter[i]=mstrdup(r1->parameter[i]);
    1267           }
    1268           int j,l;
    1269           for(j=0;j<r2->P;j++)
    1270           {
    1271             for(l=0;l<i;l++)
    1272             {
    1273               if(strcmp(tmpR.parameter[l],r2->parameter[j])==0)
    1274                 break;
    1275             }
    1276             if (l==i)
    1277             {
    1278               tmpR.parameter[i]=mstrdup(r2->parameter[j]);
    1279               i++;
    1280             }
    1281           }
    1282           if (i!=len)
    1283           {
    1284             ReAlloc(tmpR.parameter,len*sizeof(char *),i*sizeof(char *));
    1285           }
    1286         }
     1253        if (r2->minpoly!=NULL)
     1254        {
     1255          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
     1256              && (r1->P==1))
     1257          {
     1258            tmpR.parameter=(char **)Alloc(sizeof(char *));
     1259            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
     1260            tmpR.P=1;
     1261            nSetChar(r2->ch,TRUE,r2->parameter,r2->P);
     1262            tmpR.minpoly=naCopy(r2->minpoly);
     1263            nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1264          }
     1265          else
     1266          {
     1267            WerrorS("different parameters and minpoly!=0");
     1268            return -1;
     1269          }
     1270        }
     1271        else
     1272        {
     1273          int len=rPar(r1)+rPar(r2);
     1274          tmpR.parameter=(char **)Alloc(len*sizeof(char *));
     1275          int i;
     1276          for (i=0;i<r1->P;i++)
     1277          {
     1278            tmpR.parameter[i]=mstrdup(r1->parameter[i]);
     1279          }
     1280          int j,l;
     1281          for(j=0;j<r2->P;j++)
     1282          {
     1283            for(l=0;l<i;l++)
     1284            {
     1285              if(strcmp(tmpR.parameter[l],r2->parameter[j])==0)
     1286                break;
     1287            }
     1288            if (l==i)
     1289            {
     1290              tmpR.parameter[i]=mstrdup(r2->parameter[j]);
     1291              i++;
     1292            }
     1293          }
     1294          if (i!=len)
     1295          {
     1296            ReAlloc(tmpR.parameter,len*sizeof(char *),i*sizeof(char *));
     1297          }
     1298        }
    12871299      }
    12881300    }
     
    12931305    {
    12941306      if ((r2->ch==0) /* Q */
    1295           || (r2->ch==-r1->ch)) /* Z/p */
    1296       {
    1297         tmpR.ch=r1->ch;
    1298         tmpR.parameter=(char **)Alloc(rPar(r1)*sizeof(char *));
    1299         tmpR.P=r1->P;
    1300         memcpy(tmpR.parameter,r1->parameter,rPar(r1)*sizeof(char *));
    1301         if (r1->minpoly!=NULL)
    1302         {
    1303           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
    1304           tmpR.minpoly=naCopy(r1->minpoly);
    1305           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1306         }
     1307          || (r2->ch==-r1->ch)) /* Z/p */
     1308      {
     1309        tmpR.ch=r1->ch;
     1310        tmpR.parameter=(char **)Alloc(rPar(r1)*sizeof(char *));
     1311        tmpR.P=r1->P;
     1312        memcpy(tmpR.parameter,r1->parameter,rPar(r1)*sizeof(char *));
     1313        if (r1->minpoly!=NULL)
     1314        {
     1315          nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1316          tmpR.minpoly=naCopy(r1->minpoly);
     1317          nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1318        }
    13071319      }
    13081320      else  /* R, Q(a),Z/q,Z/p(a),GF(p,n) */
    13091321      {
    1310         WerrorS("Z/p(a)+(R,Q(a),Z/q(a),GF(q,n))");
    1311         return -1;
     1322        WerrorS("Z/p(a)+(R,Q(a),Z/q(a),GF(q,n))");
     1323        return -1;
    13121324      }
    13131325    }
     
    13211333      if ((r2->ch<-1)||(r2->ch==1)) /* Z/p(a),Q(a) */
    13221334      {
    1323         tmpR.ch=r2->ch;
    1324         tmpR.P=r2->P;
    1325         tmpR.parameter=(char **)Alloc(rPar(r2)*sizeof(char *));
    1326         memcpy(tmpR.parameter,r2->parameter,rPar(r2)*sizeof(char *));
    1327         if (r2->minpoly!=NULL)
    1328         {
    1329           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
    1330           tmpR.minpoly=naCopy(r2->minpoly);
    1331           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1332         }
     1335        tmpR.ch=r2->ch;
     1336        tmpR.P=r2->P;
     1337        tmpR.parameter=(char **)Alloc(rPar(r2)*sizeof(char *));
     1338        memcpy(tmpR.parameter,r2->parameter,rPar(r2)*sizeof(char *));
     1339        if (r2->minpoly!=NULL)
     1340        {
     1341          nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1342          tmpR.minpoly=naCopy(r2->minpoly);
     1343          nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1344        }
    13331345      }
    13341346      else if (r2->ch>1) /* Z/p,GF(p,n) */
    13351347      {
    1336         tmpR.ch=r2->ch;
    1337         if (r2->parameter!=NULL)
    1338         {
    1339           tmpR.parameter=(char **)Alloc(sizeof(char *));
    1340           tmpR.P=1;
    1341           tmpR.parameter[0]=mstrdup(r2->parameter[0]);
    1342         }
     1348        tmpR.ch=r2->ch;
     1349        if (r2->parameter!=NULL)
     1350        {
     1351          tmpR.parameter=(char **)Alloc(sizeof(char *));
     1352          tmpR.P=1;
     1353          tmpR.parameter[0]=mstrdup(r2->parameter[0]);
     1354        }
    13431355      }
    13441356      else
    13451357      {
    1346         WerrorS("Q+R");
    1347         return -1; /* R */
     1358        WerrorS("Q+R");
     1359        return -1; /* R */
    13481360      }
    13491361    }
     
    13521364      if (r2->ch==0) /* Q */
    13531365      {
    1354         tmpR.ch=r1->ch;
    1355         tmpR.P=rPar(r1);
    1356         tmpR.parameter=(char **)Alloc0(rPar(r1)*sizeof(char *));
    1357         int i;
    1358         for(i=0;i<r1->P;i++)
    1359         {
    1360           tmpR.parameter[i]=mstrdup(r1->parameter[i]);
    1361         }
    1362         if (r1->minpoly!=NULL)
    1363         {
    1364           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
    1365           tmpR.minpoly=naCopy(r1->minpoly);
    1366           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1367         }
     1366        tmpR.ch=r1->ch;
     1367        tmpR.P=rPar(r1);
     1368        tmpR.parameter=(char **)Alloc0(rPar(r1)*sizeof(char *));
     1369        int i;
     1370        for(i=0;i<r1->P;i++)
     1371        {
     1372          tmpR.parameter[i]=mstrdup(r1->parameter[i]);
     1373        }
     1374        if (r1->minpoly!=NULL)
     1375        {
     1376          nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1377          tmpR.minpoly=naCopy(r1->minpoly);
     1378          nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1379        }
    13681380      }
    13691381      else  /* R, Z/p,GF(p,n) */
    13701382      {
    1371         WerrorS("Q(a)+(R,Z/p,GF(p,n))");
    1372         return -1;
     1383        WerrorS("Q(a)+(R,Z/p,GF(p,n))");
     1384        return -1;
    13731385      }
    13741386    }
     
    13771389      if (r2->ch==0) /* Q */
    13781390      {
    1379         tmpR.ch=r1->ch;
     1391        tmpR.ch=r1->ch;
    13801392      }
    13811393      else if (r2->ch==-r1->ch) /* Z/p(a) */
    13821394      {
    1383         tmpR.ch=r2->ch;
    1384         tmpR.P=rPar(r2);
    1385         tmpR.parameter=(char **)Alloc(rPar(r2)*sizeof(char *));
    1386         int i;
    1387         for(i=0;i<r2->P;i++)
    1388         {
    1389           tmpR.parameter[i]=mstrdup(r2->parameter[i]);
    1390         }
    1391         if (r2->minpoly!=NULL)
    1392         {
    1393           nSetChar(r2->ch,TRUE,r2->parameter,r2->P);
    1394           tmpR.minpoly=naCopy(r2->minpoly);
    1395           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
    1396         }
     1395        tmpR.ch=r2->ch;
     1396        tmpR.P=rPar(r2);
     1397        tmpR.parameter=(char **)Alloc(rPar(r2)*sizeof(char *));
     1398        int i;
     1399        for(i=0;i<r2->P;i++)
     1400        {
     1401          tmpR.parameter[i]=mstrdup(r2->parameter[i]);
     1402        }
     1403        if (r2->minpoly!=NULL)
     1404        {
     1405          nSetChar(r2->ch,TRUE,r2->parameter,r2->P);
     1406          tmpR.minpoly=naCopy(r2->minpoly);
     1407          nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1408        }
    13971409      }
    13981410      else
    13991411      {
    1400         WerrorS("Z/p+(GF(q,n),Z/q(a),R,Q(a))");
    1401         return -1; /* GF(p,n),Z/q(a),R,Q(a) */
     1412        WerrorS("Z/p+(GF(q,n),Z/q(a),R,Q(a))");
     1413        return -1; /* GF(p,n),Z/q(a),R,Q(a) */
    14021414      }
    14031415    }
     
    14081420  char **names=(char **)Alloc0(l*sizeof(char*));
    14091421  k=0;
    1410  
     1422
    14111423  // collect all varnames from r1, except those which are parameters
    14121424  // of r2, or those which are the empty string
     
    14141426  {
    14151427    BOOLEAN b=TRUE;
    1416    
     1428
    14171429    if (*(r1->names[i]) == '\0')
    14181430      b = FALSE;
     
    14211433      for(j=0;j<r2->P;j++)
    14221434      {
    1423         if (strcmp(r1->names[i],r2->parameter[j])==0)
    1424         {
    1425           b=FALSE;
    1426           break;
    1427         }
    1428       }
    1429     }
    1430    
     1435        if (strcmp(r1->names[i],r2->parameter[j])==0)
     1436        {
     1437          b=FALSE;
     1438          break;
     1439        }
     1440      }
     1441    }
     1442
    14311443    if (b)
    14321444    {
     
    14431455  {
    14441456    BOOLEAN b=TRUE;
    1445    
     1457
    14461458    if (*(r2->names[i]) == '\0')
    14471459      b = FALSE;
     
    14501462      for(j=0;j<r1->P;j++)
    14511463      {
    1452         if (strcmp(r2->names[i],r1->parameter[j])==0)
    1453         {
    1454           b=FALSE;
    1455           break;
    1456         }
    1457       }
    1458     }
    1459    
     1464        if (strcmp(r2->names[i],r1->parameter[j])==0)
     1465        {
     1466          b=FALSE;
     1467          break;
     1468        }
     1469      }
     1470    }
     1471
    14601472    if (b)
    14611473    {
    14621474      for(j=0;j<r1->N;j++)
    14631475      {
    1464         if (strcmp(r1->names[j],r2->names[i])==0)
    1465         {
    1466           b=FALSE;
    1467           break;
    1468         }
     1476        if (strcmp(r1->names[j],r2->names[i])==0)
     1477        {
     1478          b=FALSE;
     1479          break;
     1480        }
    14691481      }
    14701482      if (b)
    14711483      {
    1472         names[k]=mstrdup(r2->names[i]);
    1473         //Print("name : %d : %s\n",k,r2->names[i]);
    1474         k++;
     1484        names[k]=mstrdup(r2->names[i]);
     1485        //Print("name : %d : %s\n",k,r2->names[i]);
     1486        k++;
    14751487      }
    14761488      //else
     
    15351547      for (i=0;i<b;i++)
    15361548      {
    1537         tmpR.order[i]=rb->order[i];
    1538         tmpR.block0[i]=rb->block0[i];
    1539         tmpR.block1[i]=rb->block1[i];
     1549        tmpR.order[i]=rb->order[i];
     1550        tmpR.block0[i]=rb->block0[i];
     1551        tmpR.block1[i]=rb->block1[i];
    15401552      }
    15411553      tmpR.block0[0]=1;
     
    15451557      for (i=0;r1->order[i]!=0;i++)
    15461558      {
    1547         tmpR.order[i]=r1->order[i];
    1548         tmpR.block0[i]=r1->block0[i];
    1549         tmpR.block1[i]=r1->block1[i];
     1559        tmpR.order[i]=r1->order[i];
     1560        tmpR.block0[i]=r1->block0[i];
     1561        tmpR.block1[i]=r1->block1[i];
    15501562      }
    15511563      j=i;
    15521564      i--;
    15531565      if ((r1->order[i]==ringorder_c)
    1554           ||(r1->order[i]==ringorder_C))
    1555       {
    1556         j--;
    1557         tmpR.order[b-2]=r1->order[i];
     1566          ||(r1->order[i]==ringorder_C))
     1567      {
     1568        j--;
     1569        tmpR.order[b-2]=r1->order[i];
    15581570      }
    15591571      for (i=0;r2->order[i]!=0;i++,j++)
    15601572      {
    1561         if ((r2->order[i]!=ringorder_c)
    1562             &&(r2->order[i]!=ringorder_C))
    1563         {
    1564           tmpR.order[j]=r2->order[i];
    1565           tmpR.block0[j]=r2->block0[i]+r1->N;
    1566           tmpR.block1[j]=r2->block1[i]+r1->N;
    1567         }
     1573        if ((r2->order[i]!=ringorder_c)
     1574            &&(r2->order[i]!=ringorder_C))
     1575        {
     1576          tmpR.order[j]=r2->order[i];
     1577          tmpR.block0[j]=r2->block0[i]+r1->N;
     1578          tmpR.block1[j]=r2->block1[i]+r1->N;
     1579        }
    15681580      }
    15691581      if((r1->OrdSgn==-1)||(r2->OrdSgn==-1))
    1570         tmpR.OrdSgn=-1;
     1582        tmpR.OrdSgn=-1;
    15711583    }
    15721584  }
     
    15751587  {
    15761588    int b=rBlocks(r1);
    1577    
     1589
    15781590    tmpR.order=(int*)Alloc0(b*sizeof(int));
    15791591    tmpR.block0=(int*)Alloc0(b*sizeof(int));
     
    16131625  int *pi;
    16141626  ring res=(ring)Alloc(sizeof(ip_sring));
    1615  
     1627
    16161628  memcpy4(res,r,sizeof(ip_sring));
    16171629  if (r->parameter!=NULL)
     
    16801692              return rOrderType_ExpComp;
    16811693            return rOrderType_Exp;
    1682        
     1694
    16831695          default:
    16841696            assume(r->order[0] == ringorder_lp ||
     
    16871699                   r->order[0] == ringorder_Ds ||
    16881700                   r->order[0] == ringorder_Ws);
    1689            
     1701
    16901702            if (r->order[1] == ringorder_c) return rOrderType_ExpComp;
    16911703            return rOrderType_Exp;
     
    16981710    }
    16991711  }
    1700   else 
     1712  else
    17011713    return rOrderType_General;
    17021714}
     
    17041716BOOLEAN rHasSimpleOrder(ring r)
    17051717{
    1706   return 
     1718  return
    17071719    (r->order[0] == ringorder_unspec) ||
    17081720    ((r->order[2] == 0) &&
     
    17101722      r->order[0] != ringorder_M));
    17111723}
     1724
    17121725// returns TRUE, if simple lp or ls ordering
    17131726BOOLEAN rHasSimpleLexOrder(ring r)
     
    17201733}
    17211734
    1722      
     1735
Note: See TracChangeset for help on using the changeset viewer.