# HG changeset patch # User vitor # Date 1216785271 0 # Node ID 1502ba3beb72505f4cf4bcd07f1c6c5f8639cd68 # Parent 5c45da72279e5eb1a9a761ec625954ccffe23a66 The codebook generator algorithm involves picking three different codebook centroids ("high utility", "low utility" and "closest to the low utility one"). This change avoid the corner case of choosing two times the same centroid. diff -r 5c45da72279e -r 1502ba3beb72 elbg.c --- a/elbg.c Wed Jul 23 02:12:54 2008 +0000 +++ b/elbg.c Wed Jul 23 03:54:31 2008 +0000 @@ -299,8 +299,10 @@ if (elbg->utility_inc[elbg->numCB-1] == 0) return; - idx[1] = get_high_utility_cell(elbg); idx[2] = get_closest_codebook(elbg, idx[0]); + do { + idx[1] = get_high_utility_cell(elbg); + } while (idx[1] == idx[0] || idx[1] == idx[2]); try_shift_candidate(elbg, idx); }