From 03f39c8be08d632d1f982f5ba5f2e95256be1122 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Aug 2018 16:47:38 +0200 Subject: Use consistent naming scheme --- test/test_bitvec.cpp | 10 +++++----- test/test_gray_code_rank.cpp | 16 ++++++++-------- test/test_hilbert.cpp | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'test') diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index b891aca..fdadb19 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -251,13 +251,13 @@ test_gray_code(Context& ctx) { const T v = make_random_bitvec(ctx); T r = v; - grayCode(r); + gray_code(r); if (N > 0) { assert(N == 1 || r == (v ^ (v >> 1))); T s = r; - grayCodeInv(s); + gray_code_inv(s); assert(s == v); } } @@ -270,11 +270,11 @@ test_comparison(Context&) T b = make_zero_bitvec(); for (size_t bit = 1; bit < N; ++bit) { - setBit(a, bit, 1); + set_bit(a, bit, 1); for (size_t i = 0; i < bit; ++i) { - setBit(a, i, rand() % 2 == 0); - setBit(b, i, rand() % 2 == 0); + set_bit(a, i, rand() % 2 == 0); + set_bit(b, i, rand() % 2 == 0); } assert(b < a); diff --git a/test/test_gray_code_rank.cpp b/test/test_gray_code_rank.cpp index 8be40f1..fa3fe3c 100644 --- a/test/test_gray_code_rank.cpp +++ b/test/test_gray_code_rank.cpp @@ -38,7 +38,7 @@ get_mask(const std::array& ms, const size_t d, const size_t step) { T mask = make_zero_bitvec(); size_t b; - chilbert::extractMask(ms.data(), D, d, step, mask, b); + chilbert::extract_mask(ms.data(), D, d, step, mask, b); assert(b == mask.count()); @@ -74,21 +74,21 @@ test_gray_code_rank(Context& ctx) const auto b = make_random_bitvec(ctx); auto ga = a; - grayCode(ga); + gray_code(ga); auto gb = b; - grayCode(gb); + gray_code(gb); // Calculate gray code ranks auto ra = make_zero_bitvec(); - chilbert::grayCodeRank(mask, ga, D, ra); + chilbert::gray_code_rank(mask, ga, D, ra); auto rb = make_zero_bitvec(); - chilbert::grayCodeRank(mask, gb, D, rb); + chilbert::gray_code_rank(mask, gb, D, rb); // Ensure ranks have at most mask.count() bits auto max = make_zero_bitvec(); - setBit(max, mask.count(), 1); + set_bit(max, mask.count(), 1); assert(ra < max); assert(rb < max); @@ -101,11 +101,11 @@ test_gray_code_rank(Context& ctx) const auto pat = ~mask; auto ga_out = make_zero_bitvec(); auto gag_out = make_zero_bitvec(); - grayCodeRankInv(mask, pat, ra, D, mask.count(), gag_out, ga_out); + gray_code_rank_inv(mask, pat, ra, D, mask.count(), gag_out, ga_out); assert((ga_out & mask) == (ga & mask)); auto gag_check = ga_out; - grayCode(gag_check); + gray_code(gag_check); assert(gag_check == gag_out); } } diff --git a/test/test_hilbert.cpp b/test/test_hilbert.cpp index 36a2992..0daf749 100644 --- a/test/test_hilbert.cpp +++ b/test/test_hilbert.cpp @@ -106,12 +106,12 @@ test_standard(Context& ctx) H ha = make_zero_bitvec(); assert(ha.size() >= D * M); - chilbert::coordsToIndex(pa.data(), M, D, ha); + chilbert::coords_to_index(pa.data(), M, D, ha); { // Ensure unmapping results in the original point auto pa_out = make_random_point(ctx); - chilbert::indexToCoords(pa_out.data(), M, D, ha); + chilbert::index_to_coords(pa_out.data(), M, D, ha); assert(pa_out == pa); } @@ -124,7 +124,7 @@ test_standard(Context& ctx) // Unmap next hilbert index to a point auto pb = make_random_point(ctx); - chilbert::indexToCoords(pb.data(), M, D, hb); + chilbert::index_to_coords(pb.data(), M, D, hb); // Ensure next point is 1 unit of distance away from first assert(squared_distance(pa, pb) == 1); @@ -142,12 +142,12 @@ test_compact(Context& ctx) T ha = make_zero_bitvec(); assert(ha.size() >= D * M); - chilbert::coordsToCompactIndex(pa.data(), ms.data(), D, ha); + chilbert::coords_to_compact_index(pa.data(), ms.data(), D, ha); { // Ensure unmapping results in the original point auto pa_out = make_random_point(ctx); - chilbert::compactIndexToCoords(pa_out.data(), ms.data(), D, ha); + chilbert::compact_index_to_coords(pa_out.data(), ms.data(), D, ha); assert(pa_out == pa); } @@ -160,7 +160,7 @@ test_compact(Context& ctx) // Unmap next hilbert index to a point auto pb = make_random_point(ctx); - chilbert::compactIndexToCoords(pb.data(), ms.data(), D, hb); + chilbert::compact_index_to_coords(pb.data(), ms.data(), D, hb); // Ensure next point is 1 unit of distance away from first assert(squared_distance(pa, pb) == 1); -- cgit v1.2.1