MagicSequence Class Reference
[Example scripts (models)]
Example: Magic sequence More...
Public Types | |
enum | { PROP_COUNT, PROP_GCC } |
Propagation to use for model. More... | |
Public Member Functions | |
MagicSequence (const SizeOptions &opt) | |
The actual model. | |
MagicSequence (bool share, MagicSequence &e) | |
Constructor for cloning e. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
virtual void | print (std::ostream &os) const |
Print sequence. |
Detailed Description
Example: Magic sequence
Find a magic sequence of length . A magic sequence of length is a sequence
of integers such that for every :
- is an integer between and .
- the number occurs exactly times in the sequence.
See problem 19 at http://www.csplib.org/.
Note that "Modeling and Programming with Gecode" uses this example as a case study.
Definition at line 63 of file magic-sequence.cpp.
Member Enumeration Documentation
anonymous enum |
Propagation to use for model.
Definition at line 71 of file magic-sequence.cpp.
Constructor & Destructor Documentation
MagicSequence::MagicSequence | ( | const SizeOptions & | opt | ) | [inline] |
The actual model.
Definition at line 76 of file magic-sequence.cpp.
MagicSequence::MagicSequence | ( | bool | share, | |
MagicSequence & | e | |||
) | [inline] |
Constructor for cloning e.
Definition at line 93 of file magic-sequence.cpp.
Member Function Documentation
virtual Space* MagicSequence::copy | ( | bool | share | ) | [inline, virtual] |
Copy during cloning.
Definition at line 98 of file magic-sequence.cpp.
virtual void MagicSequence::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print sequence.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 103 of file magic-sequence.cpp.
The documentation for this class was generated from the following file:
- examples/magic-sequence.cpp (Revision: 11473)