From 9c245e9e263c90f240b386dc6f619affb80151f6 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 30 Oct 2018 14:30:05 +0100 Subject: [PATCH] rename and improve documentation --- include/deal.II/base/utilities.h | 20 ++++++++++++-------- source/base/utilities.cc | 10 +++++----- tests/base/utilities_14.cc | 4 ++-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index a79c44664c..63cc366803 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -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 - * bits\_per\_dim * dim <= 64. + * (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 bits\_per\_dim * dim <= + * 64. + * + * 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 std::lexicographical_compare(). + * returned by inverse_Hilbert_space_filling_curve(), as that can easily be + * done via std::lexicographical_compare(). */ template std::uint64_t - interleave(const std::array &index, - const int bits_per_dim); + pack_integers(const std::array &index, + const int bits_per_dim); /** * Convert a number @p value to a string, with as many digits as given to diff --git a/source/base/utilities.cc b/source/base/utilities.cc index d8a940908f..c3a5448395 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -270,8 +270,8 @@ namespace Utilities template std::uint64_t - interleave(const std::array &index, - const int bits_per_dim) + pack_integers(const std::array &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 &, const int); + pack_integers<1>(const std::array &, const int); template std::uint64_t - interleave<2>(const std::array &, const int); + pack_integers<2>(const std::array &, const int); template std::uint64_t - interleave<3>(const std::array &, const int); + pack_integers<3>(const std::array &, const int); } // namespace Utilities DEAL_II_NAMESPACE_CLOSE diff --git a/tests/base/utilities_14.cc b/tests/base/utilities_14.cc index 7298ca6b12..ff61589200 100644 --- a/tests/base/utilities_14.cc +++ b/tests/base/utilities_14.cc @@ -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 -- 2.39.5