The reboxing solution that looks ok: 0(] #~ i.) L:0 <"1 > d
┌────────┬──┐ │2 │3 │ ├────────┼──┤ │4 5 │6 │ ├────────┼──┤ │7 8 9 11│10│ └────────┴──┘ as long as fills are considered illegal, even if original has some: 0(] #~ i.) L:0 <"1 > 3 2 $ 2 0 1;3;4 5;6;7 8 9 11;10 ┌────────┬──┐ │2 1 │3 │ ├────────┼──┤ │4 5 │6 │ ├────────┼──┤ │7 8 9 11│10│ └────────┴──┘ ----- Original Message ----- From: Pascal Jasmin <[email protected]> To: "[email protected]" <[email protected]> Cc: Sent: Saturday, September 14, 2013 10:46:30 PM Subject: [Jgeneral] Sparse array questions I'm guessing that symbols s: are implemented with sparse arrays, but I'm not positive. Symbols I understand are ordered by entry time, while sparse arrays give me the impression that they are inserted in sorted order. While symbols seems like a good replacement for literal strings, there is a limited size, no way to clean some out, threaten the end of the universe, and even if they are ordered, there doesn't seem a way to make partial backups. I don't immediately see a way to organize a sparse array such as to be able to retrieve items in entered order either, but I do see string encoding applications. Questions: Is there any material performance advantage to having axes of 256 256 256 256 over other representations of the data, or is implementation completely independent of axis choices? Playing around: d=. 3 2 $ 2;3;4 5;6;7 8 9 11;10 s=. $.> d NB. works > d 2 0 0 0 3 0 0 0 4 5 0 0 6 0 0 0 7 8 9 11 10 0 0 0 s 0 0 0 │ 2 0 1 0 │ 3 1 0 0 │ 4 1 0 1 │ 5 1 1 0 │ 6 2 0 0 │ 7 2 0 1 │ 8 2 0 2 │ 9 2 0 3 │ 11 2 1 0 │ 10 Looking through both lists, I think I can see pseudocode to reconstruct boxed d, but is there a one liner to do it? With d unboxed (or s) I don't know how to append the equivalent 12;13 box pair other than 4 2 4 $ (,>d) , 12 0 0 0 13 0 0 0 2 0 0 0 3 0 0 0 4 5 0 0 6 0 0 0 7 8 9 11 10 0 0 0 12 0 0 0 13 0 0 0 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
