Changeset 1e579c6 in git for kernel/polys.cc
 Timestamp:
 Jun 20, 2007, 11:39:25 AM (16 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 07e8ae3b1877436cb95506c90d799438d558c703
 Parents:
 f7aaec31bd73e9e5b3b2bd84ee5ff4fab2de4691
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/polys.cc
rf7aaec3 r1e579c6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1. 19 20070523 07:47:30wienand Exp $ */4 /* $Id: polys.cc,v 1.20 20070620 09:39:24 wienand Exp $ */ 5 5 6 6 /* … … 689 689 } 690 690 691 #ifdef HAVE_RINGS //HACK TODO Oliver692 number nGetUnit(number k) {693 number unit = nIntDiv(k, nGcd(k, 0, currRing));694 number gcd = nGcd(unit, 0, currRing);695 if (!nIsOne(gcd))696 {697 number tmp = nMult(unit, unit);698 number gcd_new = nGcd(tmp, 0, currRing);699 while (gcd_new != gcd)700 {701 gcd = gcd_new;702 tmp = nMult(tmp, unit);703 gcd_new = nGcd(tmp, 0, currRing);704 }705 unit = nAdd(unit, nIntDiv(0, gcd_new));706 }707 // Print("k = %d ; unit = %d ; gcd = %d", k, unit, gcd);708 return unit;709 }710 #endif711 712 691 /*2 713 692 *divides p1 by its leading coefficient … … 720 699 if (rField_is_Ring(currRing)) 721 700 { 722 if ( p1!=NULL)701 if ((p1!=NULL) && rField_has_Units(currRing)) 723 702 { 724 703 k = nGetUnit(pGetCoeff(p1)); … … 726 705 { 727 706 c = nDiv(pGetCoeff(p1), k); 707 nDelete(pGetCoeff(p1)); 728 708 pSetCoeff0(p1, c); 729 709 h = pNext(p1); … … 731 711 { 732 712 c = nDiv(pGetCoeff(h), k); 733 pSetCoeff(h, c); 713 nDelete(pGetCoeff(h)); 714 pSetCoeff0(h, c); 734 715 pIter(h); 735 716 } 736 nDelete(&k);737 }738 return;739 }717 } 718 nDelete(&k); 719 } 720 return; 740 721 } 741 722 else
Note: See TracChangeset
for help on using the changeset viewer.