Binary arithmetic (boolean) class. More...
#include <itpp/base/binary.h>
Public Member Functions | |
| bin () | |
| Default constructor. More... | |
| bin (const int &value) | |
Set the binary object equal to value. Either "0" or "1". More... | |
| bin (const bin &inbin) | |
| Copy constructor. More... | |
| void | operator= (const int &value) |
| Assign a value. More... | |
| void | operator= (const bin &inbin) |
| Assign a value. More... | |
| void | operator/= (const bin &inbin) |
| OR. More... | |
| void | operator|= (const bin &inbin) |
| OR. More... | |
| bin | operator/ (const bin &inbin) const |
| OR. More... | |
| bin | operator| (const bin &inbin) const |
| OR. More... | |
| void | operator+= (const bin &inbin) |
| XOR. More... | |
| void | operator^= (const bin &inbin) |
| XOR. More... | |
| bin | operator+ (const bin &inbin) const |
| XOR. More... | |
| bin | operator^ (const bin &inbin) const |
| XOR. More... | |
| void | operator-= (const bin &inbin) |
| XOR. More... | |
| bin | operator- (const bin &inbin) const |
| XOR. More... | |
| bin | operator- () const |
| Dummy definition to be able to use vec<bin> More... | |
| void | operator*= (const bin &inbin) |
| AND. More... | |
| void | operator&= (const bin &inbin) |
| AND. More... | |
| bin | operator* (const bin &inbin) const |
| AND. More... | |
| bin | operator& (const bin &inbin) const |
| AND. More... | |
| bin | operator! (void) const |
| NOT. More... | |
| bin | operator~ (void) const |
| NOT. More... | |
| bool | operator== (const bin &inbin) const |
| Check if equal. More... | |
| bool | operator== (const int &i) const |
| Check if equal. More... | |
| bool | operator!= (const bin &inbin) const |
| Check if not equal. More... | |
| bool | operator!= (const int &i) const |
| Check if not equal. More... | |
| bool | operator< (const bin &inbin) const |
| Less than (interpret the binary values {0,1} as integers) More... | |
| bool | operator<= (const bin &inbin) const |
| Less than equal (interpret the binary values {0,1} as integers) More... | |
| bool | operator> (const bin &inbin) const |
| Greater than (interpret the binary values {0,1} as integers) More... | |
| bool | operator>= (const bin &inbin) const |
| Greater than equal (interpret the binary values {0,1} as integers) More... | |
| operator short () const | |
Convert bin to short. More... | |
| operator int () const | |
Convert bin to int. More... | |
| operator bool () const | |
Convert bin to bool. More... | |
| operator float () const | |
Convert bin to float. More... | |
| operator double () const | |
Convert bin to double. More... | |
| char | value () const |
| Output the binary value of the object. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| ITPP_EXPORT std::ostream & | operator<< (std::ostream &output, const bin &inbin) |
| Output stream of bin. More... | |
| ITPP_EXPORT std::istream & | operator>> (std::istream &input, bin &outbin) |
| Input stream of bin. More... | |
| bin | abs (const bin &inbin) |
| absolute value of bin More... | |
| int | abs (const itpp::bin &inbin) |
| absolute value of bin More... | |
Binary arithmetic (boolean) class.
This class creates a binary arithmetic class, following the ordinary rules for binary (GF(2)) fields.
Examples:
|
inline |
Default constructor.
Definition at line 60 of file binary.h.
Referenced by operator!(), operator&(), operator*(), operator+(), operator-(), operator/(), operator^(), operator|(), and operator~().
|
inline |
Set the binary object equal to value. Either "0" or "1".
Definition at line 63 of file binary.h.
References it_assert_debug, and value().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Output the binary value of the object.
Definition at line 152 of file binary.h.
Referenced by bin(), itpp::it_file::low_level_write(), itpp::it_file_old::low_level_write(), and operator=().
|
related |
Output stream of bin.
Definition at line 36 of file binary.cpp.
|
related |
|
related |
Generated on Wed Mar 30 2022 00:00:00 for IT++ by Doxygen 1.9.3