On 04/12/2012 01:27 PM, Joseph Rushton Wakeling wrote:
> What I _still_ don't understand is the statement in the constructor:
>
> // we should skip some elements initially so we don't always
> // start with the first
>
> ... as it seems to me that doing so would bugger up the selection
> algorith
On 12/04/12 20:39, Ali Çehreli wrote:
That's misleading. RandomSample is a lazy range. The output seems to be elements
of an array only as you pull data out of this range.
Ahhh, it's lazy evaluation. That would explain why you can set ret.gen = gen in
the randomSample functions and have it wo
On 04/12/2012 11:30 AM, Joseph Rushton Wakeling wrote:
> What gets output at the end is clearly an array containing a subset of
> the original input.
That's misleading. RandomSample is a lazy range. The output seems to be
elements of an array only as you pull data out of this range.
> The con
Hello all,
I'm trying to understand the internal operations of the RandomSample struct in
std.random.
What gets output at the end is clearly an array containing a subset of the
original input. But I can't understand how this is constructed.
The constructor sets various initial values and t