Changeset e78cce in git for Singular/ideals.cc
- Timestamp:
- Dec 15, 1997, 11:46:43 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 74eea4ee278a222b9c9e93f5041d06fdec86d467
- Parents:
- 3bc8cd5aedd9efcc75f287571cd2f05f49911c72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ideals.cc
r3bc8cd re78cce 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.1 4 1997-12-12 16:55:21 SingularExp $ */4 /* $Id: ideals.cc,v 1.15 1997-12-15 22:46:26 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 707 707 if (result == NULL) 708 708 {/*first monomial*/ 709 result = p New();709 result = pInit(); 710 710 qresult = result; 711 711 } 712 712 else 713 713 { 714 qresult->next = p New();714 qresult->next = pInit(); 715 715 pIter(qresult); 716 716 } … … 775 775 if (result == NULL) 776 776 {/*the first monomial*/ 777 result = p New();777 result = pInit(); 778 778 resultp = result; 779 779 resultp->next = NULL; … … 781 781 else 782 782 { 783 resultp->next = p New();783 resultp->next = pInit(); 784 784 pIter(resultp); 785 785 resultp->next = NULL; … … 1431 1431 pIter(p); 1432 1432 } 1433 e->m[i-1] = pOrdPoly Schreyer(e->m[i-1]);1433 e->m[i-1] = pOrdPolyMerge(e->m[i-1]); 1434 1434 } 1435 1435 } … … 2102 2102 tHomog hom; 2103 2103 intvec * w; 2104 sip_sring tmpR; 2104 2105 2105 2106 if (delVar==NULL) … … 2136 2137 block0[0] = 1; 2137 2138 block1[0] = pVariables; 2138 wv=(short**) Alloc (ordersize*sizeof(short**));2139 wv=(short**) Alloc0(ordersize*sizeof(short**)); 2139 2140 memcpy4(wv+1,currRing->wvhdl,(ordersize-1)*sizeof(short**)); 2140 2141 wv[0]=(short*)Alloc0((pVariables+1)*sizeof(short)); 2141 for (j=0;j< =pVariables;j++)2142 for (j=0;j<pVariables;j++) 2142 2143 if (pGetExp(delVar,j+1)!=0) wv[0][j]=1; 2143 2144 ord[0] = ringorder_a; 2145 2146 // fill in tmp ring to get back the data later on 2147 memset(&tmpR, 0, sizeof(sip_sring)); 2148 tmpR.N = pVariables; 2149 tmpR.OrdSgn = currRing->OrdSgn; 2150 tmpR.order = ord; 2151 tmpR.block0 = block0; 2152 tmpR.block1 = block1; 2153 tmpR.wvhdl = wv; 2154 rComplete(&tmpR); 2155 2156 // change into the new ring 2144 2157 pChangeRing(pVariables,currRing->OrdSgn,ord,block0,block1,wv); 2145 2158 h = idInit(IDELEMS(h1),1); 2146 for (k=0;k<IDELEMS(h1);k++) h->m[k] = pOrdPoly(pCopy(h1->m[k])); 2159 // fetch data from the old ring 2160 for (k=0;k<IDELEMS(h1);k++) h->m[k] = pFetchCopy(currRing, pCopy(h1->m[k])); 2161 // compute std 2147 2162 hh = std(h,NULL,hom,&w,hilb); 2148 2163 idDelete(&h); 2164 2165 // go back to the original ring 2149 2166 pChangeRing(pVariables,currRing->OrdSgn,currRing->order, 2150 2167 currRing->block0,currRing->block1,currRing->wvhdl); … … 2152 2169 while ((i >= 0) && (hh->m[i] == NULL)) i--; 2153 2170 j = -1; 2171 // fetch data from temp ring 2154 2172 for (k=0; k<=i; k++) 2155 2173 { 2156 2174 l=pVariables; 2157 while ((l>0) && (p GetExp(hh->m[k],l)*pGetExp(delVar,l)==0)) l--;2175 while ((l>0) && (pRingGetExp(&tmpR, hh->m[k],l)*pGetExp(delVar,l)==0)) l--; 2158 2176 if (l==0) 2159 2177 { … … 2165 2183 } 2166 2184 //pWrite(hh->m[k]); 2167 h3->m[j] = pOrdPoly(hh->m[k]); 2168 hh->m[k] = NULL; 2185 h3->m[j] = pFetchCopy(&tmpR, hh->m[k]); 2169 2186 //pWrite(h3->m[j]); 2170 2187 //PrintLn(); … … 2261 2278 BOOLEAN pIsUnit(poly p) 2262 2279 { 2263 poly q=p; 2264 int i,j; 2265 BOOLEAN b; 2280 int i; 2266 2281 2267 2282 if (p == NULL) return FALSE; 2268 if (currRing->OrdSgn == 1) 2269 { 2270 for (i=1;i<=pVariables;i++) 2271 { 2272 j = pGetExp(p,i); 2273 if (j != 0) return FALSE; 2274 } 2275 if (pGetComp(p) != 0) return FALSE; 2276 if (pNext(p) !=NULL) return FALSE; 2277 } 2278 else 2279 { 2280 b = FALSE; 2281 while ((! b) && (q != NULL)) 2282 { 2283 if (pGetComp(p) == 0) 2284 { 2285 i = 0; 2286 do 2287 { 2288 i++; 2289 j = pGetExp(p,i); 2290 } 2291 while ((i<=pVariables) && (j == 0)); 2292 if (i>pVariables) b = TRUE; 2293 } 2294 q = pNext(q); 2295 } 2296 return b; 2297 } 2298 return TRUE; 2283 i = 1; 2284 while (i<=pVariables && pGetExp(p,i) == 0) i++; 2285 if (i > pVariables && (pGetComp(p) == 0)) 2286 { 2287 if (currRing->OrdSgn == 1 && pNext(p) !=NULL) return FALSE; 2288 return TRUE; 2289 } 2290 return FALSE; 2299 2291 } 2300 2292
Note: See TracChangeset
for help on using the changeset viewer.