Changeset af598e in git for libpolys/polys/simpleideals.cc
- Timestamp:
- May 4, 2011, 7:50:23 PM (13 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 107b6a63f83a561264dff51b21ba9a08c2b381f8
- Parents:
- 02c42db0b19db524ec869930bffc30346b16abed
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-05-04 19:50:23+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:35+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/simpleideals.cc
r02c42d raf598e 11 11 #include "config.h" 12 12 #include <misc/auxiliary.h> 13 14 #include <omalloc/omalloc.h> 15 13 16 #include <misc/options.h> 14 #include <omalloc/omalloc.h>15 #include <polys/monomials/p_polys.h>16 #include <polys/weight.h>17 #include <polys/matpol.h>18 17 #include <misc/intvec.h> 19 #include <polys/simpleideals.h> 18 19 #include <coeffs/longrat.h> 20 21 #include "monomials/p_polys.h" 22 #include "weight.h" 23 #include "matpol.h" 24 #include "simpleideals.h" 20 25 #include "sbuckets.h" 21 26 … … 1664 1669 1665 1670 #ifdef HAVE_FACTORY 1671 #if 0 1666 1672 poly id_GCD(poly f, poly g, const ring r) 1667 1673 { … … 1670 1676 ideal I=idInit(2,1); I->m[0]=f; I->m[1]=g; 1671 1677 intvec *w = NULL; 1678 1672 1679 ideal S=idSyzygies(I,testHomog,&w); 1680 1673 1681 if (w!=NULL) delete w; 1674 1682 poly gg=pTakeOutComp(&(S->m[0]),2); … … 1680 1688 } 1681 1689 #endif 1690 #endif 1682 1691 1683 1692 /*2 … … 1689 1698 */ 1690 1699 #ifdef HAVE_FACTORY 1691 ideal id ChineseRemainder(ideal *xx, number *q, int rl, const ring r)1700 ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring R) 1692 1701 { 1693 1702 int cnt=IDELEMS(xx[0])*xx[0]->nrows; … … 1708 1717 h=xx[j]->m[i]; 1709 1718 if ((h!=NULL) 1710 &&((r==NULL)||(p LmCmp(r,h)==-1)))1719 &&((r==NULL)||(p_LmCmp(r,h,R)==-1))) 1711 1720 r=h; 1712 1721 } 1713 1722 if (r==NULL) break; 1714 h=p Head(r);1723 h=p_Head(r, R); 1715 1724 for(j=rl-1;j>=0;j--) 1716 1725 { 1717 1726 hh=xx[j]->m[i]; 1718 if ((hh!=NULL) && (p LmCmp(r,hh)==0))1727 if ((hh!=NULL) && (p_LmCmp(r,hh, R)==0)) 1719 1728 { 1720 x[j]=p GetCoeff(hh);1721 hh=p LmFreeAndNext(hh);1729 x[j]=p_GetCoeff(hh, R); 1730 hh=p_LmFreeAndNext(hh, R); 1722 1731 xx[j]->m[i]=hh; 1723 1732 } 1724 1733 else 1725 x[j]=nlInit(0, r); 1726 } 1727 number n=nlChineseRemainder(x,q,rl); 1734 x[j]=nlInit(0, R->cf); // is R->cf really n_Q??? 1735 } 1736 1737 number n=nlChineseRemainder(x,q,rl); // kernel/clapconv.cc 1738 1728 1739 for(j=rl-1;j>=0;j--) 1729 1740 { 1730 1741 x[j]=NULL; // nlInit(0...) takes no memory 1731 1742 } 1732 if (nlIsZero(n )) pDelete(&h);1743 if (nlIsZero(n, R->cf)) p_Delete(&h, R); 1733 1744 else 1734 1745 { 1735 p SetCoeff(h,n);1746 p_SetCoeff(h,n, R); 1736 1747 //Print("new mon:");pWrite(h); 1737 res_p=p Add(res_p,h);1748 res_p=p_Add_q(res_p, h, R); 1738 1749 } 1739 1750 } … … 1741 1752 } 1742 1753 omFree(x); 1743 for(i=rl-1;i>=0;i--) id Delete(&(xx[i]));1754 for(i=rl-1;i>=0;i--) id_Delete(&(xx[i]), R); 1744 1755 omFree(xx); 1745 1756 return result;
Note: See TracChangeset
for help on using the changeset viewer.