Changeset e9478b in git for Singular


Ignore:
Timestamp:
Jul 9, 2015, 12:28:29 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
38301d00726a0671f6dbc3f82923b5c9f6964c5d8af20e00f50d423ec4162319c3d9f63fdc7e796f
Parents:
ba52f58eed2a6367c0d09410b064a3fdc2c7170f
Message:
format
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gradedModules.lib

    rba52f58 re9478b  
    3131    grsum(M,N)      direct sum of two graded modules coker(M) + coker(N)
    3232    grpower(M,p)    direct p-th power of graded module coker(M)
    33     grtranspose(M)  un-ordered graded transpose of map M       
     33    grtranspose(M)  un-ordered graded transpose of map M
    3434    grgens(M)       try to compute submodule generators of coker(M)
    3535    grpres(F)       presentation of submodule generated by columns of F
     
    5151    mappingcone(M,N)   mapping cone?
    5252    grlifting3(A,B)    RND! chain lifting? probably wrong one
    53     mappingcone3(A,B)  mapping cone3? 
     53    mappingcone3(A,B)  mapping cone3?
    5454    grrange(M)         get the row-weightings
    5555    grneg(A)           graded object given by -A
    5656    matrixpres(a)      matrix presentation of direct sum of Omega^{a[i]}(i)
    5757";
    58    
     58
    5959//    grisequal(A,B)  check whether A is exactly eqal to B? TODO: isomorphic!
    6060
     
    8686
    8787  v = -v; // NOTE: due to Mathematical meanings of Singular data
    88  
     88
    8989
    9090  int lst = v[1];
    91   int cnt = 1; 
     91  int cnt = 1;
    9292
    9393  string p = R;
     
    9595
    9696  int k, d;
    97   for (k = 2; k <= n; k++ ) 
     97  for (k = 2; k <= n; k++ )
    9898  {
    9999    d = v[k];
    100100    if( d == lst ) { cnt = cnt + 1; }
    101     else 
     101    else
    102102    {
    103103      if (cnt > 1){ p = p + "^" + string(cnt); }
     
    120120  def E = grtwist(2, 0);
    121121  def v = grrange(E); // grdeg(E);
    122   grsumstr("", v ); 
     122  grsumstr("", v );
    123123}
    124124
     
    180180  {
    181181    int n = size(N); ASSUME(0, n > 0);
    182    
     182
    183183    string msg1 = "";
    184184    if( size(R) >= 2 )
     
    186186      msg1 = msg1 + "(let R:="+R+")";
    187187      R = "R"; // !!!
    188     }   
     188    }
    189189    msg1 = msg1 + ": " ;
    190190
    191    
     191
    192192
    193193    list arr; arr[n] = list();
    194194    int exact = (1==1);
    195    
     195
    196196    int i = 1;
    197    
     197
    198198    ASSUME(1, grtest(N[i]));
    199    
     199
    200200    string dst = grsumstr(R, grrange(N[i]));
    201201    string src = grsumstr(R, grdeg(N[i]));
    202    
     202
    203203    arr[i] = list(dst,  src);
    204204
    205205    i = i + 1;
    206    
     206
    207207    while( i <= n )
    208208    {
    209209      ASSUME(1, grtest(N[i]));
    210      
     210
    211211      dst = grsumstr(R, grrange(N[i]));
    212      
     212
    213213      if( exact && (src != dst) )
    214214      {
     
    218218
    219219      src = grsumstr(R, grdeg(N[i]));
    220      
     220
    221221      arr[i] = list(dst,  src);
    222222
     
    236236        msg = msg + newline + arr[i][1] + " <-- "+o+"_" + string(i) + " --";
    237237      };
    238      
     238
    239239      msg =  msg + newline + arr[n][2];
    240       msg = msg + ", given by maps: "; 
     240      msg = msg + ", given by maps: ";
    241241    } else
    242242    {
    243243//      print(arr);
    244244
    245       msg = msg + "-object collection";     
     245      msg = msg + "-object collection";
    246246      o = "o";
    247      
     247
    248248//      for( i = 1; i <= n; i++ )
    249249//      {
    250250//        msg = msg + newline + arr[i][1] + " <-- "+o+"_" + string(i) + " -- " + arr[i][2];
    251 //      };     
    252       msg = msg + ", given by the following maps (named here as "+o+"_[1 .. "+string(n)+"]): "; 
     251//      };
     252      msg = msg + ", given by the following maps (named here as "+o+"_[1 .. "+string(n)+"]): ";
    253253    }
    254254
     
    257257
    258258    for( i = 1; i <= size(N); i++ )
    259     { 
     259    {
    260260      print( o+"_" + string(i) + " :" );
    261       grview( N[i] ); 
     261      grview( N[i] );
    262262    };
    263263
     
    268268
    269269  ASSUME(1, grtest(N) );
    270  
     270
    271271  msg = msg + " homomorphism";
    272272  if( size(R) >= 2 )
     
    280280  intvec gr = grrange(N); // grading weights?
    281281  string dst = grsumstr(R, gr);
    282  
     282
    283283  intvec G = grdeg(N);
    284284  string src = grsumstr(R, G);
    285  
     285
    286286  if( ncols(N) == 0 )
    287287  {
    288288    src = "0";
    289   } 
     289  }
    290290
    291291  lst = msg;
    292292
    293   if( (size(lst) + size(dst) + size(src) + 4) > 80 ) 
    294   { 
     293  if( (size(lst) + size(dst) + size(src) + 4) > 80 )
     294  {
    295295    if( (size(lst) + size(dst)) > 80 ) { msg = msg + newline; lst = ""; }
    296296
     
    312312//  lst = lst + ", given by ";
    313313
    314  
     314
    315315  int nc = ncols(N); int nr = nrows(N);
    316316
     
    323323  {
    324324    ASSUME(0, nc > 0);
    325    
     325
    326326    matrix M = module(N);
    327    
     327
    328328    int r,c;
    329329    int d = 1; // number of extra cols/rows for extra info around the central degree(N) block in D
     
    361361      }
    362362
    363     } else 
    364     { 
     363    } else
     364    {
    365365      msg = msg + "a matrix";
    366366    }
    367367
    368     print(msg + ", with degrees: " );   
    369     draw(D, d); // print it nicely!   
     368    print(msg + ", with degrees: " );
     369    draw(D, d); // print it nicely!
    370370  }
    371371}
     
    462462"
    463463{
    464   ASSUME(1, grtest(M) ); 
    465  
     464  ASSUME(1, grtest(M) );
     465
    466466  if ( typeof(attrib(M, "degHomog")) == "intvec" )
    467467  {
     
    469469
    470470    if( size(t) == 0 ){ return (t); } // ZERO!
    471    
     471
    472472    ASSUME(2, ncols(M) == size(t) );
    473473    return (t);
     
    629629  "Input degrees: "; grview(I);
    630630
    631   def RR = grres(I, 0, 1); list L = RR; 
     631  def RR = grres(I, 0, 1); list L = RR;
    632632
    633633  " = Non-minimal betti numbers: "; print(betti(L, 0), "betti");
     
    830830
    831831  ring r=32003,(x,y,z),dp;
    832  
     832
    833833  grview( grtwists ( intvec(-4, 1, 6 )) );
    834834
     
    843843"
    844844{
    845   ASSUME(0, a > 0); 
     845  ASSUME(0, a > 0);
    846846  def Z = grtwists( intvec(d:a) ); // will set the rank as well
    847847//  ASSUME(2, grisequal(Z, grpower( grshift(grzero(), d), a ) )); // optional check
     
    931931
    932932  def SS = grobj(S, c, dc);
    933  
     933
    934934  ASSUME(0, size( grrange(SS) ) == (size(a) + size(b)) );
    935935  ASSUME(0, size( grdeg(SS) ) == (size(da) + size(db)) );
    936936  ASSUME(0, ncols( SS ) == size( grdeg(SS) ) );
    937937  ASSUME(0, nrows( SS ) == size( grrange(SS) ) );
    938  
     938
    939939  return(SS);
    940940}
     
    984984{
    985985  ASSUME(1, grtest(M) );
    986            
    987            
     986
     987
    988988
    989989  intvec a = grrange(M);
     
    993993  {
    994994    "!! Warning: shifting '0 <- 0' leaves it as it unchanged!";
    995     return (M);   
    996   }
    997  
     995    return (M);
     996  }
     997
    998998  a = a - intvec(d:size(a));
    999999  t = t - intvec(d:size(t));
     
    10561056{
    10571057  ASSUME(0, size(w) >= nrows(A) );
    1058  
     1058
    10591059  module M = module(A);
    10601060
     
    10631063
    10641064  intvec @ww = 0:0;
    1065  
     1065
    10661066  if( size(#) > 0 )
    10671067  {
    10681068    ASSUME(0, typeof(#[1]) == "intvec" );
    1069    
     1069
    10701070    @ww = intvec( #[1] );
    10711071
     
    10771077      }
    10781078    }
    1079    
     1079
    10801080    ASSUME(0, size(@ww) == ncols(M) );
    10811081  }
     
    10911091        M = freemodule(0);
    10921092      }
    1093      
     1093
    10941094      attrib( M, "rank", size(w) );
    10951095      attrib( M, "isHomog", w );
    1096      
     1096
    10971097//      ASSUME(0, /* PROBLEM WITH ZERO COLUMNS / THEIR DEGREES! */ (ncols(M) == 0) );
    10981098    }
    10991099  }
    1100  
     1100
    11011101//  type(@ww);  type(M);
    1102  
     1102
    11031103  ASSUME(0, size(@ww) == ncols(M) ); // ?!
    1104  
     1104
    11051105  attrib(M, "degHomog", @ww);
    11061106
     
    11321132  grview( grobj( freemodule(0), intvec(1,2,3) ) );
    11331133
    1134   matrix z1[0][3]; grview( grobj( z1, 0:0, intvec(1,2,3) ) ); 
     1134  matrix z1[0][3]; grview( grobj( z1, 0:0, intvec(1,2,3) ) );
    11351135  grview( grobj( freemodule(0), 0:0, intvec(1,2,3) ) );
    11361136
    11371137  matrix z0[0][0]; grview( grobj( z0, 0:0 ) );
    11381138  grview( grobj( freemodule(0), 0:0 ) );
    1139  
    1140  
     1139
     1140
    11411141
    11421142}
     
    11451145"USAGE:  grtest(M[,b]), anyting M, optionally int b
    11461146RETURN:  1 if M is a valid graded object, 0 otherwise
    1147 PURPOSE: validate a graded object. Print an invalid object message if b is not given 
     1147PURPOSE: validate a graded object. Print an invalid object message if b is not given
    11481148NOTE: M should be an ideal or module or matrix, with weighting attribute
    11491149   'isHomog' and optionally total graded degrees attribute 'degHomog'.
     
    11691169  if ( nrows(N) != size(gr) )
    11701170  {
    1171     if(b) { "   ? grtest: Input has wrong number of rows!"; };   
     1171    if(b) { "   ? grtest: Input has wrong number of rows!"; };
    11721172    return (0);
    11731173  };
     
    11771177    return(1);
    11781178  }
    1179  
     1179
    11801180//  if( attrib(N, "rank") != size(gr) ){ return (0); } // wrong rank :(
    11811181
     
    11891189      return (1);
    11901190    }
    1191    
     1191
    11921192    if ( ncols(N) != size(T) )
    11931193    {
    1194       if(b) { "   ? grtest: Input has wrong number of cols!"; };   
     1194      if(b) { "   ? grtest: Input has wrong number of cols!"; };
    11951195      return (0);
    11961196    };
    1197    
     1197
    11981198    int k = nvars(basering) + 1; // index of mod. column in the leadexp
    11991199
     
    12591259{
    12601260  ASSUME(0, d >= 0 );
    1261  
     1261
    12621262  if( d == 0 ) { return (A); }
    1263  
     1263
    12641264  if( ncols(A) == 0 )
    12651265  {
    12661266    matrix B[nrows(A) + d][0];
    1267     return (B);   
    1268   }
    1269  
     1267    return (B);
     1268  }
     1269
    12701270  module T; T[d] = 0;
    12711271  T = T, module(transpose(A));
     
    12811281  matrix m[0][2];
    12821282  type( align(m, 3) );
    1283 } 
     1283}
    12841284
    12851285
     
    13021302  module A = grobj( module([x+y, x, 0, 0], [0, x+y, y, 0]), intvec(0,0,0,1) );
    13031303  grview(A);
    1304  
     1304
    13051305  module B = grgroebner(A);
    13061306  grview(B);
     
    13241324  ring r=32003,(x,y,z),dp;
    13251325
    1326   module A = grgroebner( grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ) ); 
     1326  module A = grgroebner( grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ) );
    13271327  grview(A);
    1328  
     1328
    13291329  grview(grsyz(A));
    1330  
    1331   module X = grgroebner( grobj( module([x]), intvec(2) ) ); 
     1330
     1331  module X = grgroebner( grobj( module([x]), intvec(2) ) );
    13321332  grview(X);
    13331333
    13341334  // syzygy module should be zero!
    13351335  grview(grsyz(X));
    1336  
    1337  
     1336
     1337
    13381338}
    13391339
     
    13511351  intvec a = grdeg(A);
    13521352  intvec b = grrange(B);
    1353  
     1353
    13541354  ASSUME(0, (size(a) == size(b)) && (a == b));  // == for intvec :(
    13551355
     
    13611361  ring r=32003,(x,y,z),dp;
    13621362
    1363   module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ); 
     1363  module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) );
    13641364  grview(A);
    1365  
     1365
    13661366  A = grgroebner(A);
    13671367  grview(A);
    1368  
     1368
    13691369  module B = grsyz(A);
    13701370  grview(B);
    13711371  print(B);
    1372  
     1372
    13731373  module D = grprod( A, B );
    13741374  grview(D);
     
    13841384"USAGE:  grres(M, l[, b]), graded object M, int l, int b
    13851385RETURN:  graded resolution = list of graded objects
    1386 PURPOSE: compute graded resolution of M (of length l) and minimise it if b was given                             
     1386PURPOSE: compute graded resolution of M (of length l) and minimise it if b was given
    13871387EXAMPLE: example grres; shows an example
    13881388"
     
    13921392
    13931393  intvec v = grrange(A);
    1394  
     1394
    13951395  int b = (size(#) > 0);
    13961396  if(b) { list r = res(A, l, #[1]); } else { list r = res(A, l); }
    13971397
    13981398  l = size(r);
    1399  
     1399
    14001400  int i;
    1401  
     1401
    14021402  for ( i = 1; i <= l; i++ )
    14031403  {
     
    14111411    r[i] = grobj(r[i], v); v = grdeg(r[i]);
    14121412  }
    1413  
     1413
    14141414  i = i-1;
    14151415
     
    14211421  ring r=32003,(x,y,z),dp;
    14221422
    1423   module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ); 
     1423  module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) );
    14241424  grview(A);
    1425  
     1425
    14261426  module B = grgroebner(A);
    14271427  grview(B);
     
    14381438RETURN:  graded object
    14391439PURPOSE: graded transpose of M
    1440 NOTE:    no reordering is performend by this procedure   
     1440NOTE:    no reordering is performend by this procedure
    14411441EXAMPLE: example grtranspose; shows an example
    14421442"
     
    14571457
    14581458  module K = grsyz( L ); grview(K);
    1459  
     1459
    14601460
    14611461  // Corner cases: 0 <- 0!
     
    14631463  grview( grtranspose( Z ) );
    14641464
    1465  
     1465
    14661466  // Corner cases: * <- 0
    14671467  matrix M1[3][0];
    1468  
     1468
    14691469  module Z1 = grobj( M1, intvec(-1, 0, 1) ); grview(Z1);
    14701470  grview( grtranspose( Z1 ) );
    1471  
    1472  
     1471
     1472
    14731473  // Corner cases: 0 <- *
    14741474  matrix M2[0][3];
     
    14761476  module Z2 = grobj( M2, 0:0, intvec(-1, 0, 1) ); grview(Z2);
    14771477  grview( grtranspose( Z2 ) );
    1478  
     1478
    14791479}
    14801480
     
    14821482proc grgens(def M)
    14831483"USAGE:   grgens(M), graded object M (map)
    1484 RETURN:  graded object 
     1484RETURN:  graded object
    14851485PURPOSE: try compute graded generators of coker(M) and return them as columns
    14861486         of a graded map.
     
    14921492
    14931493  module N = grtranspose( grsyz( grtranspose(M) ) );
    1494  
     1494
    14951495//  ASSUME(3, grisequal( grgroebner(M), grgroebner( grpres( N ) ) ) ); // FIXME: not always true!?
    1496  
     1496
    14971497  return ( N );
    14981498}
     
    15051505
    15061506  module N = grgens(M);
    1507  
     1507
    15081508  grview( N ); print(N); // fine == M
    15091509
    15101510
    1511   module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ); 
     1511  module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) );
    15121512
    15131513  A = grgroebner(A); grview(A);
     
    15181518
    15191519  grview( grgens( grzero() ) );
    1520  
     1520
    15211521}
    15221522
     
    15341534
    15351535//  ASSUME(3, grisequal( M, grgens( N ) ) );
    1536  
     1536
    15371537  return ( N );
    15381538}
     
    15451545  grview(A);
    15461546
    1547   "graded transpose: "; def B = grtranspose(A); grview( B ); print(B); 
     1547  "graded transpose: "; def B = grtranspose(A); grview( B ); print(B);
    15481548
    15491549  "... syzygy: "; def C = grsyz(B); grview(C);
     
    15531553  "... and back to presentation: "; def E = grsyz( D ); grview(E); print(E);
    15541554
    1555   def F = grgens( E ); grview(F); print(F); 
     1555  def F = grgens( E ); grview(F); print(F);
    15561556  def G = grpres( F ); grview(G); print(G);
    15571557
    15581558
    15591559  def M = grtwists( intvec(-2, 0, 4, 4) ); grview(M);
    1560  
     1560
    15611561  def N = grgens(M); grview( N ); print(N);
    1562  
    1563   def L = grpres( N ); grview( L ); print(L); 
     1562
     1563  def L = grpres( N ); grview( L ); print(L);
    15641564}
    15651565
     
    16521652  module N;
    16531653
    1654   if(i>n) 
     1654  if(i>n)
    16551655    { // no middle part
    16561656      if(a[1]>0)
     
    16591659
    16601660          if(a[n+1]>0)
    1661             { N=grsum(N,grtwist(a[n+1],-1));}       
    1662         } 
     1661            { N=grsum(N,grtwist(a[n+1],-1));}
     1662        }
    16631663      else
    16641664        { N=grtwist(a[n+1],-1);}
    1665      
    1666       return (N); // grorder(N)); 
     1665
     1666      return (N); // grorder(N));
    16671667    }
    1668   else // i <= n: middle part is present, a_i != 0 
     1668  else // i <= n: middle part is present, a_i != 0
    16691669    { // a = a1  ... |  i:2, a_2 ..... i: n, a_n | .... i: n+1a_(n+1)
    16701670      j = i - 1;
     
    16971697
    16981698
    1699       return ((N)); //      return (grorder(N)); 
     1699      return ((N)); //      return (grorder(N));
    17001700    }
    17011701}
     
    17041704  ring r = 32003,(x(0..4)),dp;
    17051705
    1706   def N1 = KeneshlouMatrixPresentation(intvec(2,0,0,0,0)); 
     1706  def N1 = KeneshlouMatrixPresentation(intvec(2,0,0,0,0));
    17071707  grview(N1);
    17081708
     
    17381738  ASSUME(1, grtest(B));
    17391739  ASSUME(0, grrange(A)==grrange(B));
    1740  
     1740
    17411741  intvec v = grrange(A);
    17421742  intvec w=grdeg(A),grdeg(B);
     
    17461746{ "EXAMPLE:"; echo = 2;
    17471747  ring r;
    1748  
     1748
    17491749  module R=grobj(module([x,y,z]),intvec(0:3));
    17501750  grview(R);
     
    17711771//  matrix U;
    17721772  matrix L =lift(A,B/*,U*/);  //  module(B*U) = module(matrix(A)*L)
    1773  
     1773
    17741774  return(grobj(L, grdeg(A), grdeg(B)));
    17751775}
     
    17821782
    17831783
    1784   module D=grobj(module([y,0,z],[x2+y2,z,0]),intvec(0,1,0)); 
     1784  module D=grobj(module([y,0,z],[x2+y2,z,0]),intvec(0,1,0));
    17851785  grview(D);
    17861786
     
    17881788  grview(G);
    17891789
    1790   ASSUME(0, grisequal( grprod(D, G), P) ); 
     1790  ASSUME(0, grisequal( grprod(D, G), P) );
    17911791}
    17921792
     
    18071807
    18081808  module Z = grobj(freemodule(0),intvec(0:0),intvec(0:0));
    1809  
     1809
    18101810  grrange(Z);
    18111811  grdeg(Z);
    1812  
     1812
    18131813  grview(Z);
    18141814
     
    18381838       grtranspose( grprod( N,  alpha1 ) ) )
    18391839       ) ); // alpha0!
    1840    
     1840
    18411841}
    18421842example
     
    18991899
    19001900  ASSUME(0, t >= 2);
    1901  
     1901
    19021902  list P;
    19031903
    19041904  "t: ", t;
    1905  
     1905
    19061906  P[1]= grrndmap( rM[1], rN[1] ); // alpha1
    19071907
    1908   if(t==2){return(P[1]);} 
    1909    
     1908  if(t==2){return(P[1]);}
     1909
    19101910  for(k=2; k<=t; k++)
    19111911  {
    1912     P[k] = grlift( grprod(P[k-1],rM[k]), rN[k] ); 
    1913      grview(P[k]); 
    1914    
    1915   }
    1916      
     1912    P[k] = grlift( grprod(P[k-1],rM[k]), rN[k] );
     1913     grview(P[k]);
     1914
     1915  }
     1916
    19171917  return(P);
    1918    
     1918
    19191919}
    19201920example
     
    19231923  ring r=32003,(x,y,z),dp;
    19241924
    1925   module P=grobj(module([xy,0,xz]),intvec(0,1,0)); 
     1925  module P=grobj(module([xy,0,xz]),intvec(0,1,0));
    19261926  grview(P);
    19271927
    1928   module D=grobj(module([y,0,z],[x2+y2,z,0]),intvec(0,1,0)); 
     1928  module D=grobj(module([y,0,z],[x2+y2,z,0]),intvec(0,1,0));
    19291929  grview(D);
    19301930
     
    19371937  module D=grobj(module([y,0,z],[x2+y2,z,0], [z3, xy, xy2]),intvec(0,1,0));
    19381938  D = grgroebner(D);
    1939   grview( grres(D, 0)); 
     1939  grview( grres(D, 0));
    19401940
    19411941  def G=grlifting(D, D);
     
    19511951  def M = KeneshlouMatrixPresentation(intvec(0,0,1,0));
    19521952  grview( grres(M, 0) );
    1953  
     1953
    19541954//   module N = grshift(kos[3], 1); // psi, Syz_2(K(1))
    19551955  def N = KeneshlouMatrixPresentation(intvec(0,1,0,0));
     
    19661966proc mappingcone(M,N)
    19671967"USAGE: mappingcone(M,N), M,N graded objects
    1968 RETURN: chain complex (as a list) 
     1968RETURN: chain complex (as a list)
    19691969PURPOSE: construct a free resolution of the cokernel of a random map between Img(M), and Img(N).
    19701970EXAMPLE: example mappingcone; shows an example
     
    20262026
    20272027// correct
    2028 proc grrndmap(def S, def D, list #) 
     2028proc grrndmap(def S, def D, list #)
    20292029"USAGE: grrndmap(S,D), graded objects S and D
    20302030RETURN: graded object
     
    20922092// 0<---M<----F0<----F1<----F2<----F3<----
    20932093//              |p1   |p2
    2094 // 
     2094//
    20952095// 0<---N<----G0<----G1<----G2<----G3<----
    20962096//                B(g1)      g2     g3
    2097 // 
     2097//
    20982098proc grlifting2(A,B)
    20992099"USAGE: grlifting2(A,B), graded objects A and B (matrices defining maps)
    2100 RETURN: map of chain complexes (as a list) 
     2100RETURN: map of chain complexes (as a list)
    21012101PURPOSE: construct a map of chain complexes between free resolution of
    21022102M=coker(A) and N=coker(B).
     
    21272127  P[1]=grrndmap2(A,B);
    21282128
    2129   // A(or B)=0 
     2129  // A(or B)=0
    21302130  if(t==1){return(P[1])};
    2131  
     2131
    21322132  for(k=2;k<=t;k++)
    21332133  {
     
    21612161def T=grlifting2(DD,PP); T;
    21622162
    2163 // def Z=grlifting2(P,D); Z; // WRONG!!! 
    2164              
     2163// def Z=grlifting2(P,D); Z; // WRONG!!!
     2164
    21652165}
    21662166
     
    21712171proc mappingcone2(A,B)
    21722172"USAGE: mappingcone2(A,B), graded objects A and B (matrices defining maps)
    2173 RETURN: chain complex (as a list) 
     2173RETURN: chain complex (as a list)
    21742174PURPOSE: construct the free resolution of a cokernel of a random map between M=coker(A), and N=coker(B)
    21752175EXAMPLE: example mappingcone2;
     
    22342234*/
    22352235
    2236 proc grlifting3(A,B) 
     2236proc grlifting3(A,B)
    22372237"TODO: grlifting4 was newer and had more documentation than this proc, but was removed... Please verify and update!
    22382238"
     
    22472247  list rN = grres(B,0,1);
    22482248  print( betti(rN), "betti");
    2249  
     2249
    22502250  int i,j,k;
    22512251
     
    22602260  }
    22612261  int t=min(i,j);
    2262  
     2262
    22632263  list P;
    22642264
    22652265  "t: ", t;
    22662266//  grview(rM[t]);  grview(rN[t]);
    2267  
     2267
    22682268  P[t]= grrndmap2(rM[t],rN[t]);
    22692269  grview(P[t]);
     
    23122312//def I=KeneshlouMatrixPresentation(intvec(2,3,0,6,2));
    23132313//def J=KeneshlouMatrixPresentation(intvec(4,0,1,2,1));
    2314 //def N=grlifting3(I,J); grview(N); 
     2314//def N=grlifting3(I,J); grview(N);
    23152315}
    23162316
     
    23182318"USAGE: grneg(A), graded object A
    23192319RETURN: graded object
    2320 PURPOSE: graded map defined by -A 
     2320PURPOSE: graded map defined by -A
    23212321EXAMPLE: example grneg; shows an example
    23222322"
     
    23412341proc mappingcone3(A,B)
    23422342"USAGE: mappingcone3(A,B), graded objects A and B (matrices defining maps)
    2343 RETURN: chain complex (as a list) 
     2343RETURN: chain complex (as a list)
    23442344PURPOSE: construct a free resolution of the cokernel of a random map between M=coker(A), and N=coker(B)
    23452345EXAMPLE: example mappingcone3; shows an example
     
    23762376
    23772377    T[i]=grtranspose(D);
    2378    
     2378
    23792379    kill A, B, C, D, v, w, r, s, zero;
    23802380  }
     
    23942394def F=grlifting3(A,T); grview(F);
    23952395
    2396 // BUG in the proc 
     2396// BUG in the proc
    23972397def G=mappingcone3(A,T); grview(G);
    23982398
     
    24032403ideal P=groebner(flatten(U[2]));
    24042404resolution L=mres(P,0);
    2405 print(betti(L),"betti");   
     2405print(betti(L),"betti");
    24062406*/
    24072407
     
    24212421def I=KeneshlouMatrixPresentation(intvec(2,3,0,6,2));
    24222422def J=KeneshlouMatrixPresentation(intvec(4,0,1,2,1));
    2423 // def N=grlifting3(I,J); 
     2423// def N=grlifting3(I,J);
    24242424// 2nd module does not lie in the first:
    24252425// def NN=mappingcone3(I,J); // ????????
     
    24582458  module N;
    24592459
    2460   if(i>n) 
     2460  if(i>n)
    24612461    { // no middle part
    24622462      if(a[1]>0)
     
    24652465
    24662466          if(a[n+1]>0)
    2467             { N=grsum(N,grtwist(a[n+1],0));}         
    2468         } 
     2467            { N=grsum(N,grtwist(a[n+1],0));}
     2468        }
    24692469      else
    24702470        { N=grtwist(a[n+1],0);}
    2471      
    2472       return (N); // grorder(N)); 
     2471
     2472      return (N); // grorder(N));
    24732473    }
    24742474
    2475 else // i <= n: middle part is present, a_i != 0 
     2475else // i <= n: middle part is present, a_i != 0
    24762476    { // a = a1  ... |  i:2, a_2 ..... i: n, a_n | .... i: n+1a_(n+1)
    24772477      module I = maxideal(1);
     
    25052505
    25062506
    2507       return ((N)); //      return (grorder(N)); 
     2507      return ((N)); //      return (grorder(N));
    25082508    }
    25092509}
     
    25182518grview(S);
    25192519
    2520 def N1 = matrixpres(intvec(2,0,0,0,0)); 
     2520def N1 = matrixpres(intvec(2,0,0,0,0));
    25212521grview(N1);
    25222522
  • Singular/LIB/surf.lib

    rba52f58 re9478b  
    274274
    275275  string surf_call; i = 0;
    276  
     276
    277277  if (isWindows())
    278278  {
     
    303303  else
    304304  {
    305     surf_call = "surfer";   
     305    surf_call = "surfer";
    306306    surf_call = surf_call + " " + l + " >/dev/null 2>&1";
    307307    "Close window to exit from `surfer`.";
    308308    i = system("sh", surf_call);
    309    
    310     if ( (i != 0) && isMacOSX() ) 
     309
     310    if ( (i != 0) && isMacOSX() )
    311311    {
    312312      "*!* Sorry: calling `surfer` failed ['"+surf_call+"']" + newline
    313313      + " (The shell returned the error code " + string(i) + "." + newline
    314       + "But since we are on Mac OS X, let us try to open SURFER.app instead..." + newline 
     314      + "But since we are on Mac OS X, let us try to open SURFER.app instead..." + newline
    315315      + "Appropriate SURFER.app is available for instance at http://www.mathematik.uni-kl.de/~motsak/files/SURFER.dmg";
    316      
     316
    317317      // fallback, will only work if SURFER.app is available (e.g. in /Applications)
    318318      // get SURFER.app e.g. from http://www.mathematik.uni-kl.de/~motsak/files/SURFER.dmg
    319319      // note that the newer (Java-based) variant of Surfer may not support command line usage yet :(
    320      
     320
    321321      surf_call = "open -a SURFER -W --args -t -s";
    322322      surf_call = surf_call + " " + l + " >/dev/null 2>&1";
     
    324324      i = system("sh", surf_call);
    325325    }
    326    
    327    
    328    
     326
     327
     328
    329329  }
    330330  system("sh", "/bin/rm " + l);
     
    381381{
    382382  string s = system("uname");
    383  
     383
    384384  for (int i = 1; i <= size(s)-2; i = i + 1)
    385385  {
  • Singular/dyn_modules/singmathic/singmathic.cc

    rba52f58 re9478b  
    468468  result->rtyp=NONE;
    469469
    470   if (arg == NULL || arg->next != NULL || 
     470  if (arg == NULL || arg->next != NULL ||
    471471  ((arg->Typ() != IDEAL_CMD) &&(arg->Typ() != MODUL_CMD))){
    472472    WerrorS("Syntax: mathicgb(<ideal>/<module>)");
  • Singular/dyn_modules/syzextra/mod_main.cc

    rba52f58 re9478b  
    8282    for (int j=0; j<l; j++)
    8383      if (id->m[j] != NULL && p_GetComp(id->m[j], r) > 0)
    84         return TRUE;   
     84        return TRUE;
    8585
    8686    return FALSE; // rank: 1, only zero or no entries? can be an ideal OR module... BUT in the use-case should better be an ideal!
     
    9191
    9292
    93    
     93
    9494
    9595static inline void NoReturn(leftv& res)
     
    15501550  const int iLimit = r->typ[pos].data.is.limit;
    15511551  const ideal F = r->typ[pos].data.is.F;
    1552  
     1552
    15531553  ideal FF = id_Copy(F, r);
    15541554
  • Singular/extra.cc

    rba52f58 re9478b  
    37693769    }
    37703770    else
    3771 #endif   
     3771#endif
    37723772/*==================== Error =================*/
    37733773      Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented );
Note: See TracChangeset for help on using the changeset viewer.