Changeset 8f4b23 in git for Singular


Ignore:
Timestamp:
May 19, 2005, 3:32:35 PM (19 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
5c1cb7f29d5ce62aa91dc921b7cb8f34a92fe883
Parents:
cc5e38df80c917c52275aa45b1835bb4f86a0f7f
Message:
*lossen: sres option


git-svn-id: file:///usr/local/Singular/svn/trunk@8241 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/homolog.lib

    rcc5e38 r8f4b23  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: homolog.lib,v 1.17 2005-05-18 15:59:37 Singular Exp $";
     2version="$Id: homolog.lib,v 1.18 2005-05-19 13:32:35 Singular Exp $";
    33category="Commutative Algebra";
    44info="
     
    465465DISPLAY: printlevel >=0: (affine) dimension of Ext^k for each k  (default)
    466466         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
     467NOTE:    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
    469472         is also set for the returned module (accordingly).
    470473EXAMPLE: example Ext_R; shows an example
     
    478481  intvec weightR,ww;
    479482  if ( typeof(attrib(M,"isHomog"))!="string" )
    480   { 
     483  {
     484    weightR=attrib(M,"isHomog");
    481485    withWeight=1;
    482486  }
     
    486490  vector leadCol;
    487491  matrix kb;
     492  module G;
    488493  list L1,L2,L3,L,K;
    489   resolution resl,resm2;
     494  resolution resm2;
    490495  int j,k,max,ii,t1,t2,di,leadComp,shift;
    491496  intvec A1,A2,A3;
     
    497502  for( ii=1; ii<=size(#); ii++ )
    498503  {
    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      }
    503512    }
    504513  }
     
    523532  }
    524533  if( t1==1 )
    525   {
     534  { // compute resolution via sres command
    526535    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); }
    530561  for( ii=1; ii<=s; ii++ )
    531562  {
     
    571602        attrib(m2t,"isHomog",weightR);
    572603        // --------------------------------------------------------------------
     604        ww=0;
    573605        for (j=1; j<=nrows(m2); j++) {
    574606          leadCol = leadmonom(m2t[j]);
  • Singular/LIB/sheafcoh.lib

    rcc5e38 r8f4b23  
    11S///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: sheafcoh.lib,v 1.4 2005-05-19 08:14:51 Singular Exp $";
     2version="$Id: sheafcoh.lib,v 1.5 2005-05-19 13:32:35 Singular Exp $";
    33category="Commutative Algebra";
    44info="
     
    383383///////////////////////////////////////////////////////////////////////////////
    384384
    385 proc sheafCoh(module M,int l,int h)
     385proc sheafCoh(module M,int l,int h,list #)
    386386"USAGE:   sheafCoh(M,l,h);    M module, l,h int
    387387ASSUME:  @code{M} is graded and is either 0 or comes assigned with an
     
    405405NOTE:    The procedure is based on local duality as described in [Eisenbud:
    406406         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.
    408411SEE ALSO: dimH, sheafCohBGG
    409412EXAMPLE: example sheafCoh; shows an example
    410413"
    411414{
     415  int use_sres;
    412416  if( typeof(attrib(M,"isHomog"))!="intvec" ) {
    413417     if (size(M)==0) { attrib(M,"isHomog",0); }
    414418     else { ERROR("No admissible degree vector assigned"); }
     419  }
     420  if (size(#)>0) {
     421    if (#[1]=="sres") { use_sres=1; }
    415422  }
    416423  int i,j;
     
    420427  int col=h-l+1;
    421428  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]; }
    423431  for (i=l; i<=h; i++) {
    424432    N0=L[n+2];   
     
    565573 print(betti(FI),"betti");
    566574 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;
    569581
    570582 LIB "sheafcoh.lib";
Note: See TracChangeset for help on using the changeset viewer.