]> https://gitweb.dealii.org/ - dealii.git/commitdiff
rename and improve documentation
authorDenis Davydov <davydden@gmail.com>
Tue, 30 Oct 2018 13:30:05 +0000 (14:30 +0100)
committerDenis Davydov <davydden@gmail.com>
Thu, 1 Nov 2018 16:25:41 +0000 (17:25 +0100)
include/deal.II/base/utilities.h
source/base/utilities.cc
tests/base/utilities_14.cc

index a79c44664c4462008a66b1d78eabf7bacb9f758b..63cc366803dd29b4ab9a5428b76fd8616f02051a 100644 (file)
@@ -105,19 +105,23 @@ namespace Utilities
 
   /**
    * Interleave first @p bits_per_dim bits from each element of @p index
-   * (starting from last) into a single unsigned integer. The function is useful
-   * in debugging and visualization of indices returned by
-   * inverse_Hilbert_space_filling_curve(). Clearly, the following should hold
-   * <code>bits\_per\_dim * dim <= 64</code>.
+   * (starting from last) into a single unsigned integer. The last element
+   * of @p index will be used to set the first @p bits_per_dim in the the
+   * resulting integer, the pre last element is used to set the next @p bits_per_dim,
+   * etc. Clearly, the following should hold <code>bits\_per\_dim * dim <=
+   * 64</code>.
+   *
+   * The function is useful in debugging and visualization of indices returned
+   * by inverse_Hilbert_space_filling_curve().
    *
    * @note There is no need to use this function in order to compare indices
-   * returned by inverse_Hilbert_space_filling_curve(), as that can easily be done
-   * via <code>std::lexicographical_compare()</code>.
+   * returned by inverse_Hilbert_space_filling_curve(), as that can easily be
+   * done via <code>std::lexicographical_compare()</code>.
    */
   template <int dim>
   std::uint64_t
-  interleave(const std::array<std::uint64_t, dim> &index,
-             const int                             bits_per_dim);
+  pack_integers(const std::array<std::uint64_t, dim> &index,
+                const int                             bits_per_dim);
 
   /**
    * Convert a number @p value to a string, with as many digits as given to
index d8a940908f1bb78675dfd732ef99401ad8d14269..c3a5448395193de533a20bc2bc8fb8cf1bc8ff0d 100644 (file)
@@ -270,8 +270,8 @@ namespace Utilities
 
   template <int dim>
   std::uint64_t
-  interleave(const std::array<std::uint64_t, dim> &index,
-             const int                             bits_per_dim)
+  pack_integers(const std::array<std::uint64_t, dim> &index,
+                const int                             bits_per_dim)
   {
     using Integer = std::uint64_t;
 
@@ -1131,11 +1131,11 @@ namespace Utilities
     const int);
 
   template std::uint64_t
-  interleave<1>(const std::array<std::uint64_t, 1> &, const int);
+  pack_integers<1>(const std::array<std::uint64_t, 1> &, const int);
   template std::uint64_t
-  interleave<2>(const std::array<std::uint64_t, 2> &, const int);
+  pack_integers<2>(const std::array<std::uint64_t, 2> &, const int);
   template std::uint64_t
-  interleave<3>(const std::array<std::uint64_t, 3> &, const int);
+  pack_integers<3>(const std::array<std::uint64_t, 3> &, const int);
 } // namespace Utilities
 
 DEAL_II_NAMESPACE_CLOSE
index 7298ca6b126898286e62cfe567bad807f5074761..ff6158920071ab99dddc949ca17df72e2470c5e2 100644 (file)
@@ -14,7 +14,7 @@
 // ---------------------------------------------------------------------
 
 
-// test Utilities::interleave() for indices from
+// test Utilities::pack_integers() for indices from
 // Utilities::inverse_Hilbert_space_filling_curve in 2D on the following points
 // with bits=2:
 
@@ -60,7 +60,7 @@ test()
 
   for (const auto &p : res)
     deallog << p[0] << " " << p[1] << " "
-            << Utilities::interleave<2>(p, bit_depth) << std::endl;
+            << Utilities::pack_integers<2>(p, bit_depth) << std::endl;
 }
 
 int

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.