- Timestamp:
- May 19, 2005, 3:32:35 PM (19 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
- Children:
- 5c1cb7f29d5ce62aa91dc921b7cb8f34a92fe883
- Parents:
- cc5e38df80c917c52275aa45b1835bb4f86a0f7f
- Location:
- Singular/LIB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/homolog.lib
rcc5e38 r8f4b23 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: homolog.lib,v 1.1 7 2005-05-18 15:59:37Singular Exp $";2 version="$Id: homolog.lib,v 1.18 2005-05-19 13:32:35 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 465 465 DISPLAY: printlevel >=0: (affine) dimension of Ext^k for each k (default) 466 466 printlevel >=1: Ak, Ak+1 and kbase of Ext^k in Fk* 467 NOTE: In order to compute Ext^k(M,R) use the command Ext_R(k,syz(M)); 468 If the attribute \"isHomog\" has been set for the input module, it 467 NOTE: In order to compute Ext^k(M,R) use the command Ext_R(k,syz(M));@* 468 By default, the procedure uses the @code{mres} command. If called 469 with the additional parameter @code{\"sres\"}, the @code{sres} command 470 is used instead.@* 471 If the attribute @code{\"isHomog\"} has been set for the input module, it 469 472 is also set for the returned module (accordingly). 470 473 EXAMPLE: example Ext_R; shows an example … … 478 481 intvec weightR,ww; 479 482 if ( typeof(attrib(M,"isHomog"))!="string" ) 480 { 483 { 484 weightR=attrib(M,"isHomog"); 481 485 withWeight=1; 482 486 } … … 486 490 vector leadCol; 487 491 matrix kb; 492 module G; 488 493 list L1,L2,L3,L,K; 489 resolution res l,resm2;494 resolution resm2; 490 495 int j,k,max,ii,t1,t2,di,leadComp,shift; 491 496 intvec A1,A2,A3; … … 497 502 for( ii=1; ii<=size(#); ii++ ) 498 503 { 499 t2=1; // return a list if t2=1 500 if ( (typeof(#[ii])=="string") and (withWeight==0) ) 501 { // NOTE: at this writing, sres does not return weights 502 if ( #[ii]=="sres" ) { t1=1; t2=0; } // use sres instead of mres if t1=1 504 if (typeof(#[ii])=="int") { // return a list if t2=1 505 t2=1; 506 } 507 else { 508 if (typeof(#[ii])=="string") { 509 // NOTE: at this writing, sres does not return weights 510 if ( #[ii]=="sres" ) { t1=1; } // use sres instead of mres if t1=1 511 } 503 512 } 504 513 } … … 523 532 } 524 533 if( t1==1 ) 525 { 534 { // compute resolution via sres command 526 535 if( attrib(M,"isSB")==0 ) { M=std(M); } 527 resl = sres(M,max+1); 528 } 529 else { resl = mres(M,max+1); } 536 list resl = sres(M,max+1); 537 if (withWeight) { 538 // **** at this writing, sres does not return weights, we try to 539 // **** compute them via homog for each syzygy module 540 attrib(resl,"isHomog",weightR); 541 G=resl[1]; 542 attrib(G,"isHomog",weightR); 543 resl[1]=G; 544 for (j=2; j<=size(resl); j++) { 545 if (size(resl[j])!=0) { 546 ww=0; 547 for (k=1; k<=ncols(G); k++) { 548 leadCol = leadmonom(G[k]); 549 leadComp = nrows(leadCol); 550 ww[k] = deg(leadCol)+weightR[leadComp]; 551 } 552 G=resl[j]; 553 attrib(G,"isHomog",ww); 554 resl[j]=G; 555 weightR=ww; 556 } 557 } 558 } 559 } 560 else { resolution resl = mres(M,max+1); } 530 561 for( ii=1; ii<=s; ii++ ) 531 562 { … … 571 602 attrib(m2t,"isHomog",weightR); 572 603 // -------------------------------------------------------------------- 604 ww=0; 573 605 for (j=1; j<=nrows(m2); j++) { 574 606 leadCol = leadmonom(m2t[j]); -
Singular/LIB/sheafcoh.lib
rcc5e38 r8f4b23 1 1 S/////////////////////////////////////////////////////////////////////////////// 2 version="$Id: sheafcoh.lib,v 1. 4 2005-05-19 08:14:51Singular Exp $";2 version="$Id: sheafcoh.lib,v 1.5 2005-05-19 13:32:35 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 383 383 /////////////////////////////////////////////////////////////////////////////// 384 384 385 proc sheafCoh(module M,int l,int h )385 proc sheafCoh(module M,int l,int h,list #) 386 386 "USAGE: sheafCoh(M,l,h); M module, l,h int 387 387 ASSUME: @code{M} is graded and is either 0 or comes assigned with an … … 405 405 NOTE: The procedure is based on local duality as described in [Eisenbud: 406 406 Computing cohomology. In Vasconcelos: Computational methods in 407 commutative algebra and algebraic geometry. Springer (1998)]. 407 commutative algebra and algebraic geometry. Springer (1998)].@* 408 By default, the procedure uses @code{mres} to compute the Ext 409 modules. If called with the additional parameter @code{\"sres\"}, 410 the @code{sres} command is used instead. 408 411 SEE ALSO: dimH, sheafCohBGG 409 412 EXAMPLE: example sheafCoh; shows an example 410 413 " 411 414 { 415 int use_sres; 412 416 if( typeof(attrib(M,"isHomog"))!="intvec" ) { 413 417 if (size(M)==0) { attrib(M,"isHomog",0); } 414 418 else { ERROR("No admissible degree vector assigned"); } 419 } 420 if (size(#)>0) { 421 if (#[1]=="sres") { use_sres=1; } 415 422 } 416 423 int i,j; … … 420 427 int col=h-l+1; 421 428 intmat newBetti[n+1][col]; 422 list L=Ext_R(v,M,1)[2]; // list of GB for Ext_R 429 if (use_sres) { list L=Ext_R(v,M,1,"sres")[2]; } 430 else { list L=Ext_R(v,M,1)[2]; } 423 431 for (i=l; i<=h; i++) { 424 432 N0=L[n+2]; … … 565 573 print(betti(FI),"betti"); 566 574 module F=FI[2]; 567 def A1=sheafCoh(F,-6,6); 568 def A2=sheafCohBGG(F,-6,6); 575 int t=timer; 576 def A1=sheafCoh(F,-8,8); 577 timer-t; 578 t=timer; 579 def A2=sheafCohBGG(F,-8,8); 580 timer-t; 569 581 570 582 LIB "sheafcoh.lib";
Note: See TracChangeset
for help on using the changeset viewer.