LangfordNum Class Reference
[Example scripts (models)]
Inherits Example.
Detailed Description
Example: Langford's number problemProblem 024 in the categoy "combinatorial mathematics" of http://www.csplib.org/.
For a detailed problem analysis see http://www.lclark.edu/~miller/langford.html
Definition at line 50 of file langfordnum.cc.
Public Member Functions | |
void | adiff_skn (Space *home, IntVarArray &x, IntVarArray &pi) |
Constrain x to be a permutation of ![]() | |
IntVar & | p (int i, int j) |
Returns the position of the j-th occurence of value ![]() | |
IntVar & | ys (int i, int j) |
void | distance (Space *home) |
The occurences of a value v in the Langford sequence are v numbers apart. | |
LangfordNum (const Options &op) | |
LangfordNum (bool share, LangfordNum &l) | |
virtual Space * | copy (bool share) |
Copying member function. | |
virtual void | print (void) |
Constructor & Destructor Documentation
LangfordNum::LangfordNum | ( | const Options & | op | ) | [inline] |
Definition at line 116 of file langfordnum.cc.
LangfordNum::LangfordNum | ( | bool | share, | |
LangfordNum & | l | |||
) | [inline] |
Definition at line 157 of file langfordnum.cc.
Member Function Documentation
void LangfordNum::adiff_skn | ( | Space * | home, | |
IntVarArray & | x, | |||
IntVarArray & | pi | |||
) | [inline] |
IntVar& LangfordNum::p | ( | int | i, | |
int | j | |||
) | [inline] |
IntVar& LangfordNum::ys | ( | int | i, | |
int | j | |||
) | [inline] |
Definition at line 92 of file langfordnum.cc.
void LangfordNum::distance | ( | Space * | home | ) | [inline] |
The occurences of a value v in the Langford sequence are v numbers apart.
Let denote the position of the i-th occurence of value v in the Langford Sequence. Then this function posts the constraint that
Definition at line 106 of file langfordnum.cc.
virtual Space* LangfordNum::copy | ( | bool | share | ) | [inline, virtual] |
Copying member function.
Must create a new object using the constructor for cloning.
Implements Gecode::Space.
Definition at line 166 of file langfordnum.cc.
virtual void LangfordNum::print | ( | void | ) | [inline, virtual] |
The documentation for this class was generated from the following file:
- examples/langfordnum.cc (Revision: 3188)