… | |
… | |
764 | |
764 | |
765 | Overloaded C++ rotl/rotr functions. |
765 | Overloaded C++ rotl/rotr functions. |
766 | |
766 | |
767 | C<T> must be one of C<uint8_t>, C<uint16_t>, C<uint32_t> or C<uint64_t>. |
767 | C<T> must be one of C<uint8_t>, C<uint16_t>, C<uint32_t> or C<uint64_t>. |
768 | |
768 | |
769 | =item uint_fast8_t ecb_gray8_encode (uint_fast8_t b) |
769 | =item uint_fast8_t ecb_gray_encode8 (uint_fast8_t b) |
770 | |
770 | |
771 | =item uint_fast16_t ecb_gray16_encode (uint_fast16_t b) |
771 | =item uint_fast16_t ecb_gray_encode16 (uint_fast16_t b) |
772 | |
772 | |
773 | =item uint_fast32_t ecb_gray32_encode (uint_fast32_t b) |
773 | =item uint_fast32_t ecb_gray_encode32 (uint_fast32_t b) |
774 | |
774 | |
775 | =item uint_fast64_t ecb_gray64_encode (uint_fast64_t b) |
775 | =item uint_fast64_t ecb_gray_encode64 (uint_fast64_t b) |
776 | |
776 | |
777 | Encode an unsigned into its corresponding (reflective) gray code - the |
777 | Encode an unsigned into its corresponding (reflective) gray code - the |
778 | kind of gray code meant when just talking about "gray code". These |
778 | kind of gray code meant when just talking about "gray code". These |
779 | functions are very fast and all have identical implementation, so there is |
779 | functions are very fast and all have identical implementation, so there is |
780 | no need to use a smaller type, as long as your CPU can handle it natively. |
780 | no need to use a smaller type, as long as your CPU can handle it natively. |
781 | |
781 | |
782 | =item T ecb_gray_encode (T b) [C++] |
782 | =item T ecb_gray_encode (T b) [C++] |
783 | |
783 | |
784 | Overloaded C++ version of the above, for C<uint{8,16,32,64}_t>. |
784 | Overloaded C++ version of the above, for C<uint{8,16,32,64}_t>. |
785 | |
785 | |
786 | =item uint_fast8_t ecb_gray8_decode (uint_fast8_t b) |
786 | =item uint_fast8_t ecb_gray_decode8 (uint_fast8_t b) |
787 | |
787 | |
788 | =item uint_fast16_t ecb_gray16_decode (uint_fast16_t b) |
788 | =item uint_fast16_t ecb_gray_decode16 (uint_fast16_t b) |
789 | |
789 | |
790 | =item uint_fast32_t ecb_gray32_decode (uint_fast32_t b) |
790 | =item uint_fast32_t ecb_gray_decode32 (uint_fast32_t b) |
791 | |
791 | |
792 | =item uint_fast64_t ecb_gray64_decode (uint_fast64_t b) |
792 | =item uint_fast64_t ecb_gray_decode64 (uint_fast64_t b) |
793 | |
793 | |
794 | Decode a gray code back into linear index form (the reverse of |
794 | Decode a gray code back into linear index form (the reverse of |
795 | C<ecb_gray*_encode>. Unlike the encode functions, the decode functions |
795 | C<ecb_gray*_encode>. Unlike the encode functions, the decode functions |
796 | have higher time complexity for larger types, so it can pay off to use a |
796 | have higher time complexity for larger types, so it can pay off to use a |
797 | smaller type here. |
797 | smaller type here. |