Changeset 8421b8 in git
- Timestamp:
- Nov 24, 2006, 10:53:01 AM (17 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 3705d5c995e721d82fb6dad60d586e998ed821ca
- Parents:
- 33c36dbf5e1e3c1f88f492f3ff653ecb9f38a11c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ideals.cc
r33c36d r8421b8 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.2 2 2006-11-17 17:58:10Singular Exp $ */4 /* $Id: ideals.cc,v 1.23 2006-11-24 09:53:01 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 3486 3486 { 3487 3487 if (idIs0(arg)) return -1; 3488 int i=0,j,rk_arg=idRankFreeModule(arg),generator=-1; 3489 intvec * componentIsUsed =new intvec(rk_arg+1); 3488 int i=0,j, generator=-1; 3489 int rk_arg=arg->rank; //idRankFreeModule(arg); 3490 int * componentIsUsed =(int *)omAlloc((rk_arg+1)*sizeof(int)); 3490 3491 poly p,q; 3491 3492 3492 while ((i<IDELEMS(arg)) && (generator<0)) 3493 { 3494 for (j=rk_arg;j>=0;j--) 3495 (*componentIsUsed)[j]=0; 3493 while ((generator<0) && (i<IDELEMS(arg))) 3494 { 3495 memset(componentIsUsed,0,(rk_arg+1)*sizeof(int)); 3496 3496 p = arg->m[i]; 3497 3497 while (p!=NULL) 3498 3498 { 3499 3499 j = pGetComp(p); 3500 if ( (*componentIsUsed)[j]==0)3500 if (componentIsUsed[j]==0) 3501 3501 { 3502 3502 if (pLmIsConstantComp(p)) 3503 3503 { 3504 3504 generator = i; 3505 (*componentIsUsed)[j] = 1;3505 componentIsUsed[j] = 1; 3506 3506 } 3507 3507 else 3508 3508 { 3509 (*componentIsUsed)[j] = -1;3509 componentIsUsed[j] = -1; 3510 3510 } 3511 3511 } 3512 else if ( (*componentIsUsed)[j]>0)3513 { 3514 ( (*componentIsUsed)[j])++;3512 else if (componentIsUsed[j]>0) 3513 { 3514 (componentIsUsed[j])++; 3515 3515 } 3516 3516 pIter(p); … … 3522 3522 for (j=0;j<=rk_arg;j++) 3523 3523 { 3524 if ( (*componentIsUsed)[j]>0)3525 { 3526 if ((*comp==-1) || ( (*componentIsUsed)[j]<i))3524 if (componentIsUsed[j]>0) 3525 { 3526 if ((*comp==-1) || (componentIsUsed[j]<i)) 3527 3527 { 3528 3528 *comp = j; 3529 i= (*componentIsUsed)[j]; 3530 } 3531 } 3532 } 3529 i= componentIsUsed[j]; 3530 } 3531 } 3532 } 3533 omFree(componentIsUsed); 3533 3534 return generator; 3534 3535 } … … 3567 3568 3568 3569 if (!inPlace) res = idCopy(arg); 3570 res->rank=si_max(res->rank,idRankFreeModule(res)); 3571 3569 3572 loop 3570 3573 {
Note: See TracChangeset
for help on using the changeset viewer.