Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Joe Bogner
t; or > > > >|: (~. (0&{"1) tst) ,: (0&{"1 <@;/. 1&{"1) tst > > ┌──┬───┐ > > │10│1 1 1 0 1 1│ > > ├──┼───┤ > > │11│0 0 1 0 1 │ > > ├──┼───┤ > > │12│1 0 0 0 1 0 0 1│ > &

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Skip Cave
smin' via Programming < > programm...@jsoftware.com> wrote: > > > if I understand correctly, there are 2 levels of boxing (or data can be > > made into 2 level) such as > > > > <"1 <"0 ? 3 10 $ 2 > > > > then, this w

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Joe Bogner
ducing fills. > > ; each <"1 <"0 ? 3 10 $ 2 > > > > > > From: Skip Cave > To: "programm...@jsoftware.com" > Sent: Tuesday, April 10, 2018 1:32 PM > Subject: Re: [Jprogramming] Indvidual unboxing > > > >

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread 'Pascal Jasmin' via Programming
To: "programm...@jsoftware.com" Sent: Tuesday, April 10, 2018 1:32 PM Subject: Re: [Jprogramming] Indvidual unboxing ​​ I probably need to back up a step: My original data looks something like this: t=: 4 : '(y#x),.?y#2' ]tst=: > each(10 t 6),"2 (11 t 5), 12 t 8 ┌

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Skip Cave
​​ I probably need to back up a step: My original data looks something like this: t=: 4 : '(y#x),.?y#2' ]tst=: > each(10 t 6),"2 (11 t 5), 12 t 8 ┌──┬─┐ │10│0│ ├──┼─┤ │10│1│ ├──┼─┤ │10│1│ ├──┼─┤ │10│1│ ├──┼─┤ │10│1│ ├──┼─┤ │10│0│ ├──┼─┤ │11│0│ ├──┼─┤ │11│1│ ├──┼─┤ │11│0│ ├──┼─

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Henry Rich
Cliff's is best, as long as the boxed contents have rank < 2. Henry Rich On 4/10/2018 1:26 PM, Cliff Reiter wrote: ]a=:10 6 8 <@?@$"0] 2 +-+-+-+-+-+-+-+-+-+-+ |1|1|1|1|0|0|0|1|0|1| +-+-+-+-+-+-+-+-+-+-+ |0|1|1|1|0|1| | | | | +-+-+-+-+-+-+-+-+-+-+ |0|1|0|1|1|0|0|1| | | +-+-+-+-+-+-+-+-+-+-+    <

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Cliff Reiter
   ]a=:10 6 8 <@?@$"0] 2 +-+-+-+-+-+-+-+-+-+-+ |1|1|1|1|0|0|0|1|0|1| +-+-+-+-+-+-+-+-+-+-+ |0|1|1|1|0|1| | | | | +-+-+-+-+-+-+-+-+-+-+ |0|1|0|1|1|0|0|1| | | +-+-+-+-+-+-+-+-+-+-+    <@;"1 a +---+---+---+ |1 1 1 1 0 0 0 1 0 1|0 1 1 1 0 1|0 1 0 1 1 0 0 1| +---

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Henry Rich
Your array seems odd: it has fills.  Why?  It appears you want to remove the fills, so methinks you should have boxed the rows, not the atoms in the rows. From where you start, you could delete the fills with <@:>@:(-.&a:)"1 to leave the fills, use <@:>"1 or its equivalent, ]&.:>"1 Henry

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Don Guinn
Or simply box each row. ,.<"1>tst ┌───┐ │1 1 0 0 0 0 1 1 0 0│ ├───┤ │1 1 1 0 1 1 1 1 0 0│ ├───┤ │0 0 0 0 0 1 0 1 1 0│ └───┘ On Tue, Apr 10, 2018 at 10:44 AM, Raul Miller wrote: > To get that exact result, I'd use >f=: ,

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Raul Miller
To get that exact result, I'd use f=: ,@<@;"1 but I believe Don Guinn's proposal (f=: >) would be more useful. Thanks, -- Raul On Tue, Apr 10, 2018 at 12:35 PM, Skip Cave wrote: > NB.I have an array of boxed boolean values called tst: > $tst > > 132 30 > > NB. I look at the first three row

Re: [Jprogramming] Indvidual unboxing

2018-04-10 Thread Don Guinn
Just unbox it. <"0?3 10$2 ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │1│1│1│1│1│0│1│0│1│1│ ├─┼─┼─┼─┼─┼─┼─┼─┼─┼─┤ │0│0│1│1│1│0│1│1│0│1│ ├─┼─┼─┼─┼─┼─┼─┼─┼─┼─┤ │0│0│0│1│1│1│0│0│1│1│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘ tst=:<"0?3 10$2 >tst 1 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 0 On Tue, Apr 10, 2018 at