aboutsummaryrefslogtreecommitdiffstats
path: root/chilbert/FixBitVec.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'chilbert/FixBitVec.hpp')
-rw-r--r--chilbert/FixBitVec.hpp27
1 files changed, 7 insertions, 20 deletions
diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp
index c03bbd8..bea1c1a 100644
--- a/chilbert/FixBitVec.hpp
+++ b/chilbert/FixBitVec.hpp
@@ -75,18 +75,6 @@ public:
return (*this);
}
- // Truncates the bit-vector to a given precision in
- // bits (zeroes MSBs without shrinking the vector)
- CFixBitVec &
- truncate(
- int iBits
- )
- {
- assert( 0 <= iBits && iBits <= FBV_BITS );
- m_uiRack &= FBVN1S(iBits);
- return (*this);
- }
-
// Assignment operator.
CFixBitVec &
operator=(
@@ -304,14 +292,6 @@ public:
}
- // Calculates the Gray Code.
- CFixBitVec &
- grayCode()
- {
- m_uiRack ^= (m_uiRack>>1);
- return (*this);
- }
-
// Ones-complements the rack
CFixBitVec &
flip()
@@ -360,6 +340,13 @@ private:
template <>
void
+grayCode(CFixBitVec& value)
+{
+ value.rack() ^= (value.rack() >> 1);
+}
+
+template <>
+void
grayCodeInv(CFixBitVec& value)
{
grayCodeInv<FBV_UINT>(value.rack());