Changeset efdb6d in git for Singular/sparsmat.cc
- Timestamp:
- Sep 21, 2000, 1:15:31 PM (24 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
- Children:
- 0611df5339938d0d0a483d83a0840bc73695c38f
- Parents:
- 822fc78417de82c543b235478d77e1cd5e3a4bf3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/sparsmat.cc
r822fc7 refdb6d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sparsmat.cc,v 1.3 8 2000-09-19 12:18:34pohl Exp $ */4 /* $Id: sparsmat.cc,v 1.39 2000-09-21 11:15:31 pohl Exp $ */ 5 5 6 6 /* … … 38 38 static void smExactPolyDiv(poly, poly); 39 39 static BOOLEAN smIsNegQuot(poly, const poly, const poly); 40 static poly smEMult(poly, const poly);41 40 static BOOLEAN smCheckLead(const poly, const poly); 42 static poly sm DMult(poly, const poly);43 static void sm Complete(poly, const poly, const poly);41 static poly smSelectCopy(poly, const poly); 42 static void smExpMultDiv(poly, const poly, const poly); 44 43 static void smPolyDivN(poly, const number); 45 44 static BOOLEAN smSmaller(poly, poly); … … 1695 1694 return ppMult_nn(a, pGetCoeff(b)); 1696 1695 else 1697 return smEMult(a, b);1698 } 1699 pa = res = smEMult(a, b);1696 return ppMult_mm(a, b); 1697 } 1698 pa = res = ppMult_mm(a, b); 1700 1699 pIter(b); 1701 1700 do 1702 1701 { 1703 r = smEMult(a, b);1702 r = ppMult_mm(a, b); 1704 1703 smCombineChain(&pa, r); 1705 1704 pIter(b); … … 1786 1785 return ppMult_nn(a, pGetCoeff(b)); 1787 1786 else 1788 return smEMult(a, b);1789 } 1790 pa = res = smEMult(a, b);1787 return ppMult_mm(a, b); 1788 } 1789 pa = res = ppMult_mm(a, b); 1791 1790 pIter(b); 1792 1791 do 1793 1792 { 1794 r = smEMult(a, b);1793 r = ppMult_mm(a, b); 1795 1794 smCombineChain(&pa, r); 1796 1795 pIter(b); … … 1807 1806 { 1808 1807 lead = smCheckLead(a, e); 1809 r = sm DMult(a, e);1810 sm Complete(r, b, c);1808 r = smSelectCopy(a, e); 1809 smExpMultDiv(r, b, c); 1811 1810 } 1812 1811 else 1813 1812 { 1814 1813 lead = TRUE; 1815 r = smEMult(a, e);1814 r = ppMult_mm(a, e); 1816 1815 } 1817 1816 if (lead) … … 1842 1841 if (smIsNegQuot(e, b, c)) 1843 1842 { 1844 r = sm DMult(a, e);1845 sm Complete(r, b, c);1843 r = smSelectCopy(a, e); 1844 smExpMultDiv(r, b, c); 1846 1845 if (smCheckLead(a, e)) 1847 1846 smCombineChain(&pa, r); … … 1851 1850 else 1852 1851 { 1853 r = smEMult(a, e);1852 r = ppMult_mm(a, e); 1854 1853 smCombineChain(&pa, r); 1855 1854 } … … 1892 1891 if (smIsNegQuot(e, a, b)) 1893 1892 { 1894 h = sm DMult(tail, e);1895 sm Complete(h, a, b);1893 h = smSelectCopy(tail, e); 1894 smExpMultDiv(h, a, b); 1896 1895 } 1897 1896 else 1898 h = smEMult(tail, e);1897 h = ppMult_mm(tail, e); 1899 1898 nDelete(&yn); 1900 1899 a = pNext(a) = pAdd(pNext(a), h); … … 1925 1924 pSetExp(a,i, pGetExp(b,i)-pGetExp(c,i)); 1926 1925 } 1926 pSetm(a); 1927 1927 return FALSE; 1928 }1929 }1930 1931 static poly smEMult(poly t, const poly e)1932 {1933 const number y = pGetCoeff(e);1934 poly res, h;1935 int i;1936 1937 h = res = pNew();1938 loop1939 {1940 pExpVectorCopy(h,t);1941 for (i=pVariables; i; i--)1942 pAddExp(h,i,pGetExp(e,i));1943 pSetm(h);1944 pSetCoeff0(h,nMult(y,pGetCoeff(t)));1945 pIter(t);1946 if (t == NULL)1947 {1948 pNext(h) = NULL;1949 return res;1950 }1951 h = pNext(h) = pNew();1952 1928 } 1953 1929 } … … 1966 1942 } 1967 1943 1968 static poly sm DMult(poly t, const poly e)1944 static poly smSelectCopy(poly t, const poly e) 1969 1945 { 1970 1946 const number y = pGetCoeff(e); … … 1996 1972 } 1997 1973 1998 static void sm Complete(poly t, const poly b, const poly c)1974 static void smExpMultDiv(poly t, const poly b, const poly c) 1999 1975 { 2000 1976 int i; 2001 1977 while(t!=NULL) 2002 1978 { 2003 for (i=pVariables; i; i--) 2004 { 2005 pAddExp(t,i,pGetExp(b,i)); 2006 pSubExp(t,i,pGetExp(c,i)); 2007 } 2008 pSetm(t); 1979 pExpVectorAdd(t,b); 1980 pExpVectorSub(t,c); 2009 1981 pIter(t); 2010 1982 }
Note: See TracChangeset
for help on using the changeset viewer.