Verb indices I. almost complete the task.
When you have a simple list, I. used simply:
I. 8 = 0 1 2 3 4 5 8 7 8 9 6 8
For higher order matrices, you can associate it with antibase #: to get the coordinates in the $ matrix base. For instance:
]a =: 4 5 $ 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 I. 6 = ,a 9 13 17 ($a) #: 9 13 17 1 4 2 3 3 2
Similarly, for any number of dimensions: flatten ( , ), compare ( = ), get the indices ( I. ) and transform the coordinates ( ($a): :
]coords =: ($a)
By the way, you can write I. x = y as x ( I.@ :=) y for extra performance. special code for
where xfy
source share