This is another case where I'm having difficulty with elementary
construction.
] q =: 0 2 4 {(i.!4) A. i.4
0 1 2 3
0 2 1 3
0 3 1 2
] c =: 4 comb 5
0 1 2 3
0 1 2 4
0 1 3 4
0 2 3 4
1 2 3 4
(2 { q) { 4 { c
1 4 2 3
((i.#q) { q) { 4 { c
1 2 3 4
1 3 2 4
1 4 2 3
i.#c
0 1 2 3 4
(2 { q) { (i.#c) { c NB. This result I do not yet understand.
0 1 2 3
0 2 3 4
0 1 2 4
0 1 3 4
NB. Compare individual results:
((i.#q) { q) { 0 { c
0 1 2 3
0 2 1 3
0 3 1 2
((i.#q) { q) { 1 { c
0 1 2 4
0 2 1 4
0 4 1 2
((i.#q) { q) { 2 { c
0 1 3 4
0 3 1 4
0 4 1 3
((i.#q) { q) { 3 { c
0 2 3 4
0 3 2 4
0 4 2 3
((i.#q) { q) { 4 { c
1 2 3 4
1 3 2 4
1 4 2 3
desiredResult =: (0 : 0)
0 1 2 3
0 2 1 3
0 3 1 2
0 1 2 4
0 2 1 4
0 4 1 2
0 1 3 4
0 3 1 4
0 4 1 3
0 2 3 4
0 3 2 4
0 4 2 3
1 2 3 4
1 3 2 4
1 4 2 3
)
I would appreciate advice as to how I am mishandling the left-hand
argument to the rightmost indexing verb.
Thank you.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm