[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] 100?100 hang-up

From: Kacper Gutowski
Subject: Re: [Bug-apl] 100?100 hang-up
Date: Tue, 13 Oct 2015 12:53:50 +0200

On Tue, Oct 13, 2015 at 12:17 PM, Elias Mårtenson <address@hidden> wrote:
> It should be new set_size/8+1 on both the like with new and the subsequent
> memset() one.

You mean (set_size+7)/8 :)

I was almost expecting this to be related to that this algorithm's
termination probability converges to 1 very slowly when A is close to B,
but 100 is small and 100?100 worked for me from time to time regardless
of ⎕RL so that's not it.  Good catch, Jay!

While this isn't related to the bug reported, this algorithm saves a lot
of memory when A << B, but otherwise it doesn't buy us anything because
A cells need to be allocated for the result anyway.  I think it might
be a good idea to switch to standard Fisher-Yates shuffle at some point
when A gets close to B (i.e. allocate B IntCells, shuffle in place and
return first A of them; this terminates deterministically in linear time).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]