Changeset 585bbcb in git for kernel/polys.cc
- Timestamp:
- Nov 27, 2005, 4:28:46 PM (17 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 6a972af1108afd9ad6a0a74a519e0b3107421d16
- Parents:
- f498f1081627c853c4d77077fcaa2ea32d82a711
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/polys.cc
rf498f10 r585bbcb 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1. 6 2005-04-21 17:15:49 SingularExp $ */4 /* $Id: polys.cc,v 1.7 2005-11-27 15:28:45 wienand Exp $ */ 5 5 6 6 /* … … 651 651 } 652 652 653 #ifdef HAVE_RING2TOM 654 number nGetUnit(number k) { 655 long test = (long) k; 656 while (test%2 == 0) { 657 test = test / 2; 658 } 659 return (number) test; 660 } 661 #endif 653 662 654 663 /*2 … … 659 668 poly h; 660 669 number k, c; 661 670 #ifdef HAVE_RING2TOM 671 if (currRing->cring != 0) 672 { 673 if (p1!=NULL) 674 { 675 k = nGetUnit(pGetCoeff(p1)); 676 if (!nIsOne(k)) 677 { 678 k = nGetUnit(pGetCoeff(p1)); 679 c = nDiv(pGetCoeff(p1), k); 680 pSetCoeff0(p1, c); 681 h = pNext(p1); 682 while (h != NULL) 683 { 684 c = nDiv(pGetCoeff(h), k); 685 pSetCoeff(h, c); 686 pIter(h); 687 } 688 nDelete(&k); 689 } 690 return; 691 } 692 } 693 #endif 662 694 if (p1!=NULL) 663 695 { … … 670 702 { 671 703 nNormalize(pGetCoeff(p1)); 672 k =pGetCoeff(p1);704 k = pGetCoeff(p1); 673 705 c = nInit(1); 674 706 pSetCoeff0(p1,c); … … 701 733 *normalize all coefficients 702 734 */ 703 void p_Normalize(poly p, ring r) 735 void p_Normalize(poly p, ring r) 704 736 { 705 737 if (rField_has_simple_inverse(r)) return; /* Z/p, GF(p,n), R, long R/C */
Note: See TracChangeset
for help on using the changeset viewer.