Changeset 0a8ee5 in git
- Timestamp:
- Mar 19, 2010, 3:38:41 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 2937222b4a61df047ac996df75f1a6bfe245af2c
- Parents:
- 18871b8b1489681d13f6dadcbc2940b541da2be2
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gring.cc
r18871b r0a8ee5 1954 1954 // b will not be multiplied by any constant in this impl. 1955 1955 // ==> *c=1 1956 *c=nInit(1);1956 if (c!=NULL) *c=nInit(1); 1957 1957 poly m=pOne(); 1958 1958 pExpVectorDiff(m,kBucketGetLm(b),p); … … 1965 1965 pDelete(&m); 1966 1966 number n=nCopy(pGetCoeff(pp)); 1967 number MinusOne=nInit(-1);1968 1967 number nn; 1969 if (!n Equal(n,MinusOne))1968 if (!n_IsMOne(n,currRing)) 1970 1969 { 1971 1970 nn=nNeg(nInvers(n)); … … 1977 1976 pp=p_Mult_nn(pp,n,currRing); 1978 1977 nDelete(&n); 1979 nDelete(&MinusOne);1980 1978 int l=pLength(pp); 1981 1979 kBucket_Add_q(b,pp,&l); … … 2001 1999 // b will not be multiplied by any constant in this impl. 2002 2000 // ==> *c=1 2003 *c=nInit(1);2001 if (c!=NULL) *c=nInit(1); 2004 2002 poly m = pOne(); 2005 2003 const poly pLmB = kBucketGetLm(b); // no new copy! … … 2030 2028 assume( pp != NULL ); 2031 2029 const number n = pGetCoeff(pp); // bug! 2032 number nn;2033 2030 2034 2031 if (!n_IsMOne(n,currRing) ) // does this improve performance??!? also see below... // TODO: check later on. 2035 { 2036 nn=nNeg(nInvers(nCopy(n))); 2037 } 2038 else nn=nInit(1); // if n == -1 => nn = 1 and -1/n otherwise 2039 2040 number t = nMult(nn,pGetCoeff(pLmB)); 2041 nDelete(&nn); 2042 2043 pp = p_Mult_nn(pp,t,currRing); 2044 nDelete(&t); 2032 // if n == -1 => nn = 1 and -1/n 2033 { 2034 number nn=nNeg(nInvers(n)); 2035 number t = nMult(nn,pGetCoeff(pLmB)); 2036 nDelete(&nn); 2037 pp = p_Mult_nn(pp,t,currRing); 2038 nDelete(&t); 2039 } 2040 else 2041 { 2042 pp = p_Mult_nn(pp,pGetCoeff(pLmB),currRing); 2043 } 2045 2044 2046 2045 int l = pLength(pp); … … 2063 2062 { 2064 2063 // b is multiplied by a constant in this impl. 2064 number ctmp; 2065 2065 poly m=pOne(); 2066 2066 pExpVectorDiff(m,kBucketGetLm(b),p); … … 2069 2069 pTest(m); 2070 2070 #endif 2071 if(p_IsConstant(m,currRing)){ 2071 if(p_IsConstant(m,currRing)) 2072 { 2072 2073 pDelete(&m); 2073 *c = kBucketPolyRed(b,p,pLength(p),NULL); 2074 return; 2075 } 2076 poly pp = nc_mm_Mult_pp(m,p,currRing); 2077 number c2,cc; 2078 pCleardenom_n(pp,c2); 2079 pDelete(&m); 2080 *c = kBucketPolyRed(b,pp,pLength(pp),NULL); 2081 //cc=*c; 2082 //*c=nMult(*c,c2); 2083 nDelete(&c2); 2084 //nDelete(&cc); 2085 pDelete(&pp); 2086 2074 ctmp = kBucketPolyRed(b,p,pLength(p),NULL); 2075 } 2076 else 2077 { 2078 poly pp = nc_mm_Mult_pp(m,p,currRing); 2079 number c2,cc; 2080 pCleardenom_n(pp,c2); 2081 pDelete(&m); 2082 ctmp = kBucketPolyRed(b,pp,pLength(pp),NULL); 2083 //cc=*c; 2084 //*c=nMult(*c,c2); 2085 nDelete(&c2); 2086 //nDelete(&cc); 2087 pDelete(&pp); 2088 } 2089 if (c!=NULL) *c=ctmp; 2090 else nDelete(&ctmp); 2087 2091 } 2088 2092 … … 2090 2094 { 2091 2095 // b is multiplied by a constant in this impl. 2096 number ctmp; 2092 2097 poly m=pOne(); 2093 2098 pExpVectorDiff(m,kBucketGetLm(b),p); … … 2100 2105 { 2101 2106 pDelete(&m); 2102 *c = kBucketPolyRed(b,p,pLength(p),NULL); 2103 return; 2104 } 2105 poly pp = nc_mm_Mult_pp(m,p,currRing); 2106 number c2,cc; 2107 pCleardenom_n(pp,c2); 2108 pDelete(&m); 2109 *c = kBucketPolyRed(b,pp,pLength(pp),NULL); 2110 //cc=*c; 2111 //*c=nMult(*c,c2); 2112 nDelete(&c2); 2113 //nDelete(&cc); 2114 pDelete(&pp); 2115 2107 ctmp = kBucketPolyRed(b,p,pLength(p),NULL); 2108 } 2109 else 2110 { 2111 poly pp = nc_mm_Mult_pp(m,p,currRing); 2112 number c2,cc; 2113 pCleardenom_n(pp,c2); 2114 pDelete(&m); 2115 ctmp = kBucketPolyRed(b,pp,pLength(pp),NULL); 2116 //cc=*c; 2117 //*c=nMult(*c,c2); 2118 nDelete(&c2); 2119 //nDelete(&cc); 2120 pDelete(&pp); 2121 } 2122 if (c!=NULL) *c=ctmp; 2123 else nDelete(&ctmp); 2116 2124 } 2117 2125 … … 2169 2177 // b will not by multiplied by any constant in this impl. 2170 2178 // ==> *c=1 2171 *c=nInit(1);2179 if (c!=NULL) *c=nInit(1); 2172 2180 2173 2181 poly pp = NULL; -
kernel/kspoly.cc
r18871b r0a8ee5 76 76 // no exp-bound checking needed 77 77 // (only needed if exp-bound(tailring)<exp-b(currRing)) 78 number c; 79 if (PR->bucket!=NULL) nc_kBucketPolyRed(PR->bucket, p2,&c); 78 if (PR->bucket!=NULL) nc_kBucketPolyRed(PR->bucket, p2,coef); 80 79 else 81 80 { 82 81 poly _p = (PR->t_p != NULL ? PR->t_p : PR->p); 83 82 assume(_p != NULL); 84 nc_PolyPolyRed(_p, p2, &c);83 nc_PolyPolyRed(_p, p2,coef); 85 84 if (PR->t_p!=NULL) PR->t_p=_p; else PR->p=_p; 86 PR->pLength=pLength(_p); 87 } 88 if (coef!=NULL) *coef=c; 89 else nDelete(&c); 85 PR->pLength=0; // usaully not used, GetpLength re-comoutes it if needed 86 } 90 87 return 0; 91 88 } -
kernel/sca.cc
r18871b r0a8ee5 312 312 return NULL; 313 313 } 314 315 314 tpower ^= cpower; // compute degree of (-1). 316 315 } 317 318 316 cpower ^= iExp1; 319 317 } … … 606 604 #endif 607 605 608 if( ( pPoly == NULL ) || ( pMonom == NULL ) ) 609 return NULL; 606 assume( (pPoly != NULL) && (pMonom !=NULL)); 610 607 611 608 const int iComponentMonomM = p_GetComp(pMonom, rRing); … … 2045 2042 /* complete reduction of the standard basis--------- */ 2046 2043 2047 if (TEST_OPT_REDSB){ 2044 if (TEST_OPT_REDSB) 2045 { 2048 2046 completeReduce(strat); 2049 2047 }
Note: See TracChangeset
for help on using the changeset viewer.