aboutsummaryrefslogtreecommitdiffstats
path: root/chilbert/Hilbert.ipp
diff options
context:
space:
mode:
Diffstat (limited to 'chilbert/Hilbert.ipp')
-rw-r--r--chilbert/Hilbert.ipp54
1 files changed, 28 insertions, 26 deletions
diff --git a/chilbert/Hilbert.ipp b/chilbert/Hilbert.ipp
index 81eb7fd..0b02fba 100644
--- a/chilbert/Hilbert.ipp
+++ b/chilbert/Hilbert.ipp
@@ -19,10 +19,10 @@
#ifndef CHILBERT_ALGORITHM_HPP
#define CHILBERT_ALGORITHM_HPP
-#include "chilbert/BigBitVec.hpp"
-#include "chilbert/FixBitVec.hpp"
+#include "chilbert/DynamicBitVec.hpp"
#include "chilbert/GrayCodeRank.hpp"
#include "chilbert/Hilbert.hpp"
+#include "chilbert/SmallBitVec.hpp"
#include "chilbert/StaticBitVec.hpp"
#include <cassert>
@@ -50,8 +50,8 @@ num_bits(const T&, std::enable_if_t<std::is_integral<T>::value>* = nullptr)
template <class T>
size_t
num_bits(const T& vec,
- std::enable_if_t<std::is_same<T, CFixBitVec>::value ||
- std::is_same<T, CBigBitVec>::value>* = nullptr)
+ std::enable_if_t<std::is_same<T, SmallBitVec>::value ||
+ std::is_same<T, DynamicBitVec>::value>* = nullptr)
{
return vec.size();
}
@@ -316,15 +316,15 @@ coords_to_compact_index(const P* const p,
size_t* const ds = new size_t[m];
if (mn > FBV_BITS) {
- CBigBitVec h(mn);
- detail::coords_to_index<P, CBigBitVec, I>(
+ DynamicBitVec h(mn);
+ detail::coords_to_index<P, DynamicBitVec, I>(
p, m, n, h, std::move(scratch), ds);
- compact_index<CBigBitVec, HC>(ms, ds, n, m, h, hc);
+ compact_index<DynamicBitVec, HC>(ms, ds, n, m, h, hc);
} else {
- CFixBitVec h(mn);
- detail::coords_to_index<P, CFixBitVec, I>(
+ SmallBitVec h(mn);
+ detail::coords_to_index<P, SmallBitVec, I>(
p, m, n, h, std::move(scratch), ds);
- compact_index<CFixBitVec, HC>(ms, ds, n, m, h, hc);
+ compact_index<SmallBitVec, HC>(ms, ds, n, m, h, hc);
}
delete[] ds;
@@ -415,10 +415,11 @@ coords_to_index(const P* const p, const size_t m, const size_t n, H& h)
if (n <= FBV_BITS) {
// Intermediate variables will fit in fixed width
- detail::coords_to_index<P, H, CFixBitVec>(p, m, n, h, CFixBitVec(n));
+ detail::coords_to_index<P, H, SmallBitVec>(p, m, n, h, SmallBitVec(n));
} else {
- // Otherwise, they must be BigBitVecs
- detail::coords_to_index<P, H, CBigBitVec>(p, m, n, h, CBigBitVec(n));
+ // Otherwise, they must be DynamicBitVecs
+ detail::coords_to_index<P, H, DynamicBitVec>(
+ p, m, n, h, DynamicBitVec(n));
}
}
@@ -433,10 +434,11 @@ index_to_coords(P* const p, const size_t m, const size_t n, const H& h)
if (n <= FBV_BITS) {
// Intermediate variables will fit in fixed width
- detail::index_to_coords<P, H, CFixBitVec>(p, m, n, h, CFixBitVec(n));
+ detail::index_to_coords<P, H, SmallBitVec>(p, m, n, h, SmallBitVec(n));
} else {
- // Otherwise, they must be BigBitVecs
- detail::index_to_coords<P, H, CBigBitVec>(p, m, n, h, CBigBitVec(n));
+ // Otherwise, they must be DynamicBitVecs
+ detail::index_to_coords<P, H, DynamicBitVec>(
+ p, m, n, h, DynamicBitVec(n));
}
}
@@ -453,12 +455,12 @@ coords_to_compact_index(const P* const p,
if (n <= FBV_BITS) {
// Intermediate variables will fit in fixed width
- detail::coords_to_compact_index<P, HC, CFixBitVec>(
- p, ms, n, hc, CFixBitVec(n), M, m);
+ detail::coords_to_compact_index<P, HC, SmallBitVec>(
+ p, ms, n, hc, SmallBitVec(n), M, m);
} else {
- // Otherwise, they must be BigBitVecs
- detail::coords_to_compact_index<P, HC, CBigBitVec>(
- p, ms, n, hc, CBigBitVec(n), M, m);
+ // Otherwise, they must be DynamicBitVecs
+ detail::coords_to_compact_index<P, HC, DynamicBitVec>(
+ p, ms, n, hc, DynamicBitVec(n), M, m);
}
}
@@ -475,13 +477,13 @@ compact_index_to_coords(P* const p,
if (n <= FBV_BITS) {
// Intermediate variables will fit in fixed width
- CFixBitVec scratch(n);
- detail::compact_index_to_coords<P, HC, CFixBitVec>(
+ SmallBitVec scratch(n);
+ detail::compact_index_to_coords<P, HC, SmallBitVec>(
p, ms, n, hc, std::move(scratch), M, m);
} else {
- // Otherwise, they must be BigBitVecs
- CBigBitVec scratch(n);
- detail::compact_index_to_coords<P, HC, CBigBitVec>(
+ // Otherwise, they must be DynamicBitVecs
+ DynamicBitVec scratch(n);
+ detail::compact_index_to_coords<P, HC, DynamicBitVec>(
p, ms, n, hc, std::move(scratch), M, m);
}
}