[Jprogramming] Boxes of different lengths
Don Guinn
donguinn at gmail.com
Wed Jan 11 21:43:47 HKT 2012
Look at cut (;.). It groups neighbors, although it does in in a rectangular
fashion you can get it to give you a group of potential neighbors from
which you select only those which you want to use. The display below uses
box to show the grouping, but it could be your own verb to process the data.
(1 1,:3 3)<;._3 i.5 5
+--------+--------+--------+
| 0 1 2| 1 2 3| 2 3 4|
| 5 6 7| 6 7 8| 7 8 9|
|10 11 12|11 12 13|12 13 14|
+--------+--------+--------+
| 5 6 7| 6 7 8| 7 8 9|
|10 11 12|11 12 13|12 13 14|
|15 16 17|16 17 18|17 18 19|
+--------+--------+--------+
|10 11 12|11 12 13|12 13 14|
|15 16 17|16 17 18|17 18 19|
|20 21 22|21 22 23|22 23 24|
+--------+--------+--------+
On Wed, Jan 11, 2012 at 2:55 AM, Ben Gorte - LR <B.G.H.Gorte at tudelft.nl>wrote:
> Thanks a lot to all for enlightening me!
>
> > DATA=: ".;._2]0 :0 0 0 1 1 1 1 2 2 2 2 2 4 4 4 5 5 5 0 7 8 9 2 2 5 5 5
> 3 8 0 0 5 6)
> >
> > 6 (</./@] #inv~ i.@[ e. {.@] ) DATA
> > 6 {. (</./ #inv~ (e.~ i.@(1 + >./))@{. ) DATA
> > I could not choose between these options without better understanding
> > your application.
>
> Well, my application ... continue reading at your own risk.
> . . .
More information about the Programming
mailing list