On Sun, Jul 27, 2014 at 12:33 PM, greg heil <[email protected]> wrote:
>>What i meant by "just not box them separately in the first place" was, eg,
>
> ax=:{. ; }.
> fsp=:' ' i.~ ]
> tc =: (ax~fsp) ;._2 (0 : 0)
> c1 p1 0.2
> c1 p2 0.35
> c2 p1 0.2
> c2 p2 0.35
> c3 p1 0.2
> c3 p2 0.35
> c3 p3 0.45
> )
>
> Then you would run tc through REB's fine finder.
greg, the space saved by not boxing them in the first place is significant too
s2=:7!:5 <'t3' NB. from unboxed t3 =: (ax~fsp) ;._2 fread...
s1=:7!:5 <'t2' NB. from readdsv
]s1
7.44155e8
]s2
4.84918e8
34% smaller
Using R.E. Boss's
groups3b
3 : 0
T=.(i.~ ~.)"1 &.|:y
(~.{."1 y) </.~ (i.~ ~.)({."1 </.}."1) T
)
timespacex 'groups3b t3'
1.9662 1.51001e8
Or using yours:
3 : '(~.{."1 y) </. ~ (i.~ ~.) ({."1 </.([:;}.)"1) y'
timespacex 'groups4 t3'
2.20632 1.73241e8
It seems using unboxed data is the way to go if the sole purpose is
this calculation (space saved, faster read time from the text file,
and performs similarly to Pascal's unboxed symbol example).
thank you for the suggestion
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm