Changeset c98410 in git
- Timestamp:
- Mar 7, 2002, 7:32:10 PM (21 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- ede4b1438e7649ee4804381c07689bd711015cf2
- Parents:
- 6eb633d64f25992a02dea1e0cd0a21e4cf71a100
- Location:
- Singular
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ideals.cc
r6eb633d rc98410 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.12 8 2002-03-07 16:00:58mschulze Exp $ */4 /* $Id: ideals.cc,v 1.129 2002-03-07 18:32:09 mschulze Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 1886 1886 1887 1887 /*2 1888 *computes division of P by Q with remainder up to weighteddegree n1888 *computes division of P by Q with remainder up to (w-weighted) degree n 1889 1889 *P, Q, and w are not changed 1890 1890 */ 1891 lists idLiftW(ideal P, ideal Q, int n, short *w)1891 lists idLiftW(ideal P,ideal Q,int n,short *w=NULL) 1892 1892 { 1893 1893 int N=0; 1894 1894 int i; 1895 1895 for(i=IDELEMS(Q)-1;i>=0;i--) 1896 N=max(N,pDegW(Q->m[i],w)); 1896 if(w==NULL) 1897 N=max(N,pDeg(Q->m[i])); 1898 else 1899 N=max(N,pDegW(Q->m[i],w)); 1897 1900 N+=n; 1898 1901 … … 1902 1905 for(i=IDELEMS(P)-1;i>=0;i--) 1903 1906 { 1904 poly p=ppJetW(P->m[i],N,w); 1907 poly p; 1908 if(w==NULL) 1909 p=ppJet(P->m[i],N); 1910 else 1911 p=ppJetW(P->m[i],N,w); 1905 1912 1906 1913 int j=IDELEMS(Q)-1; … … 1910 1917 { 1911 1918 poly p0=pDivideM(pHead(p),pHead(Q->m[j])); 1912 p=pJetW(pSub(p,ppMult_mm(Q->m[j],p0)),N,w); 1919 if(w==NULL) 1920 p=pJet(pSub(p,ppMult_mm(Q->m[j],p0)),N); 1921 else 1922 p=pJetW(pSub(p,ppMult_mm(Q->m[j],p0)),N,w); 1913 1923 pNormalize(p); 1914 if( pDegW(p0,w)>n)1924 if(w==NULL&&pDeg(p0)>n||w!=NULL&&pDegW(p0,w)>n) 1915 1925 pDelete(&p0); 1916 1926 else … … 1925 1935 pIter(p); 1926 1936 pNext(p0)=NULL; 1927 if( pDegW(p0,w)>n)1937 if(w==NULL&&pDeg(p0)>n||w!=NULL&&pDegW(p0,w)>n) 1928 1938 pDelete(&p0); 1929 1939 else -
Singular/ideals.h
r6eb633d rc98410 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ideals.h,v 1.3 7 2002-02-28 17:56:33mschulze Exp $ */6 /* $Id: ideals.h,v 1.38 2002-03-07 18:32:10 mschulze Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate ideals … … 97 97 matrix *unit=NULL); 98 98 99 lists idLiftW (ideal P, ideal Q, int n, short *w);99 lists idLiftW(ideal P,ideal Q,int n,short *w=NULL); 100 100 101 101 intvec * idMWLift(ideal mod,intvec * weights); -
Singular/iparith.cc
r6eb633d rc98410 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.2 79 2002-03-07 16:00:57mschulze Exp $ */4 /* $Id: iparith.cc,v 1.280 2002-03-07 18:32:08 mschulze Exp $ */ 5 5 6 6 /* … … 4816 4816 4817 4817 static BOOLEAN jjDIVISION4(leftv res, leftv v) 4818 { 4818 { // may have 3 or 4 arguments 4819 4819 leftv v1=v; 4820 4820 leftv v2=v1->next; … … 4825 4825 int i2=iiTestConvert(v2->Typ(),MODUL_CMD); 4826 4826 4827 if(i1==0||i2==0||v3->Typ()!=INT_CMD|| v4->Typ()!=INTVEC_CMD)4828 { 4829 WarnS("<module>,<module>,<int> ,<intvec>expected!");4827 if(i1==0||i2==0||v3->Typ()!=INT_CMD||(v4!=NULL&&v4->Typ()!=INTVEC_CMD)) 4828 { 4829 WarnS("<module>,<module>,<int>[,<intvec>] expected!"); 4830 4830 return TRUE; 4831 4831 } … … 4838 4838 4839 4839 int n=(int)v3->Data(); 4840 short *w=iv2array((intvec *)v4->Data()); 4841 4842 short *w0=w+1; 4843 int i=pVariables; 4844 while(i>0&&*w0>0) 4845 { 4846 w0++; 4847 i--; 4848 } 4849 if(i>0) 4850 WarnS("not all weights are positive!"); 4840 short *w=NULL; 4841 if(v4!=NULL) 4842 { 4843 w=iv2array((intvec *)v4->Data()); 4844 short *w0=w+1; 4845 int i=pVariables; 4846 while(i>0&&*w0>0) 4847 { 4848 w0++; 4849 i--; 4850 } 4851 if(i>0) 4852 WarnS("not all weights are positive!"); 4853 } 4851 4854 4852 4855 lists L=idLiftW(P,Q,n,w); 4853 4856 4854 omFree(w); 4857 if(w!=NULL) 4858 omFree(w); 4855 4859 4856 4860 L->m[1].rtyp=v1->Typ(); … … 5504 5508 ,{jjCOEF_M, COEF_CMD, NONE, 4 } 5505 5509 ,{jjCALL2ARG, DIVISION_CMD, ANY_TYPE/*or set by p*/,2 } 5510 ,{jjDIVISION4, DIVISION_CMD, ANY_TYPE/*or set by p*/,3 } 5506 5511 ,{jjDIVISION4, DIVISION_CMD, ANY_TYPE/*or set by p*/,4 } 5507 5512 ,{jjDBPRINT, DBPRINT_CMD, NONE, -2 }
Note: See TracChangeset
for help on using the changeset viewer.