Classes | |
struct | Cluster |
Functions | |
static void | __set (int *p, int i) |
void | testCont () |
Variables | |
static int | s_cnt [2] = {0,0} |
static void ContTests::__set | ( | int * | p, | |
int | i | |||
) | [static] |
Definition at line 34 of file TestFastClusterContainer.cpp.
00034 { 00035 // fast filling: 00036 // channel ID size threshold cluster center 00037 //*p = (i&0x00FFFFFF) + ((i%2)<<24) + (((i+1)%2)<<25) + ((i%8)<<26); 00038 // _or_ with identical assembly code: 00039 *p = (i&0x00FFFFFF) + ((i%2)*0x01000000) + (((i+1)%2)*0x02000000) + 00040 ((i%8)*0x04000000); 00041 }
void ContTests::testCont | ( | ) |
Definition at line 43 of file TestFastClusterContainer.cpp.
00043 { 00044 s_cnt[0] = s_cnt[1] = 0; 00045 { 00046 typedef FastClusterContainer<Cluster,int > ClusterCont; 00047 ClusterCont cnt; 00048 cnt.resize(128); 00049 int i, n; 00050 int* p = (int*)&(*cnt.begin()); 00051 ClusterCont::iterator j; 00052 for(i=0, n=cnt.size(), j=cnt.begin(); i < n; ++i, ++p, ++j) { 00053 ClusterCont::value_type& v = *j; 00054 v.set(i); 00055 __set(p, i); 00056 printf(" [%08X, %d %d %d] Channel ID: %08X size:%d threshold:%d center:%d \n", 00057 *p, (i%2), (i+1)%2, (i%8), v.chanID(), v.size(), v.threshold(), 00058 v.center()); 00059 } 00060 { 00061 for(i=0, n=cnt.size(), j=cnt.begin(); i < n; ++i, ++p, ++j) { 00062 ClusterCont::value_type& v = *j; 00063 printf("Channel ID: %08X size:%d threshold:%d center:%d \n", 00064 v.chanID(), v.size(), v.threshold(), v.center()); 00065 } 00066 } 00067 } 00068 printf("Clusters constructed:%d destructed:%d diff:%d\n",s_cnt[0],s_cnt[1],s_cnt[0]-s_cnt[1]); 00069 }
int ContTests::s_cnt[2] = {0,0} [static] |
Definition at line 8 of file TestFastClusterContainer.cpp.