Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

SPUC::bit Class Reference

Binary arithmetic (boolean) class. More...

#include <bit.h>

List of all members.

Public Member Functions

 bit ()
 Default constructor.
 bit (const short value)
 Set the binary object equal to value. Either "0" or "1".
 bit (const bit &inbin)
void operator= (const short &value)
 Assign a value.
void operator= (const bit &inbin)
 Assign a value.
void operator/= (const bit &inbin)
 OR.
void operator|= (const bit &inbin)
 OR.
bit operator/ (const bit &inbin) const
 OR.
bit operator| (const bit &inbin) const
 OR.
void operator+= (const bit &inbin)
 XOR.
void operator^= (const bit &inbin)
 XOR.
bit operator+ (const bit &inbin) const
 XOR.
bit operator^ (const bit &inbin) const
 XOR.
void operator-= (const bit &inbin)
 XOR.
bit operator- (const bit &inbin) const
 XOR.
bit operator- () const
 Dummy definition to be able to use vec<bin>.
void operator *= (const bit &inbin)
 AND.
void operator &= (const bit &inbin)
 AND.
bit operator * (const bit &inbin) const
 AND.
bit operator & (const bit &inbin) const
 AND.
bit operator! (void) const
 NOT.
bit operator~ (void) const
 NOT.
bool operator== (const bit &inbin) const
 Check if equal.
bool operator== (const int &inbin) const
 Check if equal.
bool operator!= (const bit &inbin) const
 Check if not equal.
bool operator!= (const int &inbin) const
 Check if not equal.
bool operator< (const bit &inbin) const
 Less than (interpret the binary values {0,1} as integers).
bool operator<= (const bit &inbin) const
 Less than equal (interpret the binary values {0,1} as integers).
bool operator> (const bit &inbin) const
 Greater than (interpret the binary values {0,1} as integers).
bool operator>= (const bit &inbin) const
 Greater than equal (interpret the binary values {0,1} as integers).
 operator short () const
 Convert bit to short.
 operator int () const
 Convert bit to int.
 operator bool () const
 Convert bit to bool.
 operator float () const
 Convert bit to float.
 operator double () const
 Convert bit to double.
char value () const
 Output the binary value of the object.

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &output, const bit &inbin)
 Output stream of bit.
istream & operator>> (istream &input, bit &outbin)
 Input stream of bit.


Detailed Description

Binary arithmetic (boolean) class.

Author:
Tony Ottosson
This class creates a binary aritmetic class, following the ordinary rules for binary (GF(2)) fields.

Examples:

  bit a;         // Creation of variable
  bit a = 0;     // Creating a variable and assigning it value 0
  bit b = 1;     // Creating a variable and assigning it value 1
  bit c = a + b; // XOR operation
  c = !a;        // NOT
  c = a * b;     // AND
  c = a / b;     // OR


Constructor & Destructor Documentation

SPUC::bit::bit  )  [inline]
 

Default constructor.

SPUC::bit::bit const short  value  )  [inline]
 

Set the binary object equal to value. Either "0" or "1".

SPUC::bit::bit const bit inbin  )  [inline]
 


Member Function Documentation

bit SPUC::bit::operator & const bit inbin  )  const [inline]
 

AND.

Here is the call graph for this function:

void SPUC::bit::operator &= const bit inbin  )  [inline]
 

AND.

bit SPUC::bit::operator * const bit inbin  )  const [inline]
 

AND.

Here is the call graph for this function:

void SPUC::bit::operator *= const bit inbin  )  [inline]
 

AND.

SPUC::bit::operator bool  )  const [inline]
 

Convert bit to bool.

SPUC::bit::operator double  )  const [inline]
 

Convert bit to double.

SPUC::bit::operator float  )  const [inline]
 

Convert bit to float.

SPUC::bit::operator int  )  const [inline]
 

Convert bit to int.

SPUC::bit::operator short  )  const [inline]
 

Convert bit to short.

bit SPUC::bit::operator! void   )  const [inline]
 

NOT.

Here is the call graph for this function:

bool SPUC::bit::operator!= const int &  inbin  )  const [inline]
 

Check if not equal.

bool SPUC::bit::operator!= const bit inbin  )  const [inline]
 

Check if not equal.

bit SPUC::bit::operator+ const bit inbin  )  const [inline]
 

XOR.

Here is the call graph for this function:

void SPUC::bit::operator+= const bit inbin  )  [inline]
 

XOR.

bit SPUC::bit::operator-  )  const [inline]
 

Dummy definition to be able to use vec<bin>.

Here is the call graph for this function:

bit SPUC::bit::operator- const bit inbin  )  const [inline]
 

XOR.

Here is the call graph for this function:

void SPUC::bit::operator-= const bit inbin  )  [inline]
 

XOR.

bit SPUC::bit::operator/ const bit inbin  )  const [inline]
 

OR.

Here is the call graph for this function:

void SPUC::bit::operator/= const bit inbin  )  [inline]
 

OR.

bool SPUC::bit::operator< const bit inbin  )  const [inline]
 

Less than (interpret the binary values {0,1} as integers).

bool SPUC::bit::operator<= const bit inbin  )  const [inline]
 

Less than equal (interpret the binary values {0,1} as integers).

void SPUC::bit::operator= const bit inbin  )  [inline]
 

Assign a value.

void SPUC::bit::operator= const short &  value  )  [inline]
 

Assign a value.

bool SPUC::bit::operator== const int &  inbin  )  const [inline]
 

Check if equal.

bool SPUC::bit::operator== const bit inbin  )  const [inline]
 

Check if equal.

bool SPUC::bit::operator> const bit inbin  )  const [inline]
 

Greater than (interpret the binary values {0,1} as integers).

bool SPUC::bit::operator>= const bit inbin  )  const [inline]
 

Greater than equal (interpret the binary values {0,1} as integers).

bit SPUC::bit::operator^ const bit inbin  )  const [inline]
 

XOR.

Here is the call graph for this function:

void SPUC::bit::operator^= const bit inbin  )  [inline]
 

XOR.

bit SPUC::bit::operator| const bit inbin  )  const [inline]
 

OR.

Here is the call graph for this function:

void SPUC::bit::operator|= const bit inbin  )  [inline]
 

OR.

bit SPUC::bit::operator~ void   )  const [inline]
 

NOT.

Here is the call graph for this function:

char SPUC::bit::value  )  const [inline]
 

Output the binary value of the object.


Friends And Related Function Documentation

ostream & operator<< ostream &  output,
const bit inbin
[related]
 

Output stream of bit.

istream & operator>> istream &  input,
bit outbin
[related]
 

Input stream of bit.


The documentation for this class was generated from the following file:
Generated on Fri Sep 16 11:08:35 2005 for spuc by  doxygen 1.4.4