Changeset e1fdcd in git for Singular/LIB/normal.lib
- Timestamp:
- May 20, 2010, 6:03:06 PM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- dd4942c513f746e8c0cbbd433a4310c9fbb756ea
- Parents:
- c12222e2ab738f967d4dd4a6e28afd75114c4cf7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/normal.lib
rc12222 re1fdcd 64 64 - \"withDelta\" (or \"wd\") -> returns also the delta invariants.@* 65 65 If the optional parameter choose is not given or empty, only 66 \"equidim\" but no other option is used. 66 \"equidim\" but no other option is used.@* 67 The following options can be used when the ring has two variables. 68 They are needed for computing integral basis.@* 69 - \"var1\" -> uses a polynomial in the first variable as conductor.@* 70 - \"var2\" -> uses a polynomial in the second variable as conductor.@* 67 71 ASSUME: The ideal must be radical, for non-radical ideals the output may 68 72 be wrong (id=radical(id); makes id radical). However, when using the … … 125 129 " 126 130 { 127 131 intvec opt = option(get); // Save current options 128 132 129 133 int i,j; … … 138 142 int nvar = nvars(basering); 139 143 int chara = char(basering); 140 list result; 144 int conduOption; // Method for choosing the conductor 145 list result, resultNew; 141 146 list keepresult; 142 147 list ringStruc; … … 196 201 } 197 202 } 203 204 conduOption = 0; // The default is the smallest degree polynomial 205 if ( find(method,"var1") ) 206 {conduOption = 1;} 207 if ( find(method,"var2") ) 208 {conduOption = 2;} 209 198 210 199 211 kill #; … … 238 250 def ROut = ring(lR); 239 251 setring ROut; 240 ideal norid = 0;252 ideal norid = fetch(origR, id); 241 253 ideal normap = maxideal(1); 242 254 export norid; … … 245 257 if(withDelta) 246 258 { 247 result = list(list( ideal(1), poly(1), ROut), 0);259 result = list(list(ROut), list(ideal(1)), list(intvec(0), 0)); 248 260 } 249 261 else 250 262 { 251 result = list(list(ideal(1), poly(1), ROut)); 252 } 263 result = list(list(ROut), list(ideal(1))); 264 } 265 sp = 1; // number of rings in the output 266 option(set, opt); 267 normalOutputText(dbg, withDelta, sp); 253 268 return(result); 254 269 } 255 256 270 //------------------------ preliminary decomposition----------------------- 257 271 list prim; … … 330 344 } 331 345 printlevel = printlevel + 1; 332 norComp = normalM(prim[i], decomp, withDelta );346 norComp = normalM(prim[i], decomp, withDelta, conduOption); 333 347 printlevel = printlevel - 1; 334 348 for(j = 1; j <= size(norComp); j++) … … 434 448 } 435 449 } 436 list resultNew;437 438 450 if(withDelta) 439 451 { … … 444 456 resultNew = list(RL, MG); 445 457 } 446 447 458 sp = size(RL); //RL = list of rings 459 448 460 option(set, opt); 449 461 normalOutputText(dbg, withDelta, sp); 462 return(resultNew); 463 } 464 465 example 466 { "EXAMPLE:"; 467 printlevel = printlevel+1; 468 echo = 2; 469 ring s = 0,(x,y),dp; 470 ideal i = (x2-y3)*(x2+y2)*x; 471 list nor = normal(i, "withDelta", "prim"); 472 nor; 473 474 // 2 branches have delta = 1, and 1 branch has delta = 0 475 // the total delta invariant is 13 476 477 def R2 = nor[1][2]; setring R2; 478 norid; normap; 479 480 echo = 0; 481 printlevel = printlevel-1; 482 pause(" hit return to continue"); echo=2; 483 484 ring r = 2,(x,y,z),dp; 485 ideal i = z3-xy4; 486 list nor = normal(i, "withDelta", "prim"); nor; 487 // the delta invariant is infinite 488 // xy2z/z2 and xy3/z2 generate the integral closure of r/i as r/i-module 489 // in its quotient field Quot(r/i) 490 491 // the normalization as affine algebra over the ground field: 492 def R = nor[1][1]; setring R; 493 norid; normap; 494 } 495 496 /////////////////////////////////////////////////////////////////////////////// 497 // Prints the output text in proc normal. 498 // 499 static proc normalOutputText(int dbg, int withDelta, int sp) 500 // int dbg: printlevel 501 // int withDelta: output contains information about the delta invariant 502 // int sp: number of output rings. 503 { 450 504 if ( dbg >= 0 ) 451 505 { … … 484 538 } 485 539 } 486 return(resultNew);487 540 } 488 541 489 example490 { "EXAMPLE:";491 printlevel = printlevel+1;492 echo = 2;493 ring s = 0,(x,y),dp;494 ideal i = (x2-y3)*(x2+y2)*x;495 list nor = normal(i, "withDelta", "prim");496 nor;497 498 // 2 branches have delta = 1, and 1 branch has delta = 0499 // the total delta invariant is 13500 501 def R2 = nor[1][2]; setring R2;502 norid; normap;503 504 echo = 0;505 printlevel = printlevel-1;506 pause(" hit return to continue"); echo=2;507 508 ring r = 2,(x,y,z),dp;509 ideal i = z3-xy4;510 list nor = normal(i, "withDelta", "prim"); nor;511 // the delta invariant is infinite512 // xy2z/z2 and xy3/z2 generate the integral closure of r/i as r/i-module513 // in its quotient field Quot(r/i)514 515 // the normalization as affine algebra over the ground field:516 def R = nor[1][1]; setring R;517 norid; normap;518 }519 542 520 543 /////////////////////////////////////////////////////////////////////////////// … … 3523 3546 if(noRed == 0){ 3524 3547 resu = list(computeRing(II,prim[i])) + resu; 3525 } else { 3548 } 3549 else 3550 { 3526 3551 resu = list(computeRing(II,prim[i], "noRed")) + resu; 3527 3552 } … … 3932 3957 setring R; 3933 3958 return(R1); 3934 } else { 3959 } 3960 else 3961 { 3935 3962 list L = substpartSpecial(norid,normap); 3936 3963 def lastRing = L[1]; … … 4041 4068 A = lift(pf, ff, u); 4042 4069 Quad = Quad,ideal(newT[jj-1]*newT[ii-1] * u[1, 1]- T*A); 4043 } else { 4070 } 4071 else 4072 { 4044 4073 A = lift(pf,ff); // ff lin. comb. of elts of pf mod I 4045 4074 Quad = Quad,ideal(newT[jj-1]*newT[ii-1] - T*A); … … 4083 4112 } 4084 4113 return(lastRing); 4085 } else { 4114 } 4115 else 4116 { 4086 4117 ideal norid = endid; 4087 4118 ideal normap = endphi; … … 4099 4130 // From here: subprocedures for normal 4100 4131 4101 static proc normalM(ideal I, int decomp, int withDelta ){4132 static proc normalM(ideal I, int decomp, int withDelta, int conduOption){ 4102 4133 // Computes the normalization of a ring R / I using the module structure as far 4103 4134 // as possible. … … 4137 4168 // decomp = 3 (meaning that the ideal is prime). 4138 4169 4170 // conduOption = 0 -> Uses the smallest degree polynomial 4171 // conduOption = i > 0 -> Uses a polynomial in the i-th variable 4172 4139 4173 option("redSB"); 4140 4174 option("returnSB"); … … 4153 4187 I = IM[1]; 4154 4188 ideal IMin = IM[2]; // A minimal set of generators in the groebner basis. 4155 } else { 4189 } 4190 else 4191 { 4156 4192 // The minimal set of generators is not computed by mstd for 4157 4193 // non-global orderings. … … 4191 4227 if(withDelta){ 4192 4228 list output = ideal(1), poly(1), ROut, 0; 4193 } else { 4229 } 4230 else 4231 { 4194 4232 list output = ideal(1), poly(1), ROut; 4195 4233 } … … 4199 4237 4200 4238 // -------------------- election of the conductor ------------------------- 4201 poly condu = getSmallest(J); // Choses the polynomial of smallest degree 4202 // of J as universal denominator. 4239 if(conduOption == 0){ 4240 poly condu = getSmallest(J); // Choses the polynomial of smallest degree 4241 // of J as universal denominator. 4242 } 4243 else 4244 { 4245 poly condu = getOnevar(J, conduOption); 4246 } 4203 4247 if(dbg >= 1){ 4204 4248 ""; … … 4223 4267 // I = I1 \cap I2 4224 4268 printlevel = printlevel + 1; 4225 list nor1 = normalM(Id1, decomp, withDelta )[1];4226 list nor2 = normalM(Id2, decomp, withDelta )[1];4269 list nor1 = normalM(Id1, decomp, withDelta, conduOption)[1]; 4270 list nor2 = normalM(Id2, decomp, withDelta, conduOption)[1]; 4227 4271 printlevel = printlevel - 1; 4228 4272 return(list(nor1, nor2)); … … 4249 4293 if(locAtZero(J)){ 4250 4294 J = maxideal(1); 4251 } else { 4295 } 4296 else 4297 { 4252 4298 J = radical(J); 4253 4299 } 4254 } else { 4300 } 4301 else 4302 { 4255 4303 // We change to global dp ordering. 4256 4304 list rl = ringlist(R); … … 4284 4332 J = fetch(R, J); 4285 4333 J = interred(J); 4286 poly D = getSmallest(J); // Chooses the polynomial of smallest degree as 4287 // non-zerodivisor. 4334 if(conduOption == 0){ 4335 poly D = getSmallest(J); // Chooses the polynomial of smallest degree as 4336 // non-zerodivisor. 4337 } 4338 else 4339 { 4340 poly D = getOnevar(J, conduOption); 4341 } 4288 4342 if(dbg >= 1){ 4289 4343 "The non zero divisor is ", D; … … 4311 4365 printlevel = printlevel + 1; 4312 4366 4313 list nor1 = normalM(Id1, decomp, withDelta )[1];4314 list nor2 = normalM(Id2, decomp, withDelta )[1];4367 list nor1 = normalM(Id1, decomp, withDelta, conduOption)[1]; 4368 list nor2 = normalM(Id2, decomp, withDelta, conduOption)[1]; 4315 4369 printlevel = printlevel - 1; 4316 4370 return(list(nor1, nor2)); … … 4325 4379 J = fetch(Q, J); 4326 4380 printlevel = printlevel + 1; 4327 list result = normalMEqui(I, J, condu, D, withDelta );4381 list result = normalMEqui(I, J, condu, D, withDelta, conduOption); 4328 4382 printlevel = printlevel - 1; 4329 4383 return(list(result)); … … 4543 4597 } 4544 4598 return(newU); 4599 } 4600 4601 /////////////////////////////////////////////////////////////////////////////// 4602 4603 //WARNING - elim is not working here!! Check!! 4604 //It is now replace by computing an eliminating groebner basis. 4605 static proc getOnevar(ideal J, int vari) 4606 { 4607 // Computes the polynomial of smallest degree of J. 4608 // If there are more than one, it chooses the one with smallest number 4609 // of monomials. 4610 def R = basering; 4611 ring RR = 0, (var(3-vari), var(vari)), lp; 4612 ideal J = imap(R, J); 4613 J = groebner(J); 4614 poly D = J[1]; 4615 setring R; 4616 poly D = imap(RR, D); 4617 return(D); 4545 4618 } 4546 4619
Note: See TracChangeset
for help on using the changeset viewer.