Changeset dc32d42 in git for Singular/ideals.cc
- Timestamp:
- May 21, 1997, 3:05:36 PM (27 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 2b3f238c740deb3d586dc1d5b379ddadb848cbaa
- Parents:
- 670667a17a4a8423dbd6c8e3749cc652102fb28a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ideals.cc
r670667 rdc32d42 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1. 6 1997-05-02 15:10:13 SingularExp $ */4 /* $Id: ideals.cc,v 1.7 1997-05-21 13:05:12 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 2920 2920 if (idIs0(arg)) return idInit(1,arg->rank); 2921 2921 2922 int i,j,k =0,pC;2922 int i,j,k,pC; 2923 2923 poly p,q; 2924 2924 int rg=arg->rank; 2925 ideal res = id Init(IDELEMS(arg),rg);2925 ideal res = idCopy(arg); 2926 2926 intvec *indexMap=new intvec(rg+1); 2927 2927 intvec *toKill=new intvec(rg+1); 2928 2928 2929 for (i=indexMap->length()-1;i>0;i--) 2930 (*indexMap)[i] = i; 2931 for (j=IDELEMS(arg)-1;j>=0;j--) 2932 { 2933 if (arg->m[j]!=NULL) 2934 { 2935 if ((pIsConstantComp(arg->m[j])) && (pNext(arg->m[j])==NULL)) 2936 { 2937 pC = pGetComp(arg->m[j]); 2929 loop 2930 { 2931 k = 0; 2932 for (i=indexMap->length()-1;i>0;i--) 2933 { 2934 (*indexMap)[i] = i; 2935 (*toKill)[i] = 0; 2936 } 2937 for (j=IDELEMS(res)-1;j>=0;j--) 2938 { 2939 if ((res->m[j]!=NULL) && (pIsConstantComp(res->m[j])) && 2940 (pNext(res->m[j])==NULL)) 2941 { 2942 pC = pGetComp(res->m[j]); 2938 2943 if ((*toKill)[pC]==0) 2939 2944 { … … 2943 2948 (*indexMap)[i]--; 2944 2949 } 2945 } 2946 else 2947 { 2948 res->m[k] = pCopy(arg->m[j]); 2950 pDelete(&(res->m[j])); 2949 2951 k++; 2950 2952 } 2951 2953 } 2952 }2953 if (rg>0)2954 {2955 res->rank=rg;2956 for (j=IDELEMS(res)-1;j>=0;j--)2957 {2958 while ((res->m[j]!=NULL) && ((*toKill)[pGetComp(res->m[j])]==1))2959 pDelete1(&res->m[j]);2960 p = res->m[j];2961 while ((p!=NULL) && (pNext(p)!=NULL))2962 {2963 pSetComp(p,(*indexMap)[pGetComp(p)]);2964 while ((pNext(p)!=NULL) && ((*toKill)[pGetComp(pNext(p))]==1))2965 pDelete1(&pNext(p));2966 pIter(p);2967 }2968 if (p!=NULL) pSetComp(p,(*indexMap)[pGetComp(p)]);2969 }2970 2954 idSkipZeroes(res); 2971 } 2972 else 2973 { 2974 idDelete(&res); 2975 res=idFreeModule(1); 2955 if (k==0) break; 2956 if (rg>0) 2957 { 2958 res->rank=rg; 2959 for (j=IDELEMS(res)-1;j>=0;j--) 2960 { 2961 while ((res->m[j]!=NULL) && ((*toKill)[pGetComp(res->m[j])]==1)) 2962 pDelete1(&res->m[j]); 2963 p = res->m[j]; 2964 while ((p!=NULL) && (pNext(p)!=NULL)) 2965 { 2966 pSetComp(p,(*indexMap)[pGetComp(p)]); 2967 while ((pNext(p)!=NULL) && ((*toKill)[pGetComp(pNext(p))]==1)) 2968 pDelete1(&pNext(p)); 2969 pIter(p); 2970 } 2971 if (p!=NULL) pSetComp(p,(*indexMap)[pGetComp(p)]); 2972 } 2973 idSkipZeroes(res); 2974 } 2975 else 2976 { 2977 idDelete(&res); 2978 res=idFreeModule(1); 2979 break; 2980 } 2976 2981 } 2977 2982 delete toKill;
Note: See TracChangeset
for help on using the changeset viewer.