Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hamming distance code

Author: Don Dailey

Date: 11:15:01 02/25/99

Go up one level in this thread


On February 25, 1999 at 08:23:55, Robert Hyatt wrote:

>On February 25, 1999 at 00:40:47, Don Dailey wrote:
>
>>Bob,
>>
>>I'm still concerned that our numbers are so far off.  Unfortunately
>>I haven't had much time to go over it again (too busy on this darn
>>board)  I don't see any bugs in my hamming code.  Any ideas?
>>
>>- Don
>
>
>Yes.. you are overlooking one important detail:  these are 'random numbers'
>of course.  I use the generator from Knuth's book (also in Numerical Recipes)
>to generate 32 bit random numbers and then piece two of them together to make
>a 64 bit value.  It might be my RNG is not doing so well with respect to yours.
>
>What RNG are you using?

But I'm getting good hamming distances much quicker than you.  If it's
a RNG problem then my generator is the better one.   We should check this
out but I'm guessing that I might have a bug in my hamming code, or
possibly you do.   I'm going to carefully inspect the code you posted
and test my numbers with your code to see what happens (as soon as I can
get a chance to.)

I am using the RNG that comes with Linux,  or actually GCC.  But to
get 64 bit numbers I have kludged something like you have but I
construct them 8 bits at a time (very slow.)   I grab some bits in
the middle of 8 different random numbers and piece them together
to get a single 64 bit number.   I could do something much more
efficent with just 2 passes, but the code is highly platform
independent and I wanted this code to be compatible with lousy
15 bit random number generators.

I'll figure it out as soon as I can get a free 30 minutes or so
to test both our code.   It is very possible that my code is
broken since I hacked it together in 5 minutes and didn't test
it very thoroughly yet.   If it is broken I'll post you a message.

- Don



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.