Changeset c5f63ab in git


Ignore:
Timestamp:
Mar 18, 1998, 3:28:54 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
7f1b912b1613387b9ef8e0f2a053a2c335b9b5da
Parents:
e0fb8d31ff69374db7f865baedfda3e614804382
Message:
1998-03-18  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* polys-impl.h: Cleaned up COMP_FAST and related #defines


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

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    re0fb8d3 rc5f63ab  
     11998-03-18  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
     2
     3        * polys-impl.h: Cleaned up COMP_FAST and related #defines
     4
    151998-03-16  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
    26
  • Singular/polys-impl.cc

    re0fb8d3 rc5f63ab  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys-impl.cc,v 1.9 1998-01-27 18:51:20 Singular Exp $ */
     4/* $Id: polys-impl.cc,v 1.10 1998-03-18 14:28:48 obachman Exp $ */
    55
    66/***************************************************************
     
    5656#ifdef COMP_FAST
    5757// gets var indicies w.r.t. the ring r
    58 void pGetVarIndicies(ring r,
    59                      int &VarOffset, int &VarCompIndex,
     58void pGetVarIndicies(ring r, int &VarOffset,
    6059                     int &VarLowIndex, int &VarHighIndex)
    6160{
     
    7877        case ringorder_ws:
    7978        case ringorder_unspec:
    80           pGetVarIndicies_RevLex(r->N, VarOffset, VarCompIndex,
    81                                  VarLowIndex, VarHighIndex);
     79          pGetVarIndicies_RevLex(r->N, VarOffset, VarLowIndex, VarHighIndex);
    8280          break;
    8381
     
    9290        default:
    9391#endif
    94           pGetVarIndicies_Lex(r->N, VarOffset, VarCompIndex,
    95                                  VarLowIndex, VarHighIndex);
     92          pGetVarIndicies_Lex(r->N, VarOffset, VarLowIndex, VarHighIndex);
    9693#ifdef PDEBUG
    9794          break;
     
    104101  else
    105102    // default var indicies are used
    106     pGetVarIndicies(r->N, VarOffset, VarCompIndex, VarLowIndex, VarHighIndex);
     103    pGetVarIndicies(r->N, VarOffset, VarLowIndex, VarHighIndex);
    107104}
    108105
  • Singular/polys-impl.h

    re0fb8d3 rc5f63ab  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-impl.h,v 1.19 1998-03-17 10:59:57 obachman Exp $ */
     6/* $Id: polys-impl.h,v 1.20 1998-03-18 14:28:49 obachman Exp $ */
    77
    88/***************************************************************
     
    1616 *
    1717 ***************************************************************/
    18 #include "tok.h"
    1918#include "structs.h"
    2019#include "mmemory.h"
     
    2928typedef EXPONENT_TYPE Exponent_t;
    3029
    31 #define VARS (100)   /*max. number of variables as constant*/
     30#define VARS (10)   /*max. number of variables as constant*/
    3231
    3332typedef Exponent_t  monomial[VARS + 1];
     
    4241  monomial  exp; // make sure that exp is aligned
    4342};
    44 
    4543
    4644/***************************************************************
     
    7977//                               pVarLowIndex = 0,
    8078//                               pVarHighIndex = pVariables-1
    81 //                               P_COMP_INDEX = pVariables
     79//                               _pCompIndex = pVariables
    8280// BIGENDIAN -- rev lex order
    8381// e_n, ... , e_2, e_1,comp,.. : pVarOffset = pVariables,
    8482//                               pVarLowIndex = 0,
    8583//                               pVarHighIndex = pVariables-1
    86 //                               P_COMP_INDEX = pVariables
     84//                               _pCompIndex = pVariables
    8785// LITTLEENDIAN -- rev lex order
    8886// comp,.., e_1, e_2, ... , e_n : pVarOffset = #(..),
    8987//                                pVarLowIndex = 1 + #(..),
    9088//                                pVarHighIndex = #(..) + pVariables
    91 //                                P_COMP_INDEX = pVariables
     89//                                _pCompIndex = 0
    9290// LITTLEENDIAN -- lex order
    9391// comp,..,e_n, .... , e_2, e_1 : pVarOffset = pVariables + 1 + #(..)
    9492//                                pVarLowIndex = 1 + #(..)
    9593//                                pVarHighIndex = #(..) + pVariables
    96 //                                P_COMP_INDEX = pVariables
     94//                                _pCompIndex = 0
    9795//
    9896// Furthermore, the size of the exponent vector is always a multiple
     
    103101#ifdef WORDS_BIGENDIAN
    104102
    105 #define _pHasReverseExp    (pVarOffset != -1)
     103#define _pHasReverseExp     (pVarOffset != -1)
     104
    106105#define _pExpIndex(i)                           \
    107106  (pVarOffset == -1 ? (i) - 1 : pVarOffset - (i))
     
    109108  ((r)->VarOffset == -1 ? (i) - 1 : (r)->VarOffset - (i))
    110109
     110#define _pCompIndex         pVariables
     111#define _pRingCompIndex(r)  ((r)->N)
     112
    111113#else // ! WORDS_BIGENDIAN
    112114
    113115#define _pHasReverseExp    (pVarOffset > (SIZEOF_LONG / SIZEOF_EXPONENT) - 1)
     116
    114117#define _pExpIndex(i)                                   \
    115118  (pVarOffset > (SIZEOF_LONG / SIZEOF_EXPONENT) - 1 ?   \
     
    118121  ((r)->VarOffset > (SIZEOF_LONG / SIZEOF_EXPONENT) - 1 ?   \
    119122   (r)->VarOffset - (i) : (r)->VarOffset + (i))
     123
     124#define _pCompIndex         0
     125#define _pRingCompIndex(r)  0
    120126
    121127#endif // WORDS_BIGENDIAN
     
    133139    temp = temp / sizeof(long);
    134140  else
    135     temp = (temp / sizeof(long)) + 1; // now temp == nvars1W
    136   VarHighIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1;
    137   VarLowIndex  = VarHighIndex - nvars + 1;
    138   VarOffset    = VarHighIndex + 1;
     141    temp = (temp / sizeof(long)) + 1; // temp == pVariables1W
     142  temp *= sizeof(long)/sizeof(Exponent_t);
     143  VarHighIndex = temp -1;
     144  VarLowIndex = temp - nvars;
     145  VarOffset = temp;
    139146#endif // WORDS_BIGENDIAN
    140147}
     
    156163    temp = temp / sizeof(long);
    157164  else
    158     temp = (temp / sizeof(long)) + 1;
    159   VarHighIndex = temp * sizeof(long)/sizeof(Exponent_t) - 1;
    160   VarLowIndex  = VarHighIndex - nvars + 1;
    161   VarOffset    = VarLowIndex - 1;
     165    temp = (temp / sizeof(long)) + 1; // temp == pVariables1W
     166  temp *= sizeof(long)/sizeof(Exponent_t);
     167  VarHighIndex = temp -1;
     168  VarLowIndex = temp - nvars;
     169  VarOffset = temp - nvars -1;
    162170#endif // WORDS_BIGENDIAN
    163171}
    164 #ifdef WORDS_BIGENDIAN
    165172#define pSetVarIndicies_RevLex(nvars) \
    166  pGetVarIndicies_RevLex(nvars,pVarOffset,pCompIndex,pVarLowIndex,pVarHighIndex)
    167 #else
    168 #define pSetVarIndicies_RevLex(nvars) \
    169  pGetVarIndicies_RevLex(nvars,pVarOffset,pVarLowIndex, pVarLowIndex,pVarHighIndex)
    170 #endif
     173 pGetVarIndicies_RevLex(nvars,pVarOffset,pVarLowIndex,pVarHighIndex)
    171174
    172175// The default settings:
    173 inline void pGetVarIndicies(int nvars,
    174                             int &VarOffset, int &VarCompIndex,
     176inline void pGetVarIndicies(int nvars, int &VarOffset,
    175177                            int &VarLowIndex, int &VarHighIndex)
    176178{
    177   pGetVarIndicies_Lex(nvars,VarOffset,VarCompIndex,VarLowIndex,VarHighIndex);
    178 }
    179 
     179  pGetVarIndicies_Lex(nvars,VarOffset,VarLowIndex,VarHighIndex);
     180}
    180181// gets var indicies w.r.t. the ring r
    181 extern void pGetVarIndicies(ring r,
    182                             int &VarOffset, int &VarCompIndex,
     182extern void pGetVarIndicies(ring r, int &VarOffset,
    183183                            int &VarLowIndex, int &VarHighIndex);
    184184
    185185#define pSetVarIndicies(nvars) \
    186   pGetVarIndicies(nvars, pVarOffset, pCompIndex, pVarLowIndex, pVarHighIndex)
    187 
    188 
    189 #else  // ! COMP_FAST
    190 #define _pExpIndex(i)       (i)
    191 #define _pRingExpIndex(r,i) (i)
    192 #endif // COMP_FAST
    193 
    194 /***************************************************************
    195  *
    196  * Primitives for accessing and seeting fields of a poly
     186  pGetVarIndicies(nvars, pVarOffset, pVarLowIndex, pVarHighIndex)
     187
     188
     189/***************************************************************
     190 *
     191 * Primitives for accessing and setting fields of a poly
    197192 *
    198193 ***************************************************************/
     
    204199#define _pSetCoeff0(p,n)    (p)->coef=n
    205200
    206 #ifndef TEST_MAC_DEBUG
    207201#define _pGetOrder(p)       ((p)->Order)
    208 #else
    209 #define _pGetOrder(p)       ((p)->MOrder)
    210 #endif
    211202
    212203#if defined(PDEBUG) && PDEBUG != 0
     
    259250}
    260251
    261 #define _pSetComp(p,k)      (p)->exp[pCompIndex] = (k)
    262 #define _pGetComp(p)        (p)->exp[pCompIndex]
    263 #define _pIncrComp(p)       (p)->exp[pCompIndex]++
    264 #define _pDecrComp(p)       (p)->exp[pCompIndex]--
    265 #define _pAddComp(p,v)      (p)->exp[pCompIndex] += (v)
    266 #define _pSubComp(p,v)      (p)->exp[pCompIndex] -= (v)
    267 
    268 #ifdef COMP_FAST
    269 #define _pRingSetComp(r,p,k)      (p)->exp[(r)->CompIndex] = (k)
    270 #define _pRingGetComp(r,p)        (p)->exp[(r)->CompIndex]
    271 #else
    272 #define _pRingSetComp(r,p,k)      _pSetComp(p,k)
    273 #define _pRingGetComp(r,p)        _pGetComp(p)
    274 #endif
    275 
     252#define _pSetComp(p,k)      (p)->exp[_pCompIndex] = (k)
     253#define _pGetComp(p)        (p)->exp[_pCompIndex]
     254#define _pIncrComp(p)       (p)->exp[_pCompIndex]++
     255#define _pDecrComp(p)       (p)->exp[_pCompIndex]--
     256#define _pAddComp(p,v)      (p)->exp[_pCompIndex] += (v)
     257#define _pSubComp(p,v)      (p)->exp[_pCompIndex] -= (v)
     258
     259#define _pRingSetComp(r,p,k)      (p)->exp[_pRingCompIndex(r)] = (k)
     260#define _pRingGetComp(r,p)        (p)->exp[_pRingCompIndex(r)]
     261
     262inline void _pGetExpV(poly p, Exponent_t *ev)
     263{
     264  if (_pHasReverseExp)
     265  {
     266    for (int i = pVarLowIndex, j = pVariables; j; i++, j--)
     267      ev[j] = p->exp[i];
     268  }
     269  else
     270    memcpy(&ev[1], &(p->exp[pVarLowIndex]), pVariables*sizeof(Exponent_t));
     271  ev[0] = _pGetComp(p);
     272}
     273
     274extern pSetmProc pSetm;
     275inline void _pSetExpV(poly p, Exponent_t *ev)
     276{
     277  if (_pHasReverseExp)
     278  {
     279    for (int i = pVarLowIndex, j = pVariables; j; i++, j--)
     280      p->exp[i] = ev[j];
     281  }
     282  else
     283    memcpy(&(p->exp[pVarLowIndex]), &ev[1], pVariables*sizeof(Exponent_t));
     284  _pSetComp(p, ev[0]);
     285  pSetm(p);
     286}
    276287
    277288/***************************************************************
     
    316327#define _pHead(A)       pDBHead(A,__FILE__,__LINE__)
    317328#define _pHead0(A)      pDBHead0(A, __FILE__,__LINE__)
    318 #ifdef COMP_FAST
    319329#define _pFetchCopy(r,A)    pDBFetchCopy(r, A,__FILE__,__LINE__)
    320 #else
    321 #define _pFetchCopy(r,p)    pOrdPolyInsertSetm(pCopy(p))
    322 #endif
    323330
    324331#else // ! PDEBUG
     
    328335#else
    329336#define _pNew()         (poly) mmAllocSpecialized()
    330 // #define _pNew() _pInit()
    331337#endif
    332338
    333339#include <string.h>
    334 
    335340inline poly    _pInit(void)
    336341{
     
    356361extern poly    _pHead(poly a);
    357362extern poly    _pHead0(poly a);
    358 #ifdef COMP_FAST
    359363extern poly    _pFetchCopy(ring r,poly a);
    360 #else
    361 #define _pFetchCopy(r,p)  pOrdPolyInsertSetm(pCopy(p))
    362 #endif
    363 
    364364#endif // PDEBUG
    365365
    366366#define _pCopy2(p1, p2)     memcpyW(p1, p2, pMonomSizeW)
    367367
     368/***************************************************************
     369 *
     370 * Routines which work on vectors instead of single exponents
     371 *
     372 ***************************************************************/
    368373// Here is a handy Macro which disables inlining when run with
    369374// profiling and enables it otherwise
    370375
    371 #ifdef DO_PROFILE
     376#ifdef DO_DEEP_PROFILE
    372377
    373378#ifndef POLYS_IMPL_CC
     379
    374380#define DECLARE(type, arglist) type arglist; \
    375381   static type dummy_##arglist
     
    378384#endif // POLYS_IMPL_CC
    379385
    380 #else //! DO_PROFILE
     386#else //! DO_DEEP_PROFILE
    381387
    382388#define DECLARE(type, arglist ) inline type arglist
    383389
    384 #endif // DO_PROFILE
    385 
    386 
    387 /***************************************************************
    388  *
    389  * Routines which work on vectors instead of single exponents
    390  *
    391  ***************************************************************/
    392 
    393 #ifdef COMP_FAST
    394 
    395 // nice declaration isn't it ??
     390#endif // DO_DEEP_PROFILE
     391
     392
    396393#if defined(PDEBUG) && PDEBUG == 1
    397 #define pMonAddFast(p1, p2)  pDBMonAddFast(p1, p2, __FILE__, __LINE__)
     394#define _pMonAddFast(p1, p2)  pDBMonAddFast(p1, p2, __FILE__, __LINE__)
    398395extern  void pDBMonAddFast(poly p1, poly p2, char* f, int l);
    399 inline void _pMonAddFast(poly p1, poly p2)
    400 #else
    401   DECLARE(void, pMonAddFast(poly p1, poly p2))
     396inline void __pMonAddFast(poly p1, poly p2)
     397#else
     398  DECLARE(void, _pMonAddFast(poly p1, poly p2))
    402399#endif // defined(PDEBUG) && PDEBUG == 1
    403400{
     
    406403  // positive and the sum of two exponents does not exceed
    407404  // EXPONENT_MAX
    408 #ifndef COMP_NO_EXP_VECTOR_OPS
    409405  Exponent_t c2 = _pGetComp(p2);
    410406  int i = pVariables1W;
     
    413409  // set comp of p2 temporarily to 0, so that nothing is added to comp of p1
    414410  _pSetComp(p2, 0);
    415 #else
    416   int i = pVariables;
    417   Exponent_pt s1 = &(p1->exp[pVarLowIndex]);
    418   Exponent_pt s2 = &(p2->exp[pVarLowIndex]);
    419 #endif
    420411
    421412  for (;;)
     
    427418    s2++;
    428419  }
    429 #ifndef COMP_NO_EXP_VECTOR_OPS
    430420  // reset comp of p2
    431421  _pSetComp(p2, c2);
    432 #endif
    433 #ifdef TEST_MAC_ORDER
    434   if (bNoAdd) bSetm(p1);else
    435 #endif
    436422  _pGetOrder(p1) += _pGetOrder(p2);
    437423}
     
    446432#endif // defined(PDEBUG) && PDEBUG == 1
    447433{
    448   p1->next = p2->next;
    449   p1->coef = p2->coef;
    450 //  memset(p1, 0, pMonomSize);
    451 
    452   //memset(p1,0,pMonomSize);
    453 #ifndef COMP_NO_EXP_VECTOR_OPS
    454434  unsigned long* s1 = (unsigned long*) &(p1->exp[0]);
    455435  const unsigned long* s2 = (unsigned long*) &(p2->exp[0]);
    456436  const unsigned long* s3 = (unsigned long*) &(p3->exp[0]);
    457437  const unsigned long* const ub = s3 + pVariables1W;
    458 #else
    459   Exponent_t* s1 = (Exponent_t*) &(p1->exp[pVarLowIndex]);
    460   const Exponent_t* s2 = (Exponent_t*) &(p2->exp[pVarLowIndex]);
    461   const Exponent_t* s3 = (Exponent_t*) &(p3->exp[pVarLowIndex]);
    462   const Exponent_t* const ub = s3 + pVariables;
    463 // need to zero the "fill in" slots (i.e., empty exponents)
    464 #ifdef  WORDS_BIGENDIAN
    465   *((unsigned long *) ((unsigned long*) p1) + pMonomSizeW -1) = 0;
    466 #else
    467   *((unsigned long *) p1->exp) = 0;
    468 #endif
    469 #endif
     438
     439  p1->next = p2->next;
     440  p1->coef = p2->coef;
    470441
    471442  for (;;)
     
    480451  // component of p1 is set to comp of p2
    481452  _pSetComp(p1, _pGetComp(p2));
    482   #ifdef TEST_MAC_ORDER
    483   if (bNoAdd) bSetm(p1);else
    484   #endif
    485453  _pGetOrder(p1) = _pGetOrder(p2) + _pGetOrder(p3);
    486454}
    487455
    488 // Similar to pCopyAddFast, except that we assume that the component
    489 // of p2 and p3 is zero component
     456// Similar to pCopyAddFast, except that we do not care about the "next" field
    490457#if defined(PDEBUG) && PDEBUG == 1
    491 #define _pCopyAddFast1(p1, p2, p3)  pDBCopyAddFast(p1, p2, p3, __FILE__, __LINE__)
     458#define _pCopyAddFast0(p1, p2, p3)  pDBCopyAddFast(p1, p2, p3, __FILE__, __LINE__)
    492459extern  void pDBCopyAddFast(poly p1, poly p2, poly p3, char* f, int l);
    493 inline void __pCopyAddFast1(poly p1, poly p2, poly p3)
    494 #else
    495   DECLARE(void, _pCopyAddFast1(poly p1, poly p2, poly p3))
     460inline void __pCopyAddFast0(poly p1, poly p2, poly p3)
     461#else
     462  DECLARE(void, _pCopyAddFast0(poly p1, poly p2, poly p3))
    496463#endif // defined(PDEBUG) && PDEBUG == 1
    497464{
    498 #ifndef COMP_NO_EXP_VECTOR_OPS
    499465  unsigned long* s1 = (unsigned long*) &(p1->exp[0]);
    500466  const unsigned long* s2 = (unsigned long*) &(p2->exp[0]);
    501467  const unsigned long* s3 = (unsigned long*) &(p3->exp[0]);
    502468  const unsigned long* const ub = s3 + pVariables1W;
    503 #else
    504   Exponent_t* s1 = (Exponent_t*) &(p1->exp[pVarLowIndex]);
    505   const Exponent_t* s2 = (Exponent_t*) &(p2->exp[pVarLowIndex]);
    506   const Exponent_t* s3 = (Exponent_t*) &(p3->exp[pVarLowIndex]);
    507   const Exponent_t* const ub = s3 + pVariables;
    508 #ifdef  WORDS_BIGENDIAN
    509   *((unsigned long *) ((unsigned long*) p1) + pMonomSizeW -1) = 0;
    510 #else
    511   *((unsigned long *) p1->exp) = 0;
    512 #endif
    513 #endif
     469
     470  p1->coef = p2->coef;
    514471
    515472  for (;;)
     
    521478    s2++;
    522479  }
    523   #ifdef TEST_MAC_ORDER
    524   if (bNoAdd) bSetm(p1);else
    525   #endif
     480  _pSetComp(p1, _pGetComp(p2));
    526481  _pGetOrder(p1) = _pGetOrder(p2) + _pGetOrder(p3);
    527482}
    528 
    529 
    530 #ifndef COMP_NO_EXP_VECTOR_OPS
    531483
    532484#if SIZEOF_LONG == 4
     
    579531}
    580532
    581 #else //  ! COMP_NO_EXP_VECTOR_OPS
    582 
    583 DECLARE(BOOLEAN, __pDivisibleBy(poly a, poly b))
    584 {
    585 #ifdef WORDS_BIGENDIAN
    586   const Exponent_t* s1 = &(a->exp[pVarHighIndex]);
    587   const Exponent_t* s2 = &(b->exp[pVarHighIndex]);
    588   const Exponent_t* lb = s1 - pVariables;
    589 
    590   for (;;)
    591   {
    592     if (*s1 > *s2) return FALSE;
    593     s1--;
    594     if (s1 == lb) return TRUE;
    595     s2--;
    596   }
    597 
    598 #else // !WORDS_BIGENDIAN
    599   const Exponent_t* s1 = &(a->exp[pVarLowIndex]);
    600   const Exponent_t* s2 = &(b->exp[pVarLowIndex]);
    601   const Exponent_t* lb = s1 + pVariables;
    602 
    603   for (;;)
    604   {
    605    if (*s1 > *s2) return FALSE;
    606    s1++;
    607    if (s1 == lb) return TRUE;
    608    s2++;
    609   }
    610 #endif  // WORDS_BIGENDIAN
    611 }
    612 
    613 #endif //  COMP_NO_EXP_VECTOR_OPS
    614 
    615533#if defined(PDEBUG) && PDEBUG == 1
    616534#define _pDivisibleBy(a,b)   pDBDivisibleBy(a, b, __FILE__, __LINE__)
     
    651569DECLARE(BOOLEAN, _pEqual(poly p1, poly p2))
    652570{
    653 #ifndef COMP_NO_EXP_VECTOR_OPS
    654571  const long *s1 = (long*) &(p1->exp[0]);
    655572  const long *s2 = (long*) &(p2->exp[0]);
    656573  const long* const lb = s1 + pVariables1W;
    657 #else
    658   const Exponent_t *s1 = (Exponent_t*) &(p1->exp[pVarLowIndex]);
    659   const Exponent_t *s2 = (Exponent_t*) &(p2->exp[pVarLowIndex]);
    660   const Exponent_t* const lb = s1 + pVariables;
    661   if (_pGetComp(p1) != _pGetComp(p2)) return FALSE;
    662 #endif
    663574
    664575  for(;;)
     
    671582}
    672583
    673 inline void _pGetExpV(poly p, Exponent_t *ev)
    674 {
    675   if (_pHasReverseExp)
    676   {
    677     for (int i = pVarLowIndex, j = pVariables; j; i++, j--)
    678       ev[j] = p->exp[i];
    679   }
    680   else
    681     memcpy(&ev[1], &(p->exp[pVarLowIndex]), pVariables*sizeof(Exponent_t));
    682   ev[0] = _pGetComp(p);
    683 }
    684 
    685 extern pSetmProc pSetm;
    686 inline void _pSetExpV(poly p, Exponent_t *ev)
    687 {
    688   if (_pHasReverseExp)
    689   {
    690     for (int i = pVarLowIndex, j = pVariables; j; i++, j--)
    691       p->exp[i] = ev[j];
    692   }
    693   else
    694     memcpy(&(p->exp[pVarLowIndex]), &ev[1], pVariables*sizeof(Exponent_t));
    695   _pSetComp(p, ev[0]);
    696   pSetm(p);
    697 }
    698 
    699 #else // ! COMP_FAST
    700 
    701 DECLARE(BOOLEAN, _pDivisibleBy(poly a, poly b))
    702 {
    703   if ((a!=NULL)&&((a->exp[0]==0) || (a->exp[0] == b->exp[0])))
    704   {
    705     int i=pVariables;
    706     short *e1=&(a->exp[1]);
    707     short *e2=&(b->exp[1]);
    708     if ((*e1) > (*e2)) return FALSE;
    709     do
    710     {
    711       i--;
    712       if (i == 0) return TRUE;
    713       e1++;
    714       e2++;
    715     } while ((*e1) <= (*e2));
    716   }
    717   return FALSE;
    718 }
    719 
    720 #define _pDivisibleBy1(a,b) _pDivisibleBy(a,b)
    721 #define _pDivisibleBy2(a,b) _pDivisibleBy(a,b)
    722 
    723 #ifdef TEST_MAC_ORDER
    724 DECLARE(void, pMonAddFast(poly a, poly m))
    725 {
    726   for(int ii =pVariables; ii; ii--) (a)->exp[ii] += (m)->exp[ii];\
    727   if (bNoAdd) bSetm(a); else
    728   _pGetOrder(a) += _pGetOrder(m);
    729 }
    730 #else
    731 DECLARE(void, pMonAddFast(poly a, poly m))
    732 {
    733   for(int ii =pVariables; ii; ii--) (a)->exp[ii] += (m)->exp[ii];\
    734   _pGetOrder(a) += _pGetOrder(m);
    735 }
    736 #endif
    737 
    738 DECLARE(BOOLEAN, _pEqual(poly p1, poly p2))
    739 {
    740   int i;
    741   short *e1=p1->exp;
    742   short *e2=p2->exp;
    743 
    744   if (p1->Order != p2->Order) return FALSE;
    745   for (i=pVariables; i>=0; i--,e1++,e2++)
    746     if (*e1 != *e2) return FALSE;
    747   return TRUE;
    748 }
    749 
    750 #define _pGetExpV(p,e)    memcpy((e),(p)->exp,(pVariables+1)*sizeof(short));
    751 //void    pSetExpV(poly p, short * exp);
    752 #define _pSetExpV(p,e) {memcpy((p)->exp,(e),(pVariables+1)*sizeof(short));pSetm(p);}
    753 
    754 #endif // COMP_FAST
    755 
    756 /***************************************************************
    757  *
    758  * Routines which implement low-level manipulations/operations on exponents
     584/***************************************************************
     585 *
     586 * Routines which implement low-level manipulations/operations
     587 * on exponents and "are allowed" to access single exponetns
    759588 *
    760589 ***************************************************************/
     
    773602}
    774603
    775 #ifdef COMP_FAST
    776604#define _pExpQuerSum(p)  __pExpQuerSum2(p, pVarLowIndex, pVarHighIndex)
    777605
    778 #define _pExpQuerSum1(p,to) \
    779  (_pHasReverseExp ? \
    780     __pExpQuerSum2(p, _pExpIndex(to), _pExpIndex(1)) : \
     606#define _pExpQuerSum1(p,to)                             \
     607 (_pHasReverseExp ?                                     \
     608    __pExpQuerSum2(p, _pExpIndex(to), _pExpIndex(1)) :  \
    781609    __pExpQuerSum2(p, _pExpIndex(1), _pExpIndex(to)))
    782610
    783 #define _pExpQuerSum2(p,from,to) \
    784  (_pHasReverseExp ? \
    785     __pExpQuerSum2(p, _pExpIndex(to), _pExpIndex(from)) : \
     611#define _pExpQuerSum2(p,from,to)                            \
     612 (_pHasReverseExp ?                                         \
     613    __pExpQuerSum2(p, _pExpIndex(to), _pExpIndex(from)) :   \
    786614    __pExpQuerSum2(p, _pExpIndex(from), _pExpIndex(to)))
    787 #else
    788 
    789 #define _pExpQuerSum(p)             __pExpQuerSum2(p, 1, pVariables)
    790 #define _pExpQuerSum1(p, to)        __pExpQuerSum2(p, 1, to)
    791 #define _pExpQuerSum2(p, from, to)  __pExpQuerSum2(p, from, to)
    792 
    793 #endif
    794 
    795 /***************************************************************
    796  *
    797  * Routines which implement macaulay ordering routines
    798  *
    799  ***************************************************************/
    800 #ifdef TEST_MAC_ORDER
    801 
    802 DECLARE(void, _bSetm0(poly p))
    803 {
    804 
    805   int i=1;
    806   int ord = -INT_MAX;
    807   Exponent_t *ep;
    808 
    809 #ifdef COMP_FAST
    810   if(_pHasReverseExp)
    811   {
    812     ep=&(p->exp[pVarHighIndex]);
    813     int *ip=bBinomials+(*ep); /*_pGetExp(p,1);*/
    814     loop
    815     {
    816       ord += (*ip);
    817       if (i==pVariables) break;
    818       i++;
    819       //ip+=bHighdeg_1+_pGetExp(p,i);
    820       ep--;
    821       ip+=bHighdeg_1+(*ep);
    822     }
    823   }
    824   else
    825   {
    826     ep=&(p->exp[pVarLowIndex]);
    827     int *ip=bBinomials+(*ep); /*_pGetExp(p,1);*/
    828     loop
    829     {
    830       ord += (*ip);
    831       if (i==pVariables) break;
    832       i++;
    833       //ip+=bHighdeg_1+_pGetExp(p,i);
    834       ep++;
    835       ip+=bHighdeg_1+(*ep);
    836     }
    837   }
    838   #ifdef TEST_MAC_DEBUG
    839   p->Order=_pExpQuerSum(p);
    840   p->MOrder=ord;
    841   #else
    842   p->Order=ord;
    843   #endif
    844 #else
    845     int *ip=bBinomials+_pGetExp(p,1);
    846     loop
    847     {
    848       ord += (*ip);
    849       if (i==pVariables) break;
    850       i++;
    851       ip+=bHighdeg_1+_pGetExp(p,i);
    852     }
    853   #ifdef TEST_MAC_DEBUG
    854   p->Order=pTotaldegree(p);
    855   p->MOrder=ord;
    856   #else
    857   p->Order=ord;
    858   #endif
    859 #endif
    860 }
    861 
    862 DECLARE(void, _bSetm(poly p))
    863 {
    864   int ord = _pExpQuerSum(p);
    865 
    866   if (ord<bHighdeg)
    867     _bSetm0(p);
    868   else
    869   {
    870   #ifdef TEST_MAC_DEBUG
    871     p->MOrder=ord;
    872   #endif
    873     p->Order=ord;
    874   }
    875 }
    876 
    877 #ifdef COMP_FAST
    878 // ordering dp,c or c,dp, general case
    879 #if defined(PDEBUG) && PDEBUG == 1
    880 #define pbMonAddFast(p1, p2)  pDBMonAddFast(p1, p2, __FILE__, __LINE__)
    881 extern  void pbDBMonAddFast(poly p1, poly p2, char* f, int l);
    882 inline void _pbMonAddFast(poly p1, poly p2)
    883 #else
    884 #define pbMonAddFast(p1, p2)  _pbMonAddFast(p1, p2)
    885 DECLARE(void, _pbMonAddFast(poly p1, poly p2))
    886 #endif // defined(PDEBUG) && PDEBUG == 1
    887 {
    888   // OK -- this might be the only place where we are kind of quick and
    889   // dirty: the following only works correctly if all exponents are
    890   // positive and the sum of two exponents does not exceed
    891   // EXPONENT_MAX
    892 #ifndef COMP_NO_EXP_VECTOR_OPS
    893   Exponent_t c2 = _pGetComp(p2);
    894   int i = pVariables1W;
    895   unsigned long* s1 = (unsigned long*) &(p1->exp[0]);
    896   const unsigned long* s2 = (unsigned long*) &(p2->exp[0]);
    897   // set comp of p2 temporarily to 0, so that nothing is added to comp of p1
    898   _pSetComp(p2, 0);
    899 #else
    900   int i = pVariables;
    901   Exponent_pt s1 = &(p1->exp[pVarLowIndex]);
    902   Exponent_pt s2 = &(p2->exp[pVarLowIndex]);
    903 #endif
    904 
    905   for (;;)
    906   {
    907     *s1 += *s2;
    908     i--;
    909     if (i==0) break;
    910     s1++;
    911     s2++;
    912   }
    913 #ifndef COMP_NO_EXP_VECTOR_OPS
    914   // reset comp of p2
    915   _pSetComp(p2, c2);
    916 #endif
    917   if ((_pGetOrder(p1)|_pGetOrder(p2))>0) // i.e. overflow of mac order
    918     _pGetOrder(p1) += _pGetOrder(p2);
    919   else
    920     _bSetm(p1);
    921 }
    922 
    923 // ordering dp,c or c,dp, below degree limit
    924 #if defined(PDEBUG) && PDEBUG == 1
    925 #define pbMonAddFast0(p1, p2)  pbDBMonAddFast0(p1, p2, __FILE__, __LINE__)
    926 extern  void pbDBMonAddFast0(poly p1, poly p2, char* f, int l);
    927 inline void _pbMonAddFast0(poly p1, poly p2)
    928 #else
    929   DECLARE(void, pbMonAddFast0(poly p1, poly p2))
    930 #endif // defined(PDEBUG) && PDEBUG == 1
    931 {
    932   // OK -- this might be the only place where we are kind of quick and
    933   // dirty: the following only works correctly if all exponents are
    934   // positive and the sum of two exponents does not exceed
    935   // EXPONENT_MAX
    936 #ifndef COMP_NO_EXP_VECTOR_OPS
    937   Exponent_t c2 = _pGetComp(p2);
    938   int i = pVariables1W;
    939   unsigned long* s1 = (unsigned long*) &(p1->exp[0]);
    940   const unsigned long* s2 = (unsigned long*) &(p2->exp[0]);
    941   // set comp of p2 temporarily to 0, so that nothing is added to comp of p1
    942   _pSetComp(p2, 0);
    943 #else
    944   int i = pVariables;
    945   Exponent_pt s1 = &(p1->exp[pVarLowIndex]);
    946   Exponent_pt s2 = &(p2->exp[pVarLowIndex]);
    947 #endif
    948 
    949   for (;;)
    950   {
    951     *s1 += *s2;
    952     i--;
    953     if (i==0) break;
    954     s1++;
    955     s2++;
    956   }
    957 #ifndef COMP_NO_EXP_VECTOR_OPS
    958   // reset comp of p2
    959   _pSetComp(p2, c2);
    960 #endif
    961   _bSetm0(p1);
    962 }
    963 
    964 // ordering dp,c or c,dp, below degree limit
    965 // Makes p1 a copy of p2 and adds on exponets of p3
    966 #if defined(PDEBUG) && PDEBUG == 1
    967 #define _pbCopyAddFast0(p1, p2, p3)  pDBCopyAddFast(p1, p2, p3, __FILE__, __LINE__)
    968 inline void __pbCopyAddFast0(poly p1, poly p2, poly p3)
    969 #else
    970   DECLARE(void, _pbCopyAddFast0(poly p1, poly p2, poly p3))
    971 #endif // defined(PDEBUG) && PDEBUG == 1
    972 {
    973   p1->next = p2->next;
    974   p1->coef = p2->coef;
    975 
    976 #ifndef COMP_NO_EXP_VECTOR_OPS
    977   unsigned long* s1 = (unsigned long*) &(p1->exp[0]);
    978   const unsigned long* s2 = (unsigned long*) &(p2->exp[0]);
    979   const unsigned long* s3 = (unsigned long*) &(p3->exp[0]);
    980   const unsigned long* const ub = s3 + pVariables1W;
    981 #else
    982   Exponent_t* s1 = (Exponent_t*) &(p1->exp[pVarLowIndex]);
    983   const Exponent_t* s2 = (Exponent_t*) &(p2->exp[pVarLowIndex]);
    984   const Exponent_t* s3 = (Exponent_t*) &(p3->exp[pVarLowIndex]);
    985   const Exponent_t* const ub = s3 + pVariables;
    986 // need to zero the "fill in" slots (i.e., empty exponents)
    987 #ifdef  WORDS_BIGENDIAN
    988   *((unsigned long*) p1 + pMonomSizeW -1) = 0;
    989 #else
    990   *((unsigned long *) p1->exp) = 0;
    991 #endif
    992 #endif
    993 
    994   for (;;)
    995   {
    996     *s1 = *s2 + *s3;
    997     s3++;
    998     if (s3 == ub) break;
    999     s1++;
    1000     s2++;
    1001   }
    1002   // we first are supposed to do a copy from p2 to p1 -- therefore,
    1003   // component of p1 is set to comp of p2
    1004   _pSetComp(p1, _pGetComp(p2));
    1005   _bSetm0(p1);
    1006 }
    1007 
    1008 // Similar to pCopyAddFast, except that we assume that the component
    1009 // of p2 and p3 is zero component
    1010 #if defined(PDEBUG) && PDEBUG == 1
    1011 #define _pbCopyAddFast10(p1, p2, p3)  pbDBCopyAddFast0(p1, p2, p3, __FILE__, __LINE__)
    1012 extern  void pbDBCopyAddFast0(poly p1, poly p2, poly p3, char* f, int l);
    1013 inline void __pbCopyAddFast10(poly p1, poly p2, poly p3)
    1014 #else
    1015   DECLARE(void, _pbCopyAddFast10(poly p1, poly p2, poly p3))
    1016 #endif // defined(PDEBUG) && PDEBUG == 1
    1017 {
    1018   p1->next = p2->next;
    1019   p1->coef = p2->coef;
    1020 
    1021 #ifndef COMP_NO_EXP_VECTOR_OPS
    1022   unsigned long* s1 = (unsigned long*) &(p1->exp[0]);
    1023   const unsigned long* s2 = (unsigned long*) &(p2->exp[0]);
    1024   const unsigned long* s3 = (unsigned long*) &(p3->exp[0]);
    1025   const unsigned long* const ub = s3 + pVariables1W;
    1026 #else
    1027   Exponent_t* s1 = (Exponent_t*) &(p1->exp[pVarLowIndex]);
    1028   const Exponent_t* s2 = (Exponent_t*) &(p2->exp[pVarLowIndex]);
    1029   const Exponent_t* s3 = (Exponent_t*) &(p3->exp[pVarLowIndex]);
    1030   const Exponent_t* const ub = s3 + pVariables;
    1031 #ifdef  WORDS_BIGENDIAN
    1032   *((unsigned long*) p1 + pMonomSizeW -1) = 0;
    1033 #else
    1034   *((unsigned long *) p1->exp) = 0;
    1035 #endif
    1036 #endif
    1037 
    1038   for (;;)
    1039   {
    1040     *s1 = *s2 + *s3;
    1041     s3++;
    1042     if (s3 == ub) break;
    1043     s1++;
    1044     s2++;
    1045   }
    1046   _bSetm0(p1);
    1047 }
    1048 
    1049 #endif
    1050 #endif
    1051 
     615
     616#define COMP_FAST
    1052617#endif // POLYS_IMPL_H
    1053 
  • Singular/polys.cc

    re0fb8d3 rc5f63ab  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.16 1998-03-16 14:56:39 obachman Exp $ */
     4/* $Id: polys.cc,v 1.17 1998-03-18 14:28:50 obachman Exp $ */
    55
    66/*
     
    415415#ifdef COMP_TRADITIONAL
    416416
    417 pCompProc t_pComp0;
    418 
    419417static int t_comp_otCOMPEXP_nwONE(poly p1, poly p2);
    420418static int t_comp_otEXPCOMP_nwONE(poly p1, poly p2);
     
    999997      for (i=indexShift;i<maxSchreyer;i++)
    1000998        SchreyerOrd[i] = pGetComp(nextOrder[i-indexShift]);
    1001 #ifdef COMP_DEBUG     
    1002       pCompOld = t_pComp0;
    1003 #else
    1004999      pCompOld = pComp0;
    1005 #endif     
    10061000      pComp0 = mcompSchrM;
    1007       t_pComp0 = mcompSchrM;
    10081001      pLDegOld = pLDeg;
    10091002      pLDeg = ldegSchrM;
     
    10171010      maxSchreyer = 0;
    10181011      indexShift = 0;
    1019 #ifdef COMP_DEBUG
    1020       pComp0 = debug_comp;
    1021 #else
    10221012      pComp0 = pCompOld;
    1023 #endif     
    1024       t_pComp0 = pCompOld;
    10251013      pLDeg = pLDegOld;
    10261014    }
     
    10521040    if (maxBound==0)
    10531041    {
    1054 #ifdef COMP_DEBUG
    1055       pCompOld = t_pComp0;
    1056       pComp0 = mcompSyz;
    1057       t_pComp0 = mcompSyz;
    1058 #else
    10591042      pCompOld = pComp0;
    10601043      pComp0 = mcompSyz;
    1061       t_pComp0 = mcompSyz;
    1062 #endif
    10631044    }
    10641045    maxBound = k;
     
    10681049    if (maxBound!=0)
    10691050    {
    1070 #ifdef COMP_DEBUG
    1071       pComp0 = debug_comp;
    1072 #else
    10731051      pComp0 = pCompOld;
    1074 #endif     
    1075       t_pComp0 = pCompOld;
    10761052      maxBound = 0;
    10771053    }
     
    12941270#endif 
    12951271{
    1296 #ifdef COMP_TRADITIONAL
    1297   if (pVariables <= 1)
    1298   {
    1299     t_pComp0 = t_comp_otEXPCOMP_nwONE;
    1300   }
    1301   else
    1302   {
    1303     switch(o_r)
    1304     {
    1305         case ringorder_lp:
    1306         case ringorder_Dp:
    1307         case ringorder_Wp:
    1308         case ringorder_Ds:
    1309         case ringorder_Ws:
    1310         case ringorder_ls:
    1311           t_pComp0 = t_comp_otEXPCOMP_lex_i;
    1312           pLexSgn = 1;
    1313           break;
    1314 
    1315 #ifdef PDEBUG
    1316         case ringorder_unspec:
    1317         case ringorder_dp:
    1318         case ringorder_wp:
    1319         case ringorder_ds:
    1320         case ringorder_ws:
    1321 #else
    1322         default:
    1323 #endif     
    1324           t_pComp0 = t_comp_otEXPCOMP_revlex_i;
    1325           pLexSgn = -1;
    1326           break;
    1327 #ifdef PDEBUG
    1328         default:
    1329           Werror("wrong internal ordering:%d at %s, l:%d\n",o_r,__FILE__,__LINE__);
    1330 #endif
    1331     }
    1332   }
    1333   if (o_r == ringorder_lp || o_r == ringorder_ls)
    1334   {
    1335       pLexOrder=TRUE;
    1336       pFDeg = pTotaldegree;
    1337       pLDeg = ldeg1c;
    1338       if (o_r == ringorder_ls) pLexSgn = -1;
    1339   }
    1340  
    1341   *p = t_pComp0;
    1342 #endif
    13431272#ifdef COMP_FAST
    13441273  switch(o_r)
     
    14271356#endif // COMP_FAST 
    14281357
    1429 #ifdef COMP_DEBUG
    1430     *p = debug_comp;
    1431 #endif 
    14321358}
    14331359
     
    14851411#endif 
    14861412{
    1487 #ifdef COMP_TRADITIONAL
    1488   if (pVariables <= 1)
    1489   {
    1490     t_pComp0 = t_comp_otCOMPEXP_nwONE;
    1491   }
    1492   else
    1493   {
    1494     switch(o_r)
    1495     {
    1496         case ringorder_lp:
    1497         case ringorder_Dp:
    1498         case ringorder_Wp:
    1499         case ringorder_Ds:
    1500         case ringorder_Ws:
    1501         case ringorder_ls:
    1502           t_pComp0 = t_comp_lex_otCOMPEXP_i;
    1503           pLexSgn = 1;
    1504           break;
    1505 
    1506 #ifdef PDEBUG
    1507         case ringorder_unspec:
    1508         case ringorder_dp:
    1509         case ringorder_wp:
    1510         case ringorder_ds:
    1511         case ringorder_ws:
    1512 #else
    1513         default:
    1514 #endif     
    1515           t_pComp0 = t_comp_revlex_otCOMPEXP_i;
    1516           pLexSgn = -1;
    1517           break;
    1518 #ifdef PDEBUG
    1519         default:
    1520           Werror("wrong internal ordering:%d at %s, l:%d\n",o_r,__FILE__,__LINE__);
    1521 #endif
    1522     }
    1523   }
    1524   if (o_r == ringorder_lp || o_r == ringorder_ls)
    1525   {
    1526       pLexOrder=TRUE;
    1527       pFDeg = pTotaldegree;
    1528       pLDeg = ldeg1c;
    1529       if (o_r == ringorder_ls) pLexSgn = -1;
    1530   }
    1531  
    1532   *p = t_pComp0;
    1533 #endif
    15341413#ifdef COMP_FAST
    15351414  switch(o_r)
     
    19501829  pAltVars=r->N+1;
    19511830#endif
    1952   t_pComp0 = NULL;
    19531831#ifdef COMP_FAST
    19541832  f_pComp0 = NULL;
     
    20771955    test &= ~Sy_bit(OPT_REDTAIL); /* noredTail */
    20781956  }
    2079 #ifdef COMP_TRADITIONAL 
    2080   if (t_pComp0 == NULL)
    2081     t_pComp0 = pComp0;
    2082 #endif
    20831957
    20841958#ifdef COMP_FAST
     
    31242998}
    31252999
    3126 #ifdef COMP_DEBUG
    3127 static int debug_comp(poly p1, poly p2)
    3128 {
    3129   int t_d = t_pComp0(p1, p2);
    3130   int f_d = f_pComp0(p1, p2);
    3131 
    3132   if (t_d != f_d)
    3133   {
    3134     fprintf(stderr, "Error in comp1lpc\n");
    3135     t_pComp0(p1, p2);
    3136     f_pComp0(p1, p2);
    3137   }
    3138   return t_d;
    3139 }
    3140 #endif
    31413000
    31423001#ifdef COMP_STATISTICS
  • Singular/polys.h

    re0fb8d3 rc5f63ab  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys.h,v 1.9 1998-01-17 18:08:00 Singular Exp $ */
     6/* $Id: polys.h,v 1.10 1998-03-18 14:28:52 obachman Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate polynomials
     
    186186
    187187
     188// Adds exponents of p2 to exponents of p1; updates Order field
     189// assumes that exponents > 0 and < MAX_EXPONENT / 2
     190#define pMonAddFast(p1, p2) _pMonAddFast(p1, p2)
    188191// Is equivalent to pCopy2(p1, p2);pMonAddFast(p1, p3);
    189192#define pCopyAddFast(p1, p2, p3)    _pCopyAddFast(p1, p2, p3)
    190 #define pbCopyAddFast(p1, p2, p3)   _pbCopyAddFast(p1, p2, p3)
    191 #define pbCopyAddFast0(p1, p2, p3)  _pbCopyAddFast0(p1, p2, p3)
    192 // Similar to pCopyAddFast, except that components of p2, and p3 must be 0
    193 #define pCopyAddFast1(p1, p2, p3)    _pCopyAddFast1(p1, p2, p3)
     193// Similar to pCopyAddFast, except that we do not care about the next field
     194#define pCopyAddFast0(p1, p2, p3)  _pCopyAddFast0(p1, p2, p3)
    194195
    195196poly      pmInit(char *s, BOOLEAN &ok);   /* monom -> poly */
     
    209210#define pEqual(p1, p2) _pEqual(p1, p2)
    210211
    211 // returns TRUE, if leading monom of a is dividble be leading monom of b
    212 #if defined(macintosh) || defined(DIV_COUNT)
     212// returns TRUE, if leading monom of a divides leading monom of b
     213// i.e., if there exists a expvector c > 0, s.t. b = a + c
     214#if defined(macintosh)
    213215BOOLEAN   pDivisibleBy(poly a, poly b);
    214216#else
     
    217219// like pDivisibleBy, except that it is assumed that a!=NULL
    218220#define pDivisibleBy1(a,b)   _pDivisibleBy1(a,b)
    219 // returns TRUE, if leading monom of a is dividble be leading monom of b
    220 // assumes a != NULL, b != NULL, and does not check components
     221// like pDivisibleBy, assumes a != NULL, does not check components
    221222#define pDivisibleBy2(a, b) _pDivisibleBy2(a,b)
    222223
  • Singular/ring.cc

    re0fb8d3 rc5f63ab  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.16 1998-03-16 14:56:40 obachman Exp $ */
     4/* $Id: ring.cc,v 1.17 1998-03-18 14:28:52 obachman Exp $ */
    55
    66/*
     
    665665#ifdef COMP_FAST
    666666// set those fields of the ring, which can be computed from other fields:
    667 // More particularly, set:
    668 // r->VarOffset, r->CompIndex
     667// More particularly, sets r->VarOffset
    669668
    670669void rComplete(ring r)
    671670{
    672   int dummy, VarOffset, CompIndex;
    673   pGetVarIndicies(r, VarOffset, CompIndex, dummy, dummy);
     671  int dummy, VarOffset;
     672  pGetVarIndicies(r, VarOffset, dummy, dummy);
    674673  r->VarOffset = (short) VarOffset;
    675   r->CompIndex = (short) CompIndex;
    676674}
    677675#endif
  • Singular/spolys.cc

    re0fb8d3 rc5f63ab  
    614614    pSetm(m1);
    615615    pSetm(m2);
    616     cm = t_pComp0(m1, m2);
     616    cm = pComp0(m1, m2);
    617617    if (cm!=0)
    618618    {
  • Singular/spolys0.cc

    re0fb8d3 rc5f63ab  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: spolys0.cc,v 1.9 1998-03-16 14:56:46 obachman Exp $ */
     4/* $Id: spolys0.cc,v 1.10 1998-03-18 14:28:54 obachman Exp $ */
    55
    66/*
     
    797797    pSetm(m1);
    798798    pSetm(m2);
    799     cm = t_pComp0(m1, m2);
     799    cm = pComp0(m1, m2);
    800800    if (cm!=0)
    801801    {
Note: See TracChangeset for help on using the changeset viewer.