Interpets a binary reflected gray code sequence as encoding an integer value and returns the integer value it represents.
ctx
- context variable
p
- string index
pop
- symbolic constant of the population the string is in
start
- starting bit position in the binary representation
end
- ending bit position in the binary representation
none
#include "pgapack.h" int PGAGetIntegerFromGrayCode(ctx, p, pop, start, end) PGAContext *ctx int p int pop int start int end
evaluate.c
Example: Get an integer j from bits 10--29 of string p in population PGA_NEWPOP. The string is encoded in Gray code. PGAContext *ctx; int j, p; : j = PGAGetIntegerFromGrayCode(ctx, p, PGA_NEWPOP, 10, 29);