Hamming Class Reference
[Scripts for problems]
Inherits Example.
Detailed Description
Example: Generating hamming codesGenerate a Hamming code that fits in b-bit words to code n symbols where the Hamming distance between every two symbol codes is at least d. The Hamming distance between to words is the number of bit positions where they differ.
This instance fixes b to 20 and d to 3.
Definition at line 55 of file hamming.cc.
Public Member Functions | |
Hamming (const SizeOptions &opt) | |
Actual model. | |
virtual void | print (std::ostream &os) |
Print solution. | |
Hamming (bool share, Hamming &s) | |
Constructor for copying s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
Public Attributes | |
SetVarArray | xs |
The hamming code. | |
Static Public Attributes | |
static const int | bits = 20 |
Number of bits. | |
static const int | dist = 3 |
Minimum distance between two codes. |
Constructor & Destructor Documentation
Hamming::Hamming | ( | const SizeOptions & | opt | ) | [inline] |
Hamming::Hamming | ( | bool | share, | |
Hamming & | s | |||
) | [inline] |
Member Function Documentation
virtual void Hamming::print | ( | std::ostream & | os | ) | [inline, virtual] |
virtual Space* Hamming::copy | ( | bool | share | ) | [inline, virtual] |
Member Data Documentation
const int Hamming::bits = 20 [static] |
const int Hamming::dist = 3 [static] |
The documentation for this class was generated from the following file:
- examples/hamming.cc (Revision: 5524)