From b0052b4d21f00183d61bc11865f99d3d94a4593c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 25 Sep 2011 18:09:17 +0000 Subject: [PATCH] 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 --- deal.II/include/deal.II/base/utilities.h | 60 ------------------------ 1 file changed, 60 deletions(-) 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 -- 2.39.5