gr_log2_const.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef INCLUDED_GR_LOG2_CONST_H
00028 #define INCLUDED_GR_LOG2_CONST_H
00029
00030 #include <assert.h>
00031
00032 template<unsigned int k> static inline int gr_log2_const() { assert(0); return 0; }
00033
00034 template<> inline int gr_log2_const<1>() { return 0; }
00035 template<> inline int gr_log2_const<2>() { return 1; }
00036 template<> inline int gr_log2_const<4>() { return 2; }
00037 template<> inline int gr_log2_const<8>() { return 3; }
00038 template<> inline int gr_log2_const<16>() { return 4; }
00039 template<> inline int gr_log2_const<32>() { return 5; }
00040 template<> inline int gr_log2_const<64>() { return 6; }
00041 template<> inline int gr_log2_const<128>() { return 7; }
00042 template<> inline int gr_log2_const<256>() { return 8; }
00043 template<> inline int gr_log2_const<512>() { return 9; }
00044 template<> inline int gr_log2_const<1024>(){ return 10; }
00045
00046 #endif