Binary arithmetic (boolean) class.
More...
#include <itpp/base/binary.h>
|
(Note that these are not member functions.)
|
ITPP_EXPORT std::ostream & | operator<< (std::ostream &output, const bin &inbin) |
| Output stream of bin.
|
|
ITPP_EXPORT std::istream & | operator>> (std::istream &input, bin &outbin) |
| Input stream of bin.
|
|
bin | abs (const bin &inbin) |
| absolute value of bin
|
|
int | abs (const itpp::bin &inbin) |
| absolute value of bin
|
|
Binary arithmetic (boolean) class.
- Author
- Tony Ottosson
This class creates a binary arithmetic class, following the ordinary rules for binary (GF(2)) fields.
Examples:
c = !a;
c = a * b;
c = a / b;
Binary arithmetic (boolean) class.
Definition at line 56 of file binary.h.
◆ bin() [1/3]
◆ bin() [2/3]
itpp::bin::bin |
( |
const int & |
value | ) |
|
|
inline |
◆ bin() [3/3]
itpp::bin::bin |
( |
const bin & |
inbin | ) |
|
|
inline |
Copy constructor.
Definition at line 69 of file binary.h.
◆ operator=() [1/2]
void itpp::bin::operator= |
( |
const int & |
value | ) |
|
|
inline |
◆ operator=() [2/2]
void itpp::bin::operator= |
( |
const bin & |
inbin | ) |
|
|
inline |
Assign a value.
Definition at line 79 of file binary.h.
◆ operator/=()
void itpp::bin::operator/= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator|=()
void itpp::bin::operator|= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator/()
bin itpp::bin::operator/ |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator|()
bin itpp::bin::operator| |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator+=()
void itpp::bin::operator+= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator^=()
void itpp::bin::operator^= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator+()
bin itpp::bin::operator+ |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator^()
bin itpp::bin::operator^ |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator-=()
void itpp::bin::operator-= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator-() [1/2]
bin itpp::bin::operator- |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator-() [2/2]
bin itpp::bin::operator- |
( |
| ) |
const |
|
inline |
Dummy definition to be able to use vec<bin>
Definition at line 104 of file binary.h.
References bin().
◆ operator*=()
void itpp::bin::operator*= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator&=()
void itpp::bin::operator&= |
( |
const bin & |
inbin | ) |
|
|
inline |
◆ operator*()
bin itpp::bin::operator* |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator&()
bin itpp::bin::operator& |
( |
const bin & |
inbin | ) |
const |
|
inline |
◆ operator!()
bin itpp::bin::operator! |
( |
void |
| ) |
const |
|
inline |
◆ operator~()
bin itpp::bin::operator~ |
( |
void |
| ) |
const |
|
inline |
◆ operator==() [1/2]
bool itpp::bin::operator== |
( |
const bin & |
inbin | ) |
const |
|
inline |
Check if equal.
Definition at line 121 of file binary.h.
◆ operator==() [2/2]
bool itpp::bin::operator== |
( |
const int & |
i | ) |
const |
|
inline |
Check if equal.
Definition at line 123 of file binary.h.
◆ operator!=() [1/2]
Check if not equal.
Definition at line 126 of file binary.h.
◆ operator!=() [2/2]
Check if not equal.
Definition at line 128 of file binary.h.
◆ operator<()
bool itpp::bin::operator< |
( |
const bin & |
inbin | ) |
const |
|
inline |
Less than (interpret the binary values {0,1} as integers)
Definition at line 131 of file binary.h.
◆ operator<=()
bool itpp::bin::operator<= |
( |
const bin & |
inbin | ) |
const |
|
inline |
Less than equal (interpret the binary values {0,1} as integers)
Definition at line 133 of file binary.h.
◆ operator>()
bool itpp::bin::operator> |
( |
const bin & |
inbin | ) |
const |
|
inline |
Greater than (interpret the binary values {0,1} as integers)
Definition at line 136 of file binary.h.
◆ operator>=()
bool itpp::bin::operator>= |
( |
const bin & |
inbin | ) |
const |
|
inline |
Greater than equal (interpret the binary values {0,1} as integers)
Definition at line 138 of file binary.h.
◆ operator short()
itpp::bin::operator short |
( |
| ) |
const |
|
inline |
Convert bin
to short
.
Definition at line 141 of file binary.h.
◆ operator int()
itpp::bin::operator int |
( |
| ) |
const |
|
inline |
Convert bin
to int
.
Definition at line 143 of file binary.h.
◆ operator bool()
itpp::bin::operator bool |
( |
| ) |
const |
|
inline |
Convert bin
to bool
.
Definition at line 145 of file binary.h.
◆ operator float()
itpp::bin::operator float |
( |
| ) |
const |
|
inline |
Convert bin
to float
.
Definition at line 147 of file binary.h.
◆ operator double()
itpp::bin::operator double |
( |
| ) |
const |
|
inline |
Convert bin
to double
.
Definition at line 149 of file binary.h.
◆ value()
char itpp::bin::value |
( |
| ) |
const |
|
inline |
◆ operator<<()
ITPP_EXPORT std::ostream & operator<< |
( |
std::ostream & |
output, |
|
|
const bin & |
inbin |
|
) |
| |
|
related |
Output stream of bin.
Definition at line 36 of file binary.cpp.
◆ operator>>()
ITPP_EXPORT std::istream & operator>> |
( |
std::istream & |
input, |
|
|
bin & |
outbin |
|
) |
| |
|
related |
◆ abs() [1/2]
absolute value of bin
Definition at line 174 of file binary.h.
◆ abs() [2/2]
absolute value of bin
Definition at line 186 of file binary.h.
The documentation for this class was generated from the following file: