On Fri, Jul 15, 2011 at 2:43 PM, Devon McCormick <[email protected]> wrote: > On Fri, Jul 15, 2011 at 9:14 AM, Simon Clarkstone > <[email protected]> wrote: [...] >> Related: is there a conventional way to convert between ravelled and >> non-ravelled indexes, for a given array shape? I would rather not do >> it in 20 characters if I could do it in 5. [...] > ]ixs=. ('.'=,aa)#i.$,aa > 2 3 4 8 10 11 24 > $ixs=. ($aa)#:('.'=,aa)#i.$,aa > 7 2 > ixs > 0 2 > 0 3 > 0 4 > 1 3 > 2 0 > 2 1 > 4 4
Thanks, the base and anti-base operators are just what I was looking for; I don't know how I missed them. (I mostly learnt what I know so far by starting with some operators mentioned in tutorials and reading about everything I needed to understand the example code for them.) I suppose that I should have guessed there would be operators for that, given that there are operators like Anagram and Anagram Index. -- src/ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
