If the question is, does  (3 4,:5 6)$i.2 3  give 
the correct answer?   The answer is yes.



----- Original Message -----
From: Oleg Kobchenko <[EMAIL PROTECTED]>
Date: Monday, April 2, 2007 3:46 pm
Subject: Re: [Jprogramming] Ravel frame

> A similar technique was used to find resulting
> shape of reshape (fixed at 1-cells). BTW, is it correct?
> 
>   $(3 4,:5 6)$i.2 3      NB. shape is (}:$x) , (>./^:([EMAIL PROTECTED])x) , 
> }.$y2 5 6 3
> 
> Note, rf depends on frame rank, whereas it should
> depend on cell rank, i.e. for any rank argument 
> return array of at most given rank.
> 
> I think this is a good universal adverb:
> 
>  rcr=: /(@])(^:((0>.-)~ [EMAIL PROTECTED]))     NB. Reduce to Cell Rank
> 
>   2 , rcr 3                   2 + rcr 3
> 3                     3
>   2 , rcr i.3                   2 + rcr i.3
> 0 1 2                 0 1 2
>   2 , rcr i.3 4           2 + rcr i.3 4
> 0 1  2  3             0 1  2  3
> 4 5  6  7             4 5  6  7
> 8 9 10 11             8 9 10 11
>   2 , rcr i.2 3 4           2 + rcr i.2 3 4
> 0  1  2  3            12 14 16 18
> 4  5  6  7            20 22 24 26
> 8  9 10 11            28 30 32 34
> 12 13 14 15
> 16 17 18 19
> 20 21 22 23
>   2 , rcr i.2 2 3 4           2 + rcr i.2 2 3 4
> 0  1  2  3                 72  76  80  84
> 4  5  6  7                 88  92  96 100
> 8  9 10 11            104 108 112 116
> 12 13 14 15
> 16 17 18 19
> 20 21 22 23
> 24 25 26 27
> 28 29 30 31
> 32 33 34 35
> 36 37 38 39
> 40 41 42 43
> 44 45 46 47
> 
> 
> --- Roger Hui <[EMAIL PROTECTED]> wrote:
> 
> > rf=: ,/@]^:(<:@[)
> > 
> >    $ 4 rf i.2 3 5 7 11 13
> > 210 11 13
> > 
> > Obvious modifications for other interpretations
> > of the left argument.
> > 
> > 
> > 
> > ----- Original Message -----
> > From: Oleg Kobchenko <[EMAIL PROTECTED]>
> > Date: Monday, April 2, 2007 2:14 pm
> > Subject: [Jprogramming] Ravel frame
> > 
> > > How to ravel frame of a given cell rank
> > > without boxing?
> > > 
> > > Here's how it's done with boxing
> > > 
> > >   ,&.:(<"1) 4          NB. ravel N-1 frames (leave 1-cells)
> > > 4
> > >   ,&.:(<"1) i. 4
> > > 0 1 2 3
> > >   ,&.:(<"1) i.3 4
> > > 0 1  2  3
> > > 4 5  6  7
> > > 8 9 10 11
> > >   ,&.:(<"1) i.2 3 4
> > > 0  1  2  3
> > > 4  5  6  7
> > > 8  9 10 11
> > > 12 13 14 15
> > > 16 17 18 19
> > > 20 21 22 23
> > >   ,&.:(<"1) i.2 2 3 4
> > > 0  1  2  3
> > > 4  5  6  7
> > > 8  9 10 11
> > > 12 13 14 15
> > > 16 17 18 19
> > > 20 21 22 23
> > > 24 25 26 27
> > > 28 29 30 31
> > > 32 33 34 35
> > > 36 37 38 39
> > > 40 41 42 43
> > > 44 45 46 47
> > > 
> > >   $,&.:(<"2) i.2 2 2 2 3 4      NB. ravel N-2 frame (2-cell)
> > > 16 3 4
> > >   $,&.:(<"2) i.2 2 2 2 2 2 3 4
> > > 64 3 4
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to