templated class implementing efficient multi-precision binary arithmetic and logic
More...
|
| | bitblock () |
| | bitblock (const bitblock &)=default |
| | bitblock (bitblock &&)=default |
| bitblock & | operator= (const bitblock &)=default |
| bitblock & | operator= (bitblock &&)=default |
| bitblock & | operator= (signed char rhs) |
| bitblock & | operator= (short rhs) |
| bitblock & | operator= (int rhs) |
| bitblock & | operator= (long rhs) |
| bitblock & | operator= (long long rhs) |
| bitblock & | operator= (char rhs) |
| bitblock & | operator= (unsigned short rhs) |
| bitblock & | operator= (unsigned int rhs) |
| bitblock & | operator= (unsigned long rhs) |
| bitblock & | operator= (unsigned long long rhs) |
| unsigned long long | to_ullong () const |
| void | setzero () |
| bool | load_bits (const std::string &string_of_bits) |
| constexpr | bitset () noexcept |
| | All bits set to zero.
|
| bitset< Nb > & | operator&= (const bitset< Nb > &rhs) noexcept |
| | Operations on bitsets.
|
| bitset< Nb > & | operator|= (const bitset< Nb > &rhs) noexcept |
| bitset< Nb > & | operator^= (const bitset< Nb > &rhs) noexcept |
| bitset< Nb > & | operator<<= (size_t position) noexcept |
| | Operations on bitsets.
|
| bitset< Nb > & | operator>>= (size_t position) noexcept |
| bitset< Nb > & | Unchecked_set (size_t pos) noexcept |
| | These versions of single-bit set, reset, flip, and test are extensions from the SGI version.
|
| bitset< Nb > & | Unchecked_reset (size_t pos) noexcept |
| bitset< Nb > & | Unchecked_flip (size_t pos) noexcept |
| constexpr bool | Unchecked_test (size_t pos) const noexcept |
| bitset< Nb > & | set () noexcept |
| | Sets every bit to true.
|
| bitset< Nb > & | reset () noexcept |
| | Sets every bit to false.
|
| bitset< Nb > & | flip () noexcept |
| | Toggles every bit to its opposite value.
|
| bitset< Nb > | operator~ () const noexcept |
| | See the no-argument flip().
|
| reference | operator[] (size_t position) |
| | Array-indexing support.
|
| unsigned long | to_ulong () const |
| | Returns a numerical interpretation of the bitset.
|
| unsigned long long | to_ullong () const |
| std::basic_string< _CharT, _Traits, _Alloc > | to_string () const |
| | Returns a character interpretation of the bitset.
|
| void | M_copy_from_ptr (const _CharT *, size_t, size_t, size_t, _CharT, _CharT) |
| void | M_copy_from_string (const std::basic_string< _CharT, _Traits, _Alloc > &s, size_t pos, size_t n, _CharT zero, _CharT one) |
| void | M_copy_to_string (std::basic_string< _CharT, _Traits, _Alloc > &, _CharT, _CharT) const |
| size_t | count () const noexcept |
| | Returns the number of bits which are set.
|
| constexpr size_t | size () const noexcept |
| | Returns the total number of bits.
|
| bool | operator== (const bitset< Nb > &rhs) const noexcept |
| | These comparisons for equality/inequality are, well, bitwise.
|
| bool | operator!= (const bitset< Nb > &rhs) const noexcept |
| bool | operator< (const bitset< Nb > &rhs) const noexcept |
| bool | operator<= (const bitset< Nb > &rhs) const noexcept |
| bool | operator> (const bitset< Nb > &rhs) const noexcept |
| bool | operator>= (const bitset< Nb > &rhs) const noexcept |
| int | getMSB () const noexcept |
| bool | increment () noexcept |
| bool | decrement () noexcept |
| bool | add (const bitset< NbOpnd > &a, const bitset< NbOpnd > &b) noexcept |
| bool | sub (const bitset< NbOpnd > &a, const bitset< NbOpnd > &b) noexcept |
| bool | test (size_t position) const |
| | Tests the value of a bit.
|
| bool | all () const noexcept |
| | Tests whether all the bits are on.
|
| bool | any () const noexcept |
| | Tests whether any of the bits are on.
|
| bool | none () const noexcept |
| | Tests whether any of the bits are on.
|
| bitset< Nb > | operator<< (size_t position) const noexcept |
| | Self-explanatory.
|
| bitset< Nb > | operator>> (size_t position) const noexcept |
| size_t | _Find_first () const noexcept |
| | Finds the index of the first "on" bit.
|
| size_t | _Find_next (size_t prev) const noexcept |
| | Finds the index of the next "on" bit after prev.
|
| constexpr | BaseBitset () noexcept |
| constexpr | BaseBitset (unsigned long long val) noexcept |
| constexpr bool | M_testBit (size_t pos) const noexcept |
| WordT & | M_getword (size_t pos) noexcept |
| constexpr WordT | M_getword (size_t pos) const noexcept |
| const WordT * | M_getdata () const noexcept |
| WordT & | M_hiword () noexcept |
| constexpr WordT | M_hiword () const noexcept |
| void | M_do_and (const BaseBitset< Nw > &x) noexcept |
| void | M_do_or (const BaseBitset< Nw > &x) noexcept |
| void | M_do_xor (const BaseBitset< Nw > &x) noexcept |
| void | M_do_left_shift (size_t shift) noexcept |
| void | M_do_right_shift (size_t shift) noexcept |
| void | M_do_flip () noexcept |
| void | M_do_set () noexcept |
| void | M_do_reset () noexcept |
| bool | M_is_equal (const BaseBitset< Nw > &x) const noexcept |
| bool | M_is_less_than (const BaseBitset< Nw > &x) const noexcept |
| | Blocked unsigned less-than operation.
|
| bool | M_is_greater_than (const BaseBitset< Nw > &x) const noexcept |
| | Blocked unsigned greater-than operation.
|
| int | M_getMSB () const noexcept |
| | Finds the position of the highest set bit.
|
| bool | M_increment () noexcept |
| | Increments underlying value by unity.
|
| bool | M_decrement () noexcept |
| | Decrements underlying value by unity.
|
| bool | M_do_add (const BaseBitset< UBB_WORDS(Nb)> &a, const BaseBitset< UBB_WORDS(Nb)> &b) noexcept |
| | Slotwise addtion to this value.
|
| bool | M_do_add (const BaseBitset< UBB_WORDS(Nb)> &a) noexcept |
| | Slotwise increment of this value.
|
| bool | M_do_sub (const BaseBitset< UBB_WORDS(Nb)> &a, const BaseBitset< UBB_WORDS(Nb)> &b) noexcept |
| | Slotwise subtraction into this value.
|
| bool | M_do_sub (const BaseBitset< UBB_WORDS(Nb)> &a) noexcept |
| | Slotwise decrement of this value.
|
| bool | M_are_all () const noexcept |
| bool | M_is_any () const noexcept |
| size_t | M_do_count () const noexcept |
| unsigned long | M_do_to_ulong () const |
| unsigned long long | M_do_to_ullong () const |
| size_t | M_do_find_first (size_t) const noexcept |
| size_t | M_do_find_next (size_t, size_t) const noexcept |
|
| static int | S_getMSB (const WordT &val) |
| | Finds leading bit of value passed.
|
| static bool | S_increment (WordT &val) |
| | increments the value passed.
|
| static bool | S_decrement (WordT &val) |
| | decrements the value passed.
|
| static bool | S_add (WordT &accum, const WordT &a, const WordT &b, bool carry) |
| | Performs a two-operand addition on a single slot.
|
| static bool | S_add (WordT &accum, const WordT &a, bool carry) |
| | Performs a two-operand addition on a single slot.
|
| static bool | S_sub (WordT &accum, const WordT &a, const WordT &b, const bool borrow) |
| | Performs a two-operand subtraction on a single slot.
|
| static bool | S_sub (WordT &accum, const WordT &a, bool borrow) |
| | Performs a single-operand subtraction.
|
| static constexpr size_t | S_whichword (size_t pos) noexcept |
| static constexpr size_t | S_whichbyte (size_t pos) noexcept |
| static constexpr size_t | S_whichbit (size_t pos) noexcept |
| static constexpr WordT | S_maskbit (size_t pos) noexcept |
| WordT | M_w [Nw] |
| | 0 is the least significant word.
|
template<size_t nbits>
class sw::universal::bitblock< nbits >
templated class implementing efficient multi-precision binary arithmetic and logic