Changeset f92fa13 in git for Singular/polys-impl.h


Ignore:
Timestamp:
Mar 16, 1998, 3:56:48 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5c8eae0ee4adf297d4ee70c4eb367499625899d8
Parents:
057fd3b14dfe97c1070a5e6e9ea465fb317ae57f
Message:
1998-03-16  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* polys-impl.h: #define COMP_FAST

	* configure.in,Makefile.in: check for flex -P; increased version
	number to 1.1.7

1998-03-04  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* febase.h: added macro assume()

	* spSpolyLoop.cc: Automatic generation of SpolyLoops using
	spSpolyLoop.pl

	* kstd*.cc: New calling interface to get SpolyLoop

	* ring.h: Introduced rOrderType_t


git-svn-id: file:///usr/local/Singular/svn/trunk@1236 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/polys-impl.h

    r057fd3 rf92fa13  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-impl.h,v 1.17 1998-01-28 22:11:22 Singular Exp $ */
     6/* $Id: polys-impl.h,v 1.18 1998-03-16 14:56:38 obachman Exp $ */
    77
    88/***************************************************************
     
    7474    monomial operations, i.e. does everything exponent-wise.
    7575 ***************************************************************/
    76 // #define COMP_FAST
     76#define COMP_FAST
    7777// #define COMP_DEBUG
    7878// #define COMP_NO_EXP_VECTOR_OPS
     
    400400#else
    401401#define _pNew()         (poly) mmAllocSpecialized()
    402 #endif
    403402// #define _pNew() _pInit()
     403#endif
    404404
    405405#include <string.h>
     
    624624DECLARE(BOOLEAN, __pDivisibleBy(poly a, poly b))
    625625{
    626   const unsigned long* s1;
    627   const unsigned long* s2;
    628   const unsigned long* lb;
    629 
    630626#ifdef WORDS_BIGENDIAN
    631   lb = (unsigned long*) &(a->exp[0]);
    632   if (pVariables & ((SIZEOF_LONG / SIZEOF_EXPONENT) - 1))
    633   {
    634     // now pVariables == pVariables1W, i.e. there are exponents in the
    635     // "first" word of exponentvector
    636     s1 = ((unsigned long*) a) + pMonomSizeW -1;
    637     s2 = ((unsigned long*) b) + pMonomSizeW -1;
    638   }
    639   else
    640   {
    641     // first exponent word has only component as significant field --
    642     // Hence, do not bother
    643     s1 = ((unsigned long*) a) + pMonomSizeW -2;
    644     s2 = ((unsigned long*) b) + pMonomSizeW -2;
    645   }
    646 #else // !WORDS_BIGENDIAN
    647   lb = ((unsigned long*) a) + pMonomSizeW;
    648   if (pVariables & ((SIZEOF_LONG / SIZEOF_EXPONENT) - 1))
    649   {
    650     s1 = (unsigned long*) &(a->exp[0]);
    651     s2 = (unsigned long*) &(b->exp[0]);
    652   }
    653   else
    654   {
    655     s1 = (unsigned long*) &(a->exp[0]) + 1;
    656     s2 = (unsigned long*) &(b->exp[0]) + 1;
    657   }
    658 #endif
     627  const unsigned long* const lb = (unsigned long*) &(a->exp[0]);;
     628  const unsigned long* s1 = ((unsigned long*) a) + pMonomSizeW -1;
     629  const unsigned long* s2 = ((unsigned long*) b) + pMonomSizeW -1;
     630#else
     631  const unsigned long* const lb = ((unsigned long*) a) + pMonomSizeW;
     632  const unsigned long* s1 = (unsigned long*) &(a->exp[0]);
     633  const unsigned long* s2 = (unsigned long*) &(b->exp[0]);
     634#endif
     635 
    659636  for (;;)
    660637  {
    661 // O.K. -- and now comes a bit of magic. The following _really_
    662 // works. Think about it! If you can prove it, please tell me, for I
    663 // did not bother to prove it formally (Hint: We can assume that our
    664 // exponents are always positive).
     638    // Yes, the following is correct, provided that the exponents do
     639    // not have their first bit set
    665640    if ((*s2 - *s1) & P_DIV_MASK) return FALSE;
    666641#ifdef WORDS_BIGENDIAN
Note: See TracChangeset for help on using the changeset viewer.