Rank: 3935 based on 25 downloads (last 30 days) and 1 file submitted
photo

William Kahan

E-mail

Personal Profile:

See www.cs.berkeley.edu/~wkahan

Professional Interests:
Numerical Computation

 

Watch this Author's files

 

Files Posted by William
Updated   File Tags Downloads
(last 30 days)
Comments Rating
13 Jul 2007 Gray Code Manipulation Generate Gray Codes and convert them to integers. Author: William Kahan cyclic, gray codes, goniometers, hypercube, hamiltonian 25 2
  • 5.0
5.0 | 1 rating
Comments and Ratings on William's Files View all
Updated File Comment by Comments Rating
26 Nov 2008 Gray Code Manipulation Generate Gray Codes and convert them to integers. Author: William Kahan Younger, Richard

You can get at least a 5-10x speedup in the integer routines by changing the routines to cast floats to the correct uint** type and replacing the fix(0.5*k) with bitshift(k, -1).

For the 10-12 bit long codes I'm working with, graytest(10) and (12), the ratio goes from ~ 400 to 1500/2800 upon changing the routine, including the appropriate type checking and casting.

Also, the fix() call in int2gray() at least doesn't play nicely with a uint** passed in. I haven't checked gray2int().

That said, I've gotten great use out of (my modified versions of) these routines. Thanks for providing them.

06 Sep 2008 Gray Code Manipulation Generate Gray Codes and convert them to integers. Author: William Kahan chris, my name is

great stufff ;)

Contact us