GrayCodePosition

Documentation for GrayCodePosition.

GrayCodePosition.GrayCodePositionsType
GrayCodePositions[{signed::Bool}](code::GrayCode)

Represents the sequence of transient indices of a Gray code. The ith transient index is the position of the bit of code[i] that is flipped to obtain code[i+1]. The entire sequence can be generated by iteration. The optional signed type parameter (default false) gives the signed transient sequence, a positive (negative) sign indicating the bit is set (reset).

Note: The returned transient indices are 1-based.

source