> Thanks Raul, your solution is much nicer than mine.
>
>
>
> On Wed, 3/29/17, Raul Miller wrote:
>
> Subject: Re: [Jprogramming] Unboxing after subarray function
> To: "Programming forum"
> Date: Wednesday, March 29, 201
Thanks Raul, your solution is much nicer than mine.
On Wed, 3/29/17, Raul Miller wrote:
Subject: Re: [Jprogramming] Unboxing after subarray function
To: "Programming forum"
Date: Wednesday, March 29, 2017, 9:01 PM
Here's a
-
On Wed, 3/29/17, Rob Hodgkinson wrote:
Subject: Re: [Jprogramming] Unboxing after subarray function
To: [email protected]
Date: Wednesday, March 29, 2017, 6:45 PM
Did you notice my last
line ? It specifically gave you an alternative way to
u
-
From: Programming [mailto:[email protected]] On Behalf
Of Raul Miller
Sent: Wednesday, March 29, 2017 8:01 AM
To: Programming forum
Subject: Re: [Jprogramming] Unboxing after subarray function
Here's a generalization which works on your first example (which happens to
a
; │0 0 0│0 0 0│
>> │0 1 0│0 0 0│
>> │0 0 0│0 0 1│
>> ├─────┼─────┤
>> │0 0 0│0 0 0│
>> │0 1 0│0 0 0│
>> │0 0 0│0 0 1│
>> └─┴─┘
>>
>> So, the problem is to get rid of the boxes, but keep the shape and positions
>> of the array and i
>>
>>
>> ┌─┬─┐
>> │0 0 0│0 0 0│
>> │0 1 0│0 0 0│
>> │0 0 0│0 0 1│
>> ├─┼─────┤
>> │0 0 0│0 0 0│
>> │0 1 0│0 0 0│
>> │0 0 0│0 0 1│
>> └─┴─┘
>>
>> So, the problem is to get rid of the boxes, but keep the shape and positions
>
> ┌─┬─┐
> │0 0 0│0 0 0│
> │0 1 0│0 0 0│
> │0 0 0│0 0 1│
> ├─┼─┤
> │0 0 0│0 0 0│
> │0 1 0│0 0 0│
> │0 0 0│0 0 1│
> └─┴─┘
>
> So, the problem is to get rid of the boxes, but keep the shape and positions
> of the array and its element
0│
> │0 1 0│0 0 0│
> │0 0 0│0 0 1│
> ├─┼─┤
> │0 0 0│0 0 0│
> │0 1 0│0 0 0│
> │0 0 0│0 0 1│
> └─┴─┘
>
> So, the problem is to get rid of the boxes, but keep the shape and positions
> of the array and its elements.
>
> -
ns of
the array and its elements.
On Wed, 3/29/17, Rob Hodgkinson wrote:
Subject: Re: [Jprogramming] Unboxing after subarray function
To: [email protected]
Date: Wednesday, March 29, 2017, 6:19 PM
Jon, I note Henry’s
point about using <;.3 T if y
(is;is) ($$((>./=])@:,))&.>@:< interval T NB. max of 3x3 subarrays
> 12 12 $ , > |:"2 <"1 > IsMax
>
> Also creates the correct array.
>
> --------
> On Wed, 3/29/17, 'Jon Hough' via Programming
&g
Look at u;.3 and u;._3
Henry Rich
On 3/29/2017 3:54 AM, 'Jon Hough' via Programming wrote:
T =: 12 12 $ 0 _2 12 100 2 4.5 1 7 _5.5 3.2 120 2 _100 3 5 18 4
--
For information about J forums see http://www.jsoftware.com/forums.
:"2 <"1 > IsMax
Also creates the correct array.
On Wed, 3/29/17, 'Jon Hough' via Programming wrote:
Subject: [Jprogramming] Unboxing after subarray function
To: "Programming Forum"
Date: Wednesday, March 29,
I have a NxN matrix.
For each 2x2 subarray of this (keep it simple, N is even), I want to calculate
the maximum value and if the value of that cell equals the maximum of the 2x2
subarray write 1, else write 0.
e.g.
NB. T arbitrary 10x10 matrix
T =: 10 10 $ 0 _2 12 100 2 4.5 1 7 _5.5 3.2 120 2 _
13 matches
Mail list logo