/**
* 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
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;
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
// ---------------------------------------------------------------------
-// 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:
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