diff options
author | David Robillard <d@drobilla.net> | 2018-08-19 17:59:20 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-29 14:49:56 +0200 |
commit | 7567f77828ff9661f85eabe3b4cfb1876b307d42 (patch) | |
tree | 82c44086cd8a8ed7025b342d5e3edd1add6ea1e0 /test | |
parent | c48d56bcc0c919007d712d8716c86714e387554b (diff) | |
download | chilbert-7567f77828ff9661f85eabe3b4cfb1876b307d42.tar.gz chilbert-7567f77828ff9661f85eabe3b4cfb1876b307d42.tar.bz2 chilbert-7567f77828ff9661f85eabe3b4cfb1876b307d42.zip |
Remove old macros
Diffstat (limited to 'test')
-rw-r--r-- | test/test_hilbert.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/test/test_hilbert.cpp b/test/test_hilbert.cpp index ad99454..a217dc2 100644 --- a/test/test_hilbert.cpp +++ b/test/test_hilbert.cpp @@ -69,10 +69,11 @@ template <class T> mpz_class to_big_int(const T& vec) { + using Rack = typename T::Rack; + mpz_t ia; mpz_init(ia); - mpz_import( - ia, vec.num_racks(), -1, sizeof(chilbert::FBV_UINT), 0, 0, vec.data()); + mpz_import(ia, vec.num_racks(), -1, sizeof(Rack), 0, 0, vec.data()); const mpz_class num(ia); mpz_clear(ia); return num; @@ -83,15 +84,11 @@ template <class T, size_t M> T from_big_int(const mpz_class& num) { + using Rack = typename T::Rack; + T vec = make_zero_bitvec<T, M>(); size_t count = 0; - mpz_export(vec.data(), - &count, - -1, - sizeof(chilbert::FBV_UINT), - 0, - 0, - num.get_mpz_t()); + mpz_export(vec.data(), &count, -1, sizeof(Rack), 0, 0, num.get_mpz_t()); assert(count <= static_cast<size_t>(vec.num_racks())); return vec; } @@ -100,7 +97,7 @@ template <class H, size_t M, size_t D> void test_standard(Context& ctx) { - static_assert(M < sizeof(chilbert::FBV_UINT) * CHAR_BIT, ""); + static_assert(M < sizeof(typename H::Rack) * CHAR_BIT, ""); // Generate random point and its hilbert index const auto pa = make_random_point<M, D>(ctx); @@ -135,7 +132,7 @@ template <class T, size_t M, size_t D> void test_compact(Context& ctx) { - static_assert(M < sizeof(chilbert::FBV_UINT) * CHAR_BIT, ""); + static_assert(M < sizeof(typename T::Rack) * CHAR_BIT, ""); // Generate random point and its hilbert index const auto ms = make_random_precisions<D * M, D>(ctx); |