From: bangerth Date: Sun, 25 Sep 2011 18:09:17 +0000 (+0000) Subject: Remove a global function that apparently snuck in there by accident in r23944. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bb6a3a3552a171fbf3ca1ce5c69d332c8b9964b;p=dealii-svn.git Remove a global function that apparently snuck in there by accident in r23944. git-svn-id: https://svn.dealii.org/trunk@24406 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/utilities.h b/deal.II/include/deal.II/base/utilities.h index c1273dbafd..7a82116727 100644 --- a/deal.II/include/deal.II/base/utilities.h +++ b/deal.II/include/deal.II/base/utilities.h @@ -864,66 +864,6 @@ namespace Utilities } } - /** - * A replacement for std::lower_bound - * which does a binary search for a - * position in a sorted array. The - * reason for this function is obscure: - * when using the GCC libstdc++ - * function std::lower_bound, - * complexity is O(log(N)) as - * required. However, when using the - * debug version of the GCC libstdc++ - * as we do when running the testsuite, - * then std::lower_bound tests whether - * the sequence is in fact partitioned - * with respect to the pivot 'value' - * (i.e. in essence that the sequence - * is sorted as required for binary - * search to work). However, verifying - * this means that the complexity of - * std::lower_bound jumps to O(N); we - * call this function O(N) times below, - * making the overall complexity - * O(N**2). The consequence is that a - * few tests with big meshes completely - * run off the wall time limit for - * tests and fail with the libstdc++ - * debug mode - * - * Here, we know that the sequence is - * sorted, so we don't need the - * additional check - */ - template - Iterator - my_lower_bound (Iterator first, - Iterator last, - const T &value, - Comp &comp) - { - unsigned int length = std::distance(first, last); - unsigned int half; - Iterator middle; - - while (length > 0) - { - half = length >> 1; - middle = first; - std::advance(middle, half); - if (comp(*middle, value)) - { - first = middle; - ++first; - length = length - half - 1; - } - else - length = half; - } - return first; - } - - DEAL_II_NAMESPACE_CLOSE