Changeset 4f2aed in git


Ignore:
Timestamp:
Jan 19, 2015, 9:15:38 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
cb2f4dcda8e5924cc3380177aa5fd95eca0f231b
Parents:
4f86a6c608ae0ffe2bc7d860feb86005c6b01247
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-01-19 21:15:38+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-01-19 21:18:44+01:00
Message:
Fix grview to mark zero columns with '?' (in the footer)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gradedModules.lib

    r4f86a6 r4f2aed  
    4040static proc pad(int m, string s, string c){ string r = s; while( size(r) < m ){ r = c + r; } return(r); }
    4141static proc mstring( int m, string c){ if( m < 0 ) { return (c); }; return (string(m)); }
     42static proc zstring( int m, int b, string c){ if(b) { return (c); }; return (string(m)); }
    4243// view helper
    43 static proc draw ( intmat D, int d )
     44static proc draw ( intmat D, intvec zc, int d )
    4445{
    4546//  print(D); return ();
     
    5354  {
    5455    head = head + pad(max, string(D[1 , c]), " ") + " ";
    55     foot = foot + pad(max, string(D[nr, c]), " ") + " ";
     56    foot = foot + pad(max, zstring(D[nr, c], zc[c - d], "?"), " ") + " ";
    5657  }
    5758  // last head/foot enties:
    58   head = head + pad(max, string(D[1 , nc-d]), " ");
    59   foot = foot + pad(max, string(D[nr, nc-d]), " ");
     59  head = head + pad(max, string(D[1 , c]), " ");
     60  foot = foot + pad(max, zstring(D[nr, c], zc[c-d], "?"), " ");
    6061  // head/foot dash lines:
    6162  string dash  = repeat( (max + 1) * (nc - 2*d) , "-");
     
    107108 
    108109  module L = module(N); L = lead(L); vector v;
    109   int m = 1 + nvars(basering);
     110  int m = 1 + nvars(basering);
     111  intvec zc = 0:nc;
    110112  for( c = nc; c > 0; c-- )
    111113  {
     
    117119    } else
    118120    {
    119       D[nr+2*d, c+d] = 0; // TODO: 0/-1 is valid :(
     121//      D[nr+2*d, c+d] = 0; // TODO: 0/-1 is valid :(
     122      zc[c] = 1;
    120123    }
    121124  }
     
    130133    D[r+d, nc+2*d] = r; // right-most block with indeces
    131134  }
    132   draw(D, d); // print it nicely!
     135  draw(D, zc, d); // print it nicely!
    133136}
    134137
Note: See TracChangeset for help on using the changeset viewer.