1 const char* quantize_func =
2 " private static int quantize(float val, int fid) {\n" 3 " final int offset = th_begin[fid];\n" 4 " final int len = th_len[fid];\n" 9 " if (val < threshold[offset + 0]) {\n" 12 " while (low + 1 < high) {\n" 13 " mid = (low + high) / 2;\n" 14 " mval = threshold[offset + mid];\n" 15 " if (val == mval) {\n" 17 " } else if (val < mval) {\n" 23 " if (threshold[offset + low] == val) {\n" 25 " } else if (high == len) {\n" 28 " return low * 2 + 1;\n"