Leo,
I think your printing function could be made more
elegant if you were to use the verbs over and by which I
believe were two of KEI's favorites for table bordering.
Their definitions can be found in
j601/system/examples/phrases/phrd1.ijs
d4=: by=: ' '&;@,[EMAIL PROTECTED],.] NB. Format function
d5=: over=: ({.;}.)@":@, NB. Format function
z([ by ] over {&ta@<@,"0/)h
+--+----------------------+
| |0 1 9 10 5 6 7 8 2 3 4|
+--+----------------------+
| 0|0 1 1 1 0 0 0 0 0 0 0|
| 1|1 0 1 1 1 1 1 1 0 0 0|
| 9|1 1 0 1 1 1 0 0 1 1 1|
|10|1 1 1 0 0 0 1 1 1 1 1|
| 5|0 1 1 0 0 1 1 1 1 1 1|
| 6|0 1 1 0 1 0 1 1 1 1 1|
| 7|0 1 0 1 1 1 0 1 1 1 1|
| 8|0 1 0 1 1 1 1 0 1 1 1|
| 2|0 0 1 1 1 1 1 1 0 1 1|
| 3|0 0 1 1 1 1 1 1 1 0 1|
| 4|0 0 1 1 1 1 1 1 1 1 0|
+--+----------------------+
Unfortunately, this does not add to the core
features of your results.
On Sun, 8 Jul 2007, Leo Vo~handu wrote:
+ Hei, Glenn. I will put a short program here to reoorder a 0/1 data table
+ into a more systematic way. There is a nice mathematical theory behind it
+ (so-called Monotone Systems) but our forum is not the place to write about
+ it.
+ ta=. "."0;._2'01000000011 10000111111 00011111111 00101111111 00110111111
+ 01111011110 01111101110 01111110101 01111111001 11111110001 11111001110 '
+ th=:13 :'s;(>1{y),w[[s=:(100000)w}(s-(<[w=:{./:s=:>0{y){x)'
+ ty=: 13 :'>1{y th^:(#y)(+/y);0$0'
+ z=.ty zz=.ta +/ .*|:ta
+ h=.ty hh=.(|:ta)+/ .*ta
+ p=.(((,.h;(h([{])"1(z([{])ta)));,.(3#999),z))
[snip]
+ WbR Leo
+
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm