Changeset 26ae12 in git
- Timestamp:
- May 19, 1998, 11:02:40 AM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 565a96ad124ccea57f357a4da2ded5764304f8cf
- Parents:
- b1fa42d7299399bfcfb6cef7291df79a2a381178
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ChangeLog
rb1fa42 r26ae12 1 1998-05-19 Olaf Bachmann <obachman@mathematik.uni-kl.de> 2 3 * ideals.cc (idDelLmEquals): added idDelLmEqual == simplify(16), 4 and idDelDiv == simplify(32); improved pComparePolys 5 1 6 1998-05-18 Olaf Bachmann <obachman@mathematik.uni-kl.de> 2 7 -
Singular/ideals.cc
rb1fa42 r26ae12 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.2 6 1998-05-14 14:41:28 SingularExp $ */4 /* $Id: ideals.cc,v 1.27 1998-05-19 09:02:35 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 236 236 } 237 237 } 238 239 // 240 // Delete id[j], if Lm(j) == Lm(i) and j > i 241 // 242 void idDelLmEquals(ideal id) 243 { 244 int i, j, t; 245 int k = IDELEMS(id), l = k; 246 for (i=k-2; i>=0; i--) 247 { 248 for (j=l-1; j>i; j--) 249 { 250 if (pLmEqual(id->m[i], id->m[j])) 251 { 252 pDelete(&id->m[j]); 253 l--; 254 for(t=j; t<l; t++) 255 { 256 id->m[t] = id->m[t+1]; 257 } 258 } 259 } 260 } 261 if (l != k) 262 { 263 pEnlargeSet(&id->m, k, l-k); 264 IDELEMS(id) = l; 265 } 266 } 267 268 void idDelDiv(ideal id) 269 { 270 int i, j, t; 271 int k = IDELEMS(id), l = k; 272 for (i=k-2; i>=0; i--) 273 { 274 for (j=l-1; j>i; j--) 275 { 276 277 if (((id->m[j] != NULL) && pDivisibleBy(id->m[i], id->m[j])) || 278 (id->m[i] == NULL && id->m[j] == NULL)) 279 { 280 pDelete(&id->m[j]); 281 l--; 282 for(t=j; t<l; t++) 283 { 284 id->m[t] = id->m[t+1]; 285 } 286 } 287 } 288 } 289 if (l != k) 290 { 291 pEnlargeSet(&id->m, k, l-k); 292 IDELEMS(id) = l; 293 } 294 } 295 238 296 239 297 /*2 -
Singular/ideals.h
rb1fa42 r26ae12 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ideals.h,v 1. 6 1998-02-19 12:45:40 siebertExp $ */6 /* $Id: ideals.h,v 1.7 1998-05-19 09:02:35 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate ideals … … 29 29 void idDelMultiples(ideal id); 30 30 void idDelEquals(ideal id); 31 void idDelLmEquals(ideal id); 32 void idDelDiv(ideal id); 31 33 32 34 #ifdef PDEBUG -
Singular/iparith.cc
rb1fa42 r26ae12 1736 1736 return (i==-1); 1737 1737 } 1738 #define SIMPL_LMDIV 32 1739 #define SIMPL_LMEQ 16 1738 1740 #define SIMPL_MULT 8 1739 1741 #define SIMPL_EQU 4 … … 1744 1746 int sw = (int)v->Data(); 1745 1747 ideal id = (ideal)u->CopyD(); 1748 if (sw & SIMPL_LMDIV) 1749 { 1750 idDelDiv(id); 1751 } 1752 if (sw & SIMPL_LMEQ) 1753 { 1754 idDelLmEquals(id); 1755 } 1746 1756 if (sw & SIMPL_NULL) 1747 1757 { -
Singular/polys.h
rb1fa42 r26ae12 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys.h,v 1.1 2 1998-04-08 12:41:37 pohlExp $ */6 /* $Id: polys.h,v 1.13 1998-05-19 09:02:38 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate polynomials … … 207 207 poly pPower(poly p, int i); 208 208 209 // return TRUE, if exponent and component of p1 and p2 are equal, 210 // FALSE otherwise 211 #define pEqual(p1, p2) _pEqual(p1, p2) 209 // return TRUE, if exponent and component of Lm(p1) and Lm(p2) are equal, 210 // FALSE otherwise; 211 #define pEqual(p1, p2) _pEqual(p1, p2) // Assumes p1 != NULL & p2 != NULL 212 inline BOOLEAN pLmEqual(poly p1, poly p2) // no assumptions 213 { 214 if (p1 != NULL) 215 { 216 if (p2 != NULL) 217 return pEqual(p1, p2); 218 return FALSE; 219 } 220 if (p2 == NULL) 221 return TRUE; 222 return FALSE; 223 } 212 224 213 225 // returns TRUE, if leading monom of a divides leading monom of b 214 // i.e., if there exists a expvector c > 0, s.t. b = a + c 226 // i.e., if there exists a expvector c > 0, s.t. b = a + c; assumes b != NULL 215 227 #define pDivisibleBy(a, b) _pDivisibleBy(a,b) 216 228 // like pDivisibleBy, except that it is assumed that a!=NULL 217 229 #define pDivisibleBy1(a,b) _pDivisibleBy1(a,b) 218 // like pDivisibleBy , assumes a != NULL, does not check components230 // like pDivisibleBy1, does not check components 219 231 #define pDivisibleBy2(a, b) _pDivisibleBy2(a,b) 220 232 -
Singular/polys1.cc
rb1fa42 r26ae12 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys1.cc,v 1.1 3 1998-04-24 16:39:25 SingularExp $ */4 /* $Id: polys1.cc,v 1.14 1998-05-19 09:02:38 obachman Exp $ */ 5 5 6 6 /* … … 1238 1238 { 1239 1239 /* p1 and p2 are non-NULL, so we may use pComp0 instead of pComp */ 1240 if ( pComp0(p1,p2) != 0)1240 if (! pEqual(p1, p2)) 1241 1241 { 1242 1242 return FALSE; … … 1266 1266 while ((p1 != NULL) /*&& (p2 != NULL)*/) 1267 1267 { 1268 for (i=1; i<=pVariables; i++) 1269 { 1270 if (pGetExp(p1,i)!=pGetExp(p2,i)) 1271 { 1268 if ( ! pLmEqual(p1, p2)) 1269 { 1272 1270 nDelete(&n); 1273 1271 return FALSE; 1274 }1275 }1276 if (pGetComp(p1) != pGetComp(p2))1277 {1278 nDelete(&n);1279 return FALSE;1280 1272 } 1281 1273 if (!nEqual(pGetCoeff(p1),nn=nMult(pGetCoeff(p2),n))) … … 1292 1284 return TRUE; 1293 1285 } 1294 //{1295 // number m=NULL,n=NULL;1296 //1297 // while ((p1 != NULL) && (p2 != NULL))1298 // {1299 // if (pComp(p1,p2) != 0)1300 // {1301 // if (n!=NULL) nDelete(&n);1302 // return FALSE;1303 // }1304 // if (n == NULL)1305 // {1306 // n=nDiv(pGetCoeff(p1),pGetCoeff(p2));1307 // }1308 // else1309 // {1310 // m=nDiv(pGetCoeff(p1),pGetCoeff(p2));1311 // if (! nEqual(m,n))1312 // {1313 // nDelete(&n);1314 // nDelete(&m);1315 // return FALSE;1316 // }1317 // nDelete(&m);1318 // }1319 // p1=pNext(p1);1320 // p2=pNext(p2);1321 // }1322 // nDelete(&n);1323 // //if (p1 != p2)1324 // // return FALSE;1325 // //else1326 // // return TRUE;1327 // return (p1==p2);1328 //}
Note: See TracChangeset
for help on using the changeset viewer.