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

SPUC::bin Class Reference
[Basic Classes]

Binary arithmetic (boolean) class. More...

#include <binary.h>

List of all members.

Public Member Functions

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


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:

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


Constructor & Destructor Documentation

SPUC::bin::bin  )  [inline]
 

Default constructor.

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

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

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


Member Function Documentation

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

AND.

Here is the call graph for this function:

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

AND.

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

AND.

Here is the call graph for this function:

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

AND.

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

Convert bin to bool.

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

Convert bin to double.

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

Convert bin to float.

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

Convert bin to int.

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

Convert bin to short.

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

NOT.

Here is the call graph for this function:

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

Check if not equal.

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

Check if not equal.

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

XOR.

Here is the call graph for this function:

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

XOR.

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

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

Here is the call graph for this function:

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

XOR.

Here is the call graph for this function:

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

XOR.

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

OR.

Here is the call graph for this function:

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

OR.

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

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

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

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

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

Assign a value.

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

Assign a value.

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

Check if equal.

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

Check if equal.

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

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

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

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

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

XOR.

Here is the call graph for this function:

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

XOR.

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

OR.

Here is the call graph for this function:

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

OR.

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

NOT.

Here is the call graph for this function:

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

Output the binary value of the object.


Friends And Related Function Documentation

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

Output stream of bin.

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

Input stream of bin.


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