diff options
-rw-r--r-- | test/test_hilbert.cpp | 12 | ||||
-rw-r--r-- | test/test_utils.hpp | 15 |
2 files changed, 14 insertions, 13 deletions
diff --git a/test/test_hilbert.cpp b/test/test_hilbert.cpp index 307dbae..1d32668 100644 --- a/test/test_hilbert.cpp +++ b/test/test_hilbert.cpp @@ -27,18 +27,6 @@ #include <gmpxx.h> -/// Return a `D`-dimensional point with `M` bits of precision per dimension -template <size_t M, size_t D> -std::array<uint64_t, D> -make_random_point(Context& ctx) -{ - std::array<uint64_t, D> p; - for (size_t i = 0; i < D; ++i) { - p[i] = rand_between(ctx, 0, (1UL << M) - 1); - } - return p; -} - /// Return a `D`-dimensional point within `ms` per-dimension precision template <size_t D> std::array<uint64_t, D> diff --git a/test/test_utils.hpp b/test/test_utils.hpp index 7c52f56..63b760c 100644 --- a/test/test_utils.hpp +++ b/test/test_utils.hpp @@ -72,7 +72,8 @@ std::array<size_t, D> make_random_precisions(Context& ctx) { std::array<size_t, D> ms; - size_t bits_left = N; + + size_t bits_left = N; for (size_t i = 0; i < D; ++i) { ms[i] = rand_between(ctx, 1, std::min(Max, bits_left / (D - i) + 1)); bits_left -= ms[i]; @@ -81,4 +82,16 @@ make_random_precisions(Context& ctx) return ms; } +/// Return a `D`-dimensional point with `M` bits of precision per dimension +template <size_t M, size_t D> +std::array<uint64_t, D> +make_random_point(Context& ctx) +{ + std::array<uint64_t, D> p; + for (size_t i = 0; i < D; ++i) { + p[i] = rand_between(ctx, 0, (1UL << M) - 1); + } + return p; +} + #endif |