]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove a global function that apparently snuck in there by accident in r23944.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 25 Sep 2011 18:09:17 +0000 (18:09 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 25 Sep 2011 18:09:17 +0000 (18:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@24406 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/utilities.h

index c1273dbafd7cfbf2dbbdfde99c54c11f040fa3f4..7a821167276f09c8461961d11b7ca461cebe0a3f 100644 (file)
@@ -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<typename Iterator, typename T, typename Comp>
-      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
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.