Changeset 4f2aed in git
- Timestamp:
- Jan 19, 2015, 9:15:38 PM (9 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/gradedModules.lib
r4f86a6 r4f2aed 40 40 static proc pad(int m, string s, string c){ string r = s; while( size(r) < m ){ r = c + r; } return(r); } 41 41 static proc mstring( int m, string c){ if( m < 0 ) { return (c); }; return (string(m)); } 42 static proc zstring( int m, int b, string c){ if(b) { return (c); }; return (string(m)); } 42 43 // view helper 43 static proc draw ( intmat D, int d )44 static proc draw ( intmat D, intvec zc, int d ) 44 45 { 45 46 // print(D); return (); … … 53 54 { 54 55 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], "?"), " ") + " "; 56 57 } 57 58 // 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], "?"), " "); 60 61 // head/foot dash lines: 61 62 string dash = repeat( (max + 1) * (nc - 2*d) , "-"); … … 107 108 108 109 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; 110 112 for( c = nc; c > 0; c-- ) 111 113 { … … 117 119 } else 118 120 { 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; 120 123 } 121 124 } … … 130 133 D[r+d, nc+2*d] = r; // right-most block with indeces 131 134 } 132 draw(D, d); // print it nicely!135 draw(D, zc, d); // print it nicely! 133 136 } 134 137
Note: See TracChangeset
for help on using the changeset viewer.