Changeset ae6124 in git
- Timestamp:
- Oct 31, 2008, 4:33:07 PM (15 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 78b28b48625d983087e8a0d1c0db9632f68e0320
- Parents:
- e1792782ae1256a5df2ecf6ead8321a3eae8a3e4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/elim.lib
re17927 rae6124 1 // $Id: elim.lib,v 1.23 2008-10-06 17:04:26 Singular Exp $ 2 // (GMG, last modified 22.06.96) 3 /////////////////////////////////////////////////////////////////////////////// 4 version="$Id: elim.lib,v 1.23 2008-10-06 17:04:26 Singular Exp $"; 1 // $Id: elim.lib,v 1.24 2008-10-31 15:33:07 Singular Exp $ 2 /////////////////////////////////////////////////////////////////////////////// 3 version="$Id: elim.lib,v 1.24 2008-10-31 15:33:07 Singular Exp $"; 5 4 category="Commutative Algebra"; 6 5 info=" … … 8 7 9 8 PROCEDURES: 10 blowup0(j[,s1,s2]); create presentation of blownup ring of ideal j 11 elim(id,v); eliminate variables in v from id (ideal/module) 12 elim1(id,p); p=product of vars to be eliminated from id 13 nselect(id,v); select generators not containing variables given by v 14 sat(id,j); saturated quotient of ideal/module id by ideal j 15 select(id,v); select generators containing all variables given by v 16 select1(id,v); select generators containing one variable given by v 17 9 blowup0(j[,s1,s2]); create presentation of blownup ring of ideal j 10 elim(id,..); variables .. eliminated from id (ideal/module) 11 elim1(id,p); p=product of vars to be eliminated from id 12 nselect(id,v); select generators not containing variables given by v 13 sat(id,j); saturated quotient of ideal/module id by ideal j 14 select(id,v]); select generators containing all variables given by v 15 select1(id,v); select generators containing one variable given by v 18 16 (parameters in square brackets [] are optional) 19 17 "; … … 227 225 } 228 226 /////////////////////////////////////////////////////////////////////////////// 229 230 227 proc elim1 (id, poly vars) 231 228 "USAGE: elim1(id,p); id ideal/module, p product of vars to be eliminated 232 229 RETURN: ideal/module obtained from id by eliminating vars occuring in poly 233 NOTE: no special monomial ordering is required, result is a SB with 234 respect to ordering dp (resp. ls) if the first var not to be 235 eliminated belongs to a -p (resp. -s) blockordering 230 METHOD: elim1 calls eliminate but in a ring with ordering dp (resp. ls) 231 if the first var not to be eliminated belongs to a -p (resp. -s) 232 ordering. 233 NOTE: no special monomial ordering is required. 236 234 This proc uses 'execute' or calls a procedure using 'execute'. 237 235 SEE ALSO: elim, eliminate … … 239 237 " 240 238 { 239 def br = basering; 240 if ( size(ideal(br)) != 0 ) 241 { 242 ERROR ("cannot eliminate in a qring"); 243 } 241 244 //---- get variables to be eliminated and create string for new ordering ------ 242 245 int ii; … … 248 251 if( ord(p)>0 ) { string ordering = "),dp;"; } 249 252 //-------------- create new ring and map objects to new ring ------------------ 250 def br = basering;251 253 string str = "ring @newr = ("+charstr(br)+"),("+varstr(br)+ordering; 252 254 execute(str); … … 267 269 } 268 270 /////////////////////////////////////////////////////////////////////////////// 269 270 proc nselect (id_inp, intvec v) 271 "USAGE: nselect(id,v); id = module or ideal, v = intvec 272 RETURN: generators of id not containing the variables with indexan entry of v271 proc nselect (id, intvec v) 272 "USAGE: nselect(id,v); id = ideal, module or matrix, v = intvec 273 RETURN: generators (or columns) of id not containing the variables with index 274 an entry of v 273 275 SEE ALSO: select, select1 274 276 EXAMPLE: example nselect; shows examples 275 " 276 { 277 if (typeof(id_inp)!="ideal") { module id=module(id_inp); } 278 else { ideal id=id_inp; } 279 int j,k; 280 int n,m = size(v), ncols(id); 281 //listvar(id); 282 for( k=1; k<=m; k++ ) 283 { 284 for( j=1; j<=n; j++ ) 285 { 286 if( size(id[k]/var(v[j]))!=0 ) 287 { 288 id[k]=0; break; 289 } 290 } 291 } 292 //if(typeof(id)=="ideal") { return(simplify(id,2)); } 293 //return(simplify(module(id),2)); 294 id=(simplify(module(id),2)); 295 //listvar(id); 296 return(id); 297 //return(simplify(id,2)); 277 "{ 278 if (typeof(id)!="ideal") 279 { 280 if (typeof(id)=="module" || typeof(id)=="matrix") 281 { 282 module id1 = module(id); 283 } 284 else 285 { 286 ERROR("// *** input must be of type ideal or module or matrix"); 287 } 288 } 289 else 290 { 291 ideal id1 = id; 292 } 293 int j,k; 294 int n,m = size(v), ncols(id1); 295 for( k=1; k<=m; k++ ) 296 { 297 for( j=1; j<=n; j++ ) 298 { 299 if( size(id1[k]/var(v[j]))!=0 ) 300 { 301 id1[k]=0; break; 302 } 303 } 304 } 305 id1=simplify(id1,2); 306 if(typeof(id)=="matrix") 307 { 308 return(matrix(id1)); 309 } 310 return(id1); 298 311 } 299 312 example … … 303 316 nselect(i,3); 304 317 module m=i*(gen(1)+gen(2)); 305 show(m); 306 show(nselect(m,3..4)); 318 m; 319 nselect(m,3..4); 320 nselect(matrix(m),3..4); 307 321 } 308 322 /////////////////////////////////////////////////////////////////////////////// … … 347 361 } 348 362 /////////////////////////////////////////////////////////////////////////////// 349 350 363 proc select (id, intvec v) 351 "USAGE: select(id,n[,m]); id = ideal/module, v= intvec 352 RETURN: generators of id containing all variables with index an entry of v 353 NOTE: use 'select1' for selecting generators containing at least one of the 354 variables with index an entry of v 364 "USAGE: select(id,n[,m]); id = ideal/module/matrix, v = intvec 365 RETURN: generators/columns of id containing all variables with index 366 an entry of v 367 NOTE: use 'select1' for selecting generators/columns containing at least 368 one of the variables with index an entry of v 355 369 SEE ALSO: select1, nselect 356 370 EXAMPLE: example select; shows examples 357 371 "{ 372 if (typeof(id)!="ideal") 373 { 374 if (typeof(id)=="module" || typeof(id)=="matrix") 375 { 376 module id1 = module(id); 377 } 378 else 379 { 380 ERROR("// *** input must be of type ideal or module or matrix"); 381 } 382 } 383 else 384 { 385 ideal id1 = id; 386 } 358 387 int j,k; 359 int n,m = size(v), ncols(id );388 int n,m = size(v), ncols(id1); 360 389 for( k=1; k<=m; k++ ) 361 { 390 { 362 391 for( j=1; j<=n; j++ ) 363 { 364 if( size(id [k]/var(v[j]))==0)365 { 366 id [k]=0; break;392 { 393 if( size(id1[k]/var(v[j]))==0) 394 { 395 id1[k]=0; break; 367 396 } 368 397 } 369 398 } 370 return(simplify(id,2)); 399 if(typeof(id)=="matrix") 400 { 401 return(matrix(simplify(id1,2))); 402 } 403 return(simplify(id1,2)); 371 404 } 372 405 example … … 379 412 m; 380 413 select(m,1..2); 414 select(matrix(m),1..2); 381 415 } 382 416 /////////////////////////////////////////////////////////////////////////////// 383 417 384 418 proc select1 (id, intvec v) 385 "USAGE: select1(id,v); id = ideal/module , v = intvec386 RETURN: generators of id containing at least one of the variables with387 index an entry of v388 NOTE: use 'select' for selecting generators containing all the389 variableswith index an entry of v419 "USAGE: select1(id,v); id = ideal/module/matrix, v = intvec 420 RETURN: generators/columns of id containing at least one of the variables 421 with index an entry of v 422 NOTE: use 'select' for selecting generators/columns containing all variables 423 with index an entry of v 390 424 SEE ALSO: select, nselect 391 425 EXAMPLE: example select1; shows examples 392 426 "{ 427 if (typeof(id)!="ideal") 428 { 429 if (typeof(id)=="module" || typeof(id)=="matrix") 430 { 431 module id1 = module(id); 432 module I; 433 } 434 else 435 { 436 ERROR("// *** input must be of type ideal or module or matrix"); 437 } 438 } 439 else 440 { 441 ideal id1 = id; 442 ideal I; 443 } 393 444 int j,k; 394 int n,m = size(v), ncols(id); 395 execute (typeof(id)+" I;"); 445 int n,m = size(v), ncols(id1); 396 446 for( k=1; k<=m; k++ ) 397 447 { for( j=1; j<=n; j++ ) 398 448 { 399 if( size(subst(id [k],var(v[j]),0)) != size(id[k]) )400 { 401 I = I,id [k]; break;449 if( size(subst(id1[k],var(v[j]),0)) != size(id1[k]) ) 450 { 451 I = I,id1[k]; break; 402 452 } 403 453 } 404 454 } 405 return(simplify(I,2)); 455 I=simplify(I,2); 456 if(typeof(id)=="matrix") 457 { 458 return(matrix(I)); 459 } 460 return(I); 406 461 } 407 462 example … … 409 464 ring r=0,(x,y,t,s,z),(c,dp); 410 465 ideal i=x-y,y-z2,z-t3,s-x+y3; 411 ideal j=select1(i,1); 412 j; 413 module m=i*(gen(1)+gen(2)); 414 m; 466 ideal j=select1(i,1);j; 467 module m=i*(gen(1)+gen(2)); m; 415 468 select1(m,1..2); 416 } 417 /////////////////////////////////////////////////////////////////////////////// 469 select1(matrix(m),1..2); 470 } 471 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.