>,{<@i."0[2 3 4
0 0 0
0 0 1
0 0 2
0 0 3
0 1 0
0 1 1
0 1 2
0 1 3
0 2 0
0 2 1
0 2 2
0 2 3
1 0 0
1 0 1
1 0 2
1 0 3
1 1 0
1 1 1
1 1 2
1 1 3
1 2 0
1 2 1
1 2 2
1 2 3

R.E. Boss


> -----Original Message-----
> From: [email protected] [mailto:programming-
> [email protected]] On Behalf Of Nollaig MacKenzie
> Sent: zaterdag 4 april 2015 23:16
> To: [email protected]
> Subject: Re: [Jprogramming] indexing a table
> 
> Is something like this what you have in mind?
> 
>    m=. i. 2 3 4
>       indmak m
>       0 0 0
>       0 0 1
>       0 0 2
>       0 0 3
> 
>       0 1 0
>       0 1 1
>       0 1 2
>       0 1 3
> 
>       0 2 0
>       0 2 1
>       0 2 2
>       0 2 3
> 
> 
>       1 0 0
>       1 0 1
>       1 0 2
>       1 0 3
> 
>       1 1 0
>       1 1 1
>       1 1 2
>       1 1 3
> 
>       1 2 0
>       1 2 1
>       1 2 2
>       1 2 3
>          indmak
>        (#: i.)@$
> 
> 
> On 2015.04.04 23:09:58, you,
>  the extraordinary Sergeif, spake thus:
> 
> > 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
> 
> --
> Nollaig MacKenzie
> http://www.yorku.ca/nollaig
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to