Generated on Mon Aug 25 11:35:48 2008 for Gecode by doxygen 1.5.6

Hamming Class Reference
[Scripts for problems]

Inherits Example.

List of all members.


Detailed Description

Example: Generating hamming codes

Generate 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 Spacecopy (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]

Actual model.

Definition at line 66 of file hamming.cc.

Hamming::Hamming ( bool  share,
Hamming s 
) [inline]

Constructor for copying s.

Definition at line 104 of file hamming.cc.


Member Function Documentation

virtual void Hamming::print ( std::ostream &  os  )  [inline, virtual]

Print solution.

Reimplemented from Example.

Definition at line 97 of file hamming.cc.

virtual Space* Hamming::copy ( bool  share  )  [inline, virtual]

Copy during cloning.

Implements Gecode::Space.

Definition at line 109 of file hamming.cc.


Member Data Documentation

The hamming code.

Definition at line 58 of file hamming.cc.

const int Hamming::bits = 20 [static]

Number of bits.

Definition at line 61 of file hamming.cc.

const int Hamming::dist = 3 [static]

Minimum distance between two codes.

Definition at line 63 of file hamming.cc.


The documentation for this class was generated from the following file: