BTW your solution is beautiful in all its simplicity :-)
On 16-09-14 13:06, Raul Miller wrote:
I was seeing factor of 2 variation in timing:
timespacex '0{::([ ((,{.);]) {:@[ f"1 }.@])&>/^:(<:@#`(,:@{.;])) !/~i.10'
0.000502896 22400
timespacex '{."2 ({. f"1 }.)^:(i.@#) !/~i.10'
0.000670315 29696
timespacex '{."2 ({. f"1 }.)^:(i.@#) !/~i.10'
0.00038519 29696
timespacex '{."2 ({. f"1 }.)^:(i.@#) !/~i.10'
0.000499689 29696
timespacex '0{::([ ((,{.);]) {:@[ f"1 }.@])&>/^:(<:@#`(,:@{.;])) !/~i.10'
0.000622527 22400
timespacex '0{::([ ((,{.);]) {:@[ f"1 }.@])&>/^:(<:@#`(,:@{.;])) !/~i.10'
0.00041149 22400
timespacex '0{::([ ((,{.);]) {:@[ f"1 }.@])&>/^:(<:@#`(,:@{.;])) !/~i.10'
0.000336119 22400
timespacex 'orto !/~i.10'
0.000570569 15488
timespacex 'orto !/~i.10'
0.000490067 15488
timespacex 'orto !/~i.10'
0.000500651 15488
timespacex 'orto !/~i.10'
0.000341251 15488
timespacex 'orto !/~i.10'
0.000459598 15488
timespacex 'orto !/~i.10'
0.000625413 15488
timespacex 'orto !/~i.10'
0.000621244 15488
So anything less than a factor of 2 is roughly equivalent.
Thanks,
--
Met vriendelijke groet,
@@i = Arie Groeneveld
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm