diff options
author | David Robillard <d@drobilla.net> | 2018-08-05 15:23:54 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-08-07 20:01:28 +0200 |
commit | a7667a2540a9336c141a5f26a802a61bd719f79b (patch) | |
tree | 3c6f86f8ad8916ecaa32805bab446a949ce1fb67 /chilbert/FixBitVec.hpp | |
parent | 66b11470cd34eddd54a7d969a2ef104a6cbe9c39 (diff) | |
download | chilbert-a7667a2540a9336c141a5f26a802a61bd719f79b.tar.gz chilbert-a7667a2540a9336c141a5f26a802a61bd719f79b.tar.bz2 chilbert-a7667a2540a9336c141a5f26a802a61bd719f79b.zip |
Use raw integers in BigBitVec
Diffstat (limited to 'chilbert/FixBitVec.hpp')
-rw-r--r-- | chilbert/FixBitVec.hpp | 27 |
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()); |