Changeset cf108d in git
- Timestamp:
- May 13, 2005, 5:18:52 PM (19 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- b6eb14fd348d7efc8e50676bd4a3f35a83516571
- Parents:
- a3f22cbee52ae2c26a1ce34153c4f67a6daeddd1
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
ra3f22c rcf108d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.3 59 2005-05-12 14:25:02Singular Exp $ */4 /* $Id: iparith.cc,v 1.360 2005-05-13 15:18:48 Singular Exp $ */ 5 5 6 6 /* … … 1903 1903 { 1904 1904 assumeStdFlag(u); 1905 intvec *module_w=(intvec*)atGet(u,"isHomog" );1905 intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD); 1906 1906 intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currQuotient); 1907 1907 switch((int)v->Data()) … … 2015 2015 static BOOLEAN jjMODULO(leftv res, leftv u, leftv v) 2016 2016 { 2017 res->data = (char *)idModulo((ideal)u->Data(),(ideal)v->Data()); 2017 intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 2018 tHomog hom=testHomog; 2019 if (w_u!=NULL) 2020 { 2021 w_u=ivCopy(w_u); 2022 hom=isHomog; 2023 } 2024 intvec *w_v=(intvec *)atGet(v,"isHomog",INTVEC_CMD); 2025 if (w_v!=NULL) 2026 { 2027 w_v=ivCopy(w_v); 2028 hom=isHomog; 2029 } 2030 if ((w_u!=NULL) && (w_v==NULL)) 2031 w_v=ivCopy(w_u); 2032 if ((w_v!=NULL) && (w_u==NULL)) 2033 w_u=ivCopy(w_v); 2034 ideal u_id=(ideal)u->Data(); 2035 ideal v_id=(ideal)v->Data(); 2036 if (w_u!=NULL) 2037 { 2038 if ((*w_u).compare((w_v))!=0) 2039 { 2040 WarnS("incompatible weights"); 2041 delete w_u; w_u=NULL; 2042 hom=testHomog; 2043 } 2044 else 2045 { 2046 if ((!idHomModule(u_id,currQuotient,&w_v)) 2047 || (!idHomModule(v_id,currQuotient,&w_v))) 2048 { 2049 WarnS("wrong weights"); 2050 delete w_u; w_u=NULL; 2051 hom=testHomog; 2052 } 2053 } 2054 } 2055 res->data = (char *)idModulo(u_id,v_id ,hom,&w_u); 2056 if (w_u!=NULL) 2057 { 2058 atSet(res,omStrDup("isHomog"),w_u,INTVEC_CMD); 2059 } 2060 delete w_v; 2018 2061 return FALSE; 2019 2062 } … … 2250 2293 } 2251 2294 } 2295 2252 2296 intvec *ww=NULL; 2253 2297 int add_row_shift=0; … … 2258 2302 (*ww) -= add_row_shift; 2259 2303 } 2304 else 2305 idHomModule(u_id,currQuotient,&ww); 2306 weights=ww; 2260 2307 2261 2308 if ((iiOp == RES_CMD) || (iiOp == MRES_CMD)) … … 2306 2353 r->list_length=wmaxl; 2307 2354 res->data=(void *)r; 2355 if ((r->weights!=NULL) && (r->weights[0]!=NULL)) 2356 { 2357 intvec *w=ivCopy(r->weights[0]); 2358 if (weights!=NULL) (*w) += add_row_shift; 2359 atSet(res,omStrDup("isHomog"),w,INTVEC_CMD); 2360 delete w; 2361 } 2362 else 2363 { 2364 #if 0 2365 // need to set weights for ALL components (sres) 2366 if (weights!=NULL) 2367 { 2368 atSet(res,omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD); 2369 r->weights = (intvec**)omAlloc0Bin(void_ptr_bin); 2370 (r->weights)[0] = ivCopy(weights); 2371 } 2372 #endif 2373 } 2308 2374 if (ww!=NULL) { delete ww; ww=NULL; } 2309 if ((r->weights!=NULL) && (r->weights[0]!=NULL))2310 {2311 ww=ivCopy(r->weights[0]);2312 if (weights!=NULL) (*ww) += add_row_shift;2313 atSet(res,omStrDup("isHomog"),ww,INTVEC_CMD);2314 }2315 else if (atGet(res,"isHomog",INTVEC_CMD)==NULL)2316 {2317 if (weights!=NULL)2318 {2319 atSet(res,omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD);2320 }2321 }2322 2375 return FALSE; 2323 2376 } … … 2437 2490 { 2438 2491 ideal result; 2439 intvec *w=(intvec *)atGet(u,"isHomog" );2492 intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 2440 2493 tHomog hom=testHomog; 2441 2494 if (w!=NULL) … … 2455 2508 assumeStdFlag(u); 2456 2509 ideal result; 2457 intvec *w=(intvec *)atGet(u,"isHomog" );2510 intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 2458 2511 tHomog hom=testHomog; 2459 2512 if (w!=NULL) … … 3000 3053 { 3001 3054 assumeStdFlag(v); 3002 intvec *module_w=(intvec*)atGet(v,"isHomog" );3055 intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD); 3003 3056 scDegree((ideal)v->Data(),module_w,currQuotient); 3004 3057 return FALSE; … … 3160 3213 { 3161 3214 assumeStdFlag(v); 3162 intvec *w=(intvec*)atGet(v,"isHomog" );3215 intvec *w=(intvec*)atGet(v,"isHomog",INTVEC_CMD); 3163 3216 BOOLEAN delete_w=FALSE; 3164 3217 ideal I=(ideal)v->Data(); … … 3207 3260 { 3208 3261 assumeStdFlag(v); 3209 intvec *module_w=(intvec*)atGet(v,"isHomog" );3262 intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD); 3210 3263 //scHilbertPoly((ideal)v->Data(),currQuotient); 3211 3264 hLookSeries((ideal)v->Data(),module_w,currQuotient); … … 3542 3595 static BOOLEAN jjPRUNE(leftv res, leftv v) 3543 3596 { 3544 res->data = (char *)idMinEmbedding((ideal)v->Data()); 3597 intvec *w=ivCopy((intvec *)atGet(v,"isHomog",INTVEC_CMD)); 3598 intvec **ww=&w; 3599 res->data = (char *)idMinEmbedding((ideal)v->Data(),FALSE,ww); 3600 atSet(res,omStrDup("isHomog"),*ww,INTVEC_CMD); 3545 3601 return FALSE; 3546 3602 } … … 3629 3685 { 3630 3686 ideal result; 3631 intvec *w=(intvec *)atGet(v,"isHomog" );3687 intvec *w=(intvec *)atGet(v,"isHomog",INTVEC_CMD); 3632 3688 tHomog hom=testHomog; 3633 3689 if (w!=NULL) … … 4654 4710 { 4655 4711 assumeStdFlag(u); 4656 intvec *module_w=(intvec *)atGet(u,"isHomog" );4712 intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 4657 4713 intvec *wdegree=(intvec*)w->Data(); 4658 4714 if (wdegree->length()!=pVariables) … … 5019 5075 if ((iiOp == RES_CMD) || (iiOp == MRES_CMD)) 5020 5076 { 5021 intvec * iv=(intvec*)atGet(u,"isHomog" );5077 intvec * iv=(intvec*)atGet(u,"isHomog",INTVEC_CMD); 5022 5078 if (iv!=NULL) 5023 5079 { … … 5054 5110 { 5055 5111 ideal result; 5056 intvec *ww=(intvec *)atGet(u,"isHomog" );5112 intvec *ww=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 5057 5113 tHomog hom=testHomog; 5058 5114 if (ww!=NULL) -
Singular/ipprint.cc
ra3f22c rcf108d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipprint.cc,v 1.2 0 2001-03-27 17:12:54Singular Exp $ */4 /* $Id: ipprint.cc,v 1.21 2005-05-13 15:18:50 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: printing … … 286 286 { 287 287 int i,j; 288 int row_shift=(int)atGet(u,"rowShift" );288 int row_shift=(int)atGet(u,"rowShift",INT_CMD); 289 289 intvec * betti=(intvec *)u->Data(); 290 290 // head line -------------------------------------------------------- -
kernel/ideals.cc
ra3f22c rcf108d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.1 1 2005-04-25 18:15:23Singular Exp $ */4 /* $Id: ideals.cc,v 1.12 2005-05-13 15:18:52 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 3223 3223 * represents (h1+h2)/h2=h1/(h1 intersect h2) 3224 3224 */ 3225 ideal idModulo (ideal h2,ideal h1) 3226 { 3225 //ideal idModulo (ideal h2,ideal h1) 3226 ideal idModulo (ideal h2,ideal h1, tHomog hom, intvec ** w) 3227 { 3228 intvec *wtmp=NULL; 3229 3227 3230 int i,j,k,rk,flength=0,slength,length; 3228 intvec * w;3229 3231 poly p,q; 3230 3232 … … 3240 3242 } 3241 3243 ideal temp = idInit(IDELEMS(h2),length+IDELEMS(h2)); 3244 if ((w!=NULL)&&((*w)!=NULL)) 3245 { 3246 //Print("input weights:");(*w)->show(1);PrintLn(); 3247 int d; 3248 int k; 3249 wtmp=new intvec(length+IDELEMS(h2)); 3250 for (i=0;i<length;i++) 3251 ((*wtmp)[i])=(**w)[i]; 3252 for (i=0;i<IDELEMS(h2);i++) 3253 { 3254 d = pDeg(h2->m[i]); 3255 k= pGetComp(h2->m[i]); 3256 if (slength>0) k--; 3257 d +=((**w)[k]); 3258 ((*wtmp)[i+length]) = d; 3259 } 3260 //Print("weights:");wtmp->show(1);PrintLn(); 3261 } 3242 3262 for (i=0;i<IDELEMS(h2);i++) 3243 3263 { … … 3287 3307 3288 3308 idTest(s_temp); 3289 ideal s_temp1 = kStd(s_temp,currQuotient,testHomog,&w,NULL,length); 3290 if (w!=NULL) delete w; 3309 ideal s_temp1 = kStd(s_temp,currQuotient,hom,&wtmp,NULL,length); 3310 3311 //if (wtmp!=NULL) Print("output weights:");wtmp->show(1);PrintLn(); 3312 if ((w!=NULL) && (*w !=NULL) && (wtmp!=NULL)) 3313 { 3314 delete *w; 3315 *w=new intvec(IDELEMS(h2)); 3316 for (i=0;i<IDELEMS(h2);i++) 3317 ((**w)[i])=(*wtmp)[i+length]; 3318 } 3319 if (wtmp!=NULL) delete wtmp; 3291 3320 3292 3321 for (i=0;i<IDELEMS(s_temp1);i++) … … 3560 3589 * embedded module (arg represents the quotient!) 3561 3590 */ 3562 ideal idMinEmbedding(ideal arg,BOOLEAN inPlace )3591 ideal idMinEmbedding(ideal arg,BOOLEAN inPlace, intvec **w) 3563 3592 { 3564 3593 if (idIs0(arg)) return idInit(1,arg->rank); … … 3573 3602 syGaussForOne(res,next_gen,next_comp,0,IDELEMS(res)); 3574 3603 idDeleteComp(res,next_comp); 3604 if ((w !=NULL)&&(*w!=NULL)) 3605 { 3606 intvec *wtmp=new intvec((*w)->length()-1); 3607 int i; 3608 for(i=0;i<next_comp-1;i++) (*wtmp)[i]=(**w)[i]; 3609 for(i=next_comp;i<(*w)->length();i++) (*wtmp)[i-1]=(**w)[i]; 3610 delete *w; 3611 *w=wtmp; 3612 } 3575 3613 } 3576 3614 idSkipZeroes(res); -
kernel/ideals.h
ra3f22c rcf108d 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ideals.h,v 1. 3 2005-03-14 16:17:07Singular Exp $ */6 /* $Id: ideals.h,v 1.4 2005-05-13 15:18:52 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate ideals … … 115 115 ideal idCompactify(ideal id); 116 116 117 ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE );117 ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL); 118 118 119 119 ideal idHead(ideal h); … … 143 143 144 144 intvec *idSort(ideal id,BOOLEAN nolex=TRUE); 145 ideal idModulo (ideal h1,ideal h2 );145 ideal idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL); 146 146 int idElem(ideal F); 147 147 matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how);
Note: See TracChangeset
for help on using the changeset viewer.