Nice! I missed a #: verb. Thanks a lot. On Sat, Apr 4, 2015 at 11:20 PM, Henry Rich <henryhr...@nc.rr.com> wrote:
> Standard idiom (we call it the odometer function): > > ind3d =: (#: i.@(*/)) > > It's very fast. > > Henry Rich > > On 4/4/2015 5:09 PM, Sergeif wrote: > >> Hi. >> >> How can someone create list of indexes of 3d table (N x M x K)? >> >> I have written this simple code: >> >> ind3d =: 3 : 0 >> 'n m k' =. y >> p0 =. k&| >> p1 =. (m&|)@:<.@:(%&k) >> p2 =. <.@:(%&(m*k)) >> (p2 , p1 , p0)"0 (i. (n*m*k)) >> ) >> >> but it's very very slow. Does any tacit solution for this problem exist? >> >> Another question is how to fill the table with values depending on indexes >> of cell? For example, F[i,j,k] = (i * j) - (i * k) + (j * k). >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm