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