Changeset e9989f in git
- Timestamp:
- Aug 12, 2015, 2:13:42 PM (8 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 9a124249fa498488e7fe6c086eea551c001e016f
- Parents:
- 7507543ae55ceb8b299a44ac7f671d67fa837d45
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r750754 re9989f 1828 1828 else 1829 1829 { 1830 xx=(number *)omAlloc(rl*sizeof(number));1831 1830 if (nMap==NULL) 1832 1831 { … … 1834 1833 return TRUE; 1835 1834 } 1835 xx=(number *)omAlloc(rl*sizeof(number)); 1836 1836 for(i=rl-1;i>=0;i--) 1837 1837 { … … 1898 1898 // deletes also x 1899 1899 c->Clean(); 1900 if ( return_type==POLY_CMD)1900 if ((return_type==POLY_CMD) &&(result!=NULL)) 1901 1901 { 1902 1902 res->data=(char *)result->m[0]; … … 1913 1913 omFree(q); 1914 1914 res->rtyp=return_type; 1915 return FALSE;1915 return result==NULL; 1916 1916 } 1917 1917 static BOOLEAN jjCOEF(leftv res, leftv u, leftv v) -
libpolys/polys/simpleideals.cc
r750754 re9989f 1721 1721 ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r) 1722 1722 { 1723 int cnt=IDELEMS(xx[0])*xx[0]->nrows; 1723 int cnt=0;int rw=0; int cl=0; 1724 int i,j; 1725 // find max. size of xx[.]: 1726 for(j=rl-1;j>=0;j--) 1727 { 1728 i=IDELEMS(xx[j])*xx[j]->nrows; 1729 if (i>cnt) cnt=i; 1730 if (xx[j]->nrows >rw) rw=xx[j]->nrows; // for lifting matrices 1731 if (xx[j]->ncols >cl) cl=xx[j]->ncols; // for lifting matrices 1732 } 1733 if (rw*cl !=cnt) 1734 { 1735 WerrorS("format mismatch in CRT"); 1736 return NULL; 1737 } 1724 1738 ideal result=idInit(cnt,xx[0]->rank); 1725 result->nrows=xx[0]->nrows; // for lifting matrices 1726 result->ncols=xx[0]->ncols; // for lifting matrices 1727 int i,j; 1739 result->nrows=rw; // for lifting matrices 1740 result->ncols=cl; // for lifting matrices 1728 1741 number *x=(number *)omAlloc(rl*sizeof(number)); 1729 1742 poly *p=(poly *)omAlloc(rl*sizeof(poly)); 1730 CFArray inv_cache(rl); ;1743 CFArray inv_cache(rl); 1731 1744 for(i=cnt-1;i>=0;i--) 1732 1745 { 1733 1746 for(j=rl-1;j>=0;j--) 1734 1747 { 1735 p[j]=xx[j]->m[i]; 1748 if(i>=IDELEMS(xx[j])*xx[j]->nrows) // out of range of this ideal 1749 p[j]=NULL; 1750 else 1751 p[j]=xx[j]->m[i]; 1736 1752 } 1737 1753 result->m[i]=p_ChineseRemainder(p,x,q,rl,inv_cache,r); 1738 1754 for(j=rl-1;j>=0;j--) 1739 1755 { 1740 xx[j]->m[i]=p[j];1756 if(i<IDELEMS(xx[j])*xx[j]->nrows) xx[j]->m[i]=p[j]; 1741 1757 } 1742 1758 }
Note: See TracChangeset
for help on using the changeset viewer.