aboutsummaryrefslogtreecommitdiffstats
path: root/chilbert/FixBitVec.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'chilbert/FixBitVec.hpp')
-rw-r--r--chilbert/FixBitVec.hpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp
index 3cdd6ff..3a72599 100644
--- a/chilbert/FixBitVec.hpp
+++ b/chilbert/FixBitVec.hpp
@@ -355,21 +355,6 @@ public:
return (*this);
}
- // Calculates the Gray Code Inverse
- CFixBitVec &
- grayCodeInv()
- {
- m_uiRack ^= (m_uiRack>>1);
- m_uiRack ^= (m_uiRack>>2);
- m_uiRack ^= (m_uiRack>>4);
- m_uiRack ^= (m_uiRack>> 8);
- m_uiRack ^= (m_uiRack>>16);
-#if FBV_BITS == 64
- m_uiRack ^= (m_uiRack>>32);
-#endif
- return (*this);
- }
-
// Ones-complements the rack
CFixBitVec &
flip()
@@ -416,6 +401,13 @@ private:
FBV_UINT m_uiRack;
};
+template <>
+void
+grayCodeInv(CFixBitVec& value)
+{
+ grayCodeInv<FBV_UINT>(value.rack());
+}
+
} // namespace chilbert
#endif