Changeset f92fa13 in git for Singular/polys-impl.h
- Timestamp:
- Mar 16, 1998, 3:56:48 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 5c8eae0ee4adf297d4ee70c4eb367499625899d8
- Parents:
- 057fd3b14dfe97c1070a5e6e9ea465fb317ae57f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/polys-impl.h
r057fd3 rf92fa13 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-impl.h,v 1.1 7 1998-01-28 22:11:22 SingularExp $ */6 /* $Id: polys-impl.h,v 1.18 1998-03-16 14:56:38 obachman Exp $ */ 7 7 8 8 /*************************************************************** … … 74 74 monomial operations, i.e. does everything exponent-wise. 75 75 ***************************************************************/ 76 //#define COMP_FAST76 #define COMP_FAST 77 77 // #define COMP_DEBUG 78 78 // #define COMP_NO_EXP_VECTOR_OPS … … 400 400 #else 401 401 #define _pNew() (poly) mmAllocSpecialized() 402 #endif403 402 // #define _pNew() _pInit() 403 #endif 404 404 405 405 #include <string.h> … … 624 624 DECLARE(BOOLEAN, __pDivisibleBy(poly a, poly b)) 625 625 { 626 const unsigned long* s1;627 const unsigned long* s2;628 const unsigned long* lb;629 630 626 #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 659 636 for (;;) 660 637 { 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 665 640 if ((*s2 - *s1) & P_DIV_MASK) return FALSE; 666 641 #ifdef WORDS_BIGENDIAN
Note: See TracChangeset
for help on using the changeset viewer.