From d3e2ec203a5cf550320caa8023ac3dd103b0be7d Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 13 Oct 2014 00:42:37 -0400 Subject: new kenlm --- klm/util/sorted_uniform.hh | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'klm/util/sorted_uniform.hh') diff --git a/klm/util/sorted_uniform.hh b/klm/util/sorted_uniform.hh index 7700d9e6..a3f6d021 100644 --- a/klm/util/sorted_uniform.hh +++ b/klm/util/sorted_uniform.hh @@ -1,5 +1,5 @@ -#ifndef UTIL_SORTED_UNIFORM__ -#define UTIL_SORTED_UNIFORM__ +#ifndef UTIL_SORTED_UNIFORM_H +#define UTIL_SORTED_UNIFORM_H #include #include @@ -101,27 +101,6 @@ template bool SortedUniformFind(co return BoundedSortedUniformFind(accessor, begin, below, end, above, key, out); } -// May return begin - 1. -template Iterator BinaryBelow( - const Accessor &accessor, - Iterator begin, - Iterator end, - const typename Accessor::Key key) { - while (end > begin) { - Iterator pivot(begin + (end - begin) / 2); - typename Accessor::Key mid(accessor(pivot)); - if (mid < key) { - begin = pivot + 1; - } else if (mid > key) { - end = pivot; - } else { - for (++pivot; (pivot < end) && accessor(pivot) == mid; ++pivot) {} - return pivot - 1; - } - } - return begin - 1; -} - } // namespace util -#endif // UTIL_SORTED_UNIFORM__ +#endif // UTIL_SORTED_UNIFORM_H -- cgit v1.2.3