Re: generate a huge amount of random numbers
- From: "Guenther Wimpassinger" <gw_spam@xxxxxxxxx>
- Date: Fri, 29 Apr 2005 15:55:47 +0200
"John Herbster" <herb-sci1_AT_sbcglobal.net> schrieb
> "Guenther Wimpassinger" <gw_spam@xxxxxxxxx> wrote
> > Let's say, I have an array of bits. With the MaxProp parameter I
> > can control how many bits of this array are set (approximately).
> > So if I pass 1 as MaxProp all bits are set in this array,
> > if I pass 0.5 nearly half of all the bits are set. So, the number
> > of bits which should be set must be controllable.
>
> Guenther, So you have 40,000 elements.
> Are your "elements" bits or DWORDs?
I have 40,000 DWords which represtens 1,280,000 (40,000*32) bits and
each bit corespon to a cloud-point.
> Apparently MaxProp is the probably
> that a bit value is set to 1.
> And you are presently doing:
> for i := 0 to high(BitsArray) do
> begin
> BitsArray[i] := $00;
> for j := 0 to 31 do
> if random < MaxProp
> then BitsArray[i] := BitsArray[i] or (1 shl j);
> end;
exactly!
> You could fill your array with the required number
> of one bit values and then do some shuffling of
> both words, bytes, and bits. Regards, JohnH
Maybe thats an idea, I will use the weekend to think
about it.
Thanks
Guenther
.
- Follow-Ups:
- Re: generate a huge amount of random numbers
- From: John Herbster
- Re: generate a huge amount of random numbers
- From: Pierre le Riche
- Re: generate a huge amount of random numbers
- References:
- generate a huge amount of random numbers
- From: Guenther Wimpassinger
- Re: generate a huge amount of random numbers
- From: John Herbster
- Re: generate a huge amount of random numbers
- From: Guenther Wimpassinger
- Re: generate a huge amount of random numbers
- From: John Herbster
- generate a huge amount of random numbers
- Prev by Date: Re: generate a huge amount of random numbers
- Next by Date: Re: generate a huge amount of random numbers
- Previous by thread: Re: generate a huge amount of random numbers
- Next by thread: Re: generate a huge amount of random numbers
- Index(es):
Relevant Pages
|