Binc::CodingVector Class Reference
[Binary Vectors]

#include <coding-vector.h>

Inheritance diagram for Binc::CodingVector:
Inheritance graph
[legend]
Collaboration diagram for Binc::CodingVector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CodingVector (unsigned int position)
 CodingVector (const std::vector< unsigned int > &v)
bool operator== (const CodingVector &rhs) const
bool operator!= (const CodingVector &rhs) const
CodingVectoroperator+= (const CodingVector &rhs)
unsigned int Size () const
void Print (std::ostream &os) const
bool At (unsigned int position) const

Friends

CodingVector operator+ (const CodingVector &lhs, const CodingVector &rhs)

Detailed Description

This class implements the coding vector of coded packets which are internally represented using vectors of unsigned int variables, each of which holds 8*sizeof(unsigned int) coefficients. The internal representation of the coding vector is designed to be memory-efficient for coding vectors whose non-zero entries are closely packed.


Constructor & Destructor Documentation

Binc::CodingVector::CodingVector ( unsigned int  position  ) 

Create a coding vector with a single bit set to one and all other bits set to zero

Parameters:
position the position (bit number) of the bit set to one
Returns:
the created coding vector
Binc::CodingVector::CodingVector ( const std::vector< unsigned int > &  v  ) 

Create a coding vector corresponding to the given vector of bitmasks

Parameters:
v the vector of bitmasks

Member Function Documentation

bool Binc::CodingVector::At ( unsigned int  position  )  const
Parameters:
n the index of the coefficient (bit)
Returns:
the value of the coefficient (bit) with the given index
bool Binc::CodingVector::operator!= ( const CodingVector rhs  )  const
Parameters:
rhs the Right Hand Side
Returns:
true if the bit vectors are different in size or content, false otherwise
CodingVector & Binc::CodingVector::operator+= ( const CodingVector rhs  ) 

Add the Right Hand Side of the operator to *this, bit by bit. Since we work over the GF2 (binary) field, this is equivalent to the bit by bit XOR operation.

Parameters:
rhs the Right Hand Side
Returns:
a reference to *this
bool Binc::CodingVector::operator== ( const CodingVector rhs  )  const
Parameters:
rhs the Right Hand Side
Returns:
true if the bit vectors are equal in size and content, false otherwise
void Binc::CodingVector::Print ( std::ostream &  os  )  const

Print the CodingVector

Parameters:
os the stream to be used for printing
unsigned int Binc::CodingVector::Size (  )  const
Returns:
the size in bits (not bytes!)

Friends And Related Function Documentation

CodingVector operator+ ( const CodingVector lhs,
const CodingVector rhs 
) [friend]

bitwise addition operator. Since we work over the GF2 (binary) field, this is equivalent to the bit by bit XOR operation.

Parameters:
lhs Left Hand Side of the operator
rhs Right Hand Side of the operator
Returns:
the value of lhs + rhs

The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends
Generated on Sat Apr 30 23:15:46 2011 for libBiNC by  doxygen 1.6.3