Changeset 4c852a in git
- Timestamp:
- May 9, 2000, 4:34:11 PM (23 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 87a8156a442b896f42878bb29b9c2a183cd30a18
- Parents:
- 72c1b94aa91b5685f167d11c0420e61bbe7253e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ideals.cc
r72c1b9 r4c852a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.9 3 2000-03-07 15:49:13Singular Exp $ */4 /* $Id: ideals.cc,v 1.94 2000-05-09 14:34:11 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 388 388 static int pComp_RevLex(poly a, poly b,BOOLEAN nolex) 389 389 { 390 if (nolex) return pComp0(a,b); 391 int l=pVariables; 392 while ((l>0) && (pGetExp(a,l)==pGetExp(b,l))) l--; 393 if (l==0) 394 { 395 if (pGetComp(a)==pGetComp(b)) return 0; 396 if (pGetComp(a)>pGetComp(b)) return 1; 397 } 398 else if (pGetExp(a,l)>pGetExp(b,l)) 399 return 1; 400 return -1; 390 if (b==NULL) return 1; 391 if (a==NULL) return -1; 392 393 if (nolex) return pComp0(a,b); 394 int l=pVariables; 395 while ((l>0) && (pGetExp(a,l)==pGetExp(b,l))) l--; 396 if (l==0) 397 { 398 if (pGetComp(a)==pGetComp(b)) return 0; 399 if (pGetComp(a)>pGetComp(b)) return 1; 400 } 401 else if (pGetExp(a,l)>pGetExp(b,l)) 402 return 1; 403 return -1; 401 404 } 402 405 … … 434 437 notFound = FALSE; 435 438 } 436 while ((newpos>=0) && (newpos<actpos) && (notFound)) 439 //while ((newpos>=0) && (newpos<actpos) && (notFound)) 440 while (notFound && (newpos>=0) && (newpos<actpos)) 437 441 { 438 442 newcomp = pComp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex); … … 1688 1692 pSetComp(p,1+j+k); 1689 1693 pSetmComp(p); 1690 1694 p = pNeg(p); 1691 1695 } 1692 1696 } … … 2431 2435 { 2432 2436 ideal result=idCopy(id); 2433 for (i=1;i<IDELEMS(result);i++)2434 { 2435 if (result->m[i]!=NULL)2436 { 2437 for (j=0;j<i;j++)2437 //if (IDELEMS(result) < 1) 2438 { 2439 for (i=1;i<IDELEMS(result);i++) 2440 { 2441 if (result->m[i]!=NULL) 2438 2442 { 2439 if ((result->m[j]!=NULL) 2440 && (pComparePolys(result->m[i],result->m[j]))) 2443 for (j=0;j<i;j++) 2441 2444 { 2442 pDelete(&(result->m[j])); 2445 if ((result->m[j]!=NULL) 2446 && (pComparePolys(result->m[i],result->m[j]))) 2447 { 2448 pDelete(&(result->m[j])); 2449 } 2443 2450 } 2444 2451 } 2445 2452 } 2446 2453 } 2454 // else 2455 // { 2456 // intvec *v=idSort(result,TRUE); 2457 // for(i=0;i<IDELEMS(result);i++) 2458 // (*v)[i]--; 2459 // for (i=0;i<IDELEMS(result)-1;i++) 2460 // { 2461 // if (((*v)[i]>=0) 2462 // && (result->m[(*v)[i]]!=NULL)) 2463 // { 2464 // j=i+1; 2465 // while ((j<IDELEMS(result)) 2466 // && ((*v)[j]>=0) 2467 // && (result->m[(*v)[j]]!=NULL) 2468 // && (pComparePolys(result->m[(*v)[i]],result->m[(*v)[j]]))) 2469 // { 2470 // pDelete(&(result->m[(*v)[j]])); 2471 // j++; 2472 // } 2473 // } 2474 // } 2475 // delete v; 2476 // } 2447 2477 idSkipZeroes(result); 2448 2478 return result;
Note: See TracChangeset
for help on using the changeset viewer.