MagicSquare Class Reference
[Example scripts (models)]
Example: Magic squares More...
Public Types | |
enum | { BRANCH_SIZE, BRANCH_AFC_SIZE, BRANCH_CBS_MAX_SD } |
Branching to use for model. More... | |
enum | { BRANCH_SIZE, BRANCH_AFC_SIZE } |
Branching to use for model. More... | |
Public Member Functions | |
MagicSquare (const SizeOptions &opt) | |
Post constraints. | |
MagicSquare (MagicSquare &s) | |
Constructor for cloning s. | |
virtual Space * | copy (void) |
Copy during cloning. | |
virtual void | print (std::ostream &os) const |
Print solution. | |
MagicSquare (const SizeOptions &opt) | |
Post constraints. | |
MagicSquare (MagicSquare &s) | |
Constructor for cloning s. | |
virtual Space * | copy (void) |
Copy during cloning. | |
virtual void | print (std::ostream &os) const |
Print solution. |
Detailed Description
Example: Magic squares
Compute magic squares of arbitrary size
See problem 19 at http://www.csplib.org/.
Definition at line 61 of file magic-square-partial.cpp.
Member Enumeration Documentation
anonymous enum |
Branching to use for model.
- Enumerator:
BRANCH_SIZE Branch by size.
BRANCH_AFC_SIZE Branch by size over AFC.
BRANCH_CBS_MAX_SD Use maximum solution density.
Definition at line 74 of file magic-square-partial.cpp.
anonymous enum |
Branching to use for model.
Definition at line 59 of file magic-square.cpp.
Constructor & Destructor Documentation
MagicSquare::MagicSquare | ( | const SizeOptions & | opt | ) | [inline] |
Post constraints.
Definition at line 80 of file magic-square-partial.cpp.
MagicSquare::MagicSquare | ( | MagicSquare & | s | ) | [inline] |
Constructor for cloning s.
Definition at line 137 of file magic-square-partial.cpp.
MagicSquare::MagicSquare | ( | const SizeOptions & | opt | ) | [inline] |
Post constraints.
Definition at line 64 of file magic-square.cpp.
MagicSquare::MagicSquare | ( | MagicSquare & | s | ) | [inline] |
Constructor for cloning s.
Definition at line 109 of file magic-square.cpp.
Member Function Documentation
virtual Space* MagicSquare::copy | ( | void | ) | [inline, virtual] |
Copy during cloning.
Definition at line 144 of file magic-square-partial.cpp.
virtual void MagicSquare::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 149 of file magic-square-partial.cpp.
virtual Space* MagicSquare::copy | ( | void | ) | [inline, virtual] |
Copy during cloning.
Definition at line 115 of file magic-square.cpp.
virtual void MagicSquare::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 120 of file magic-square.cpp.
The documentation for this class was generated from the following files:
- examples/magic-square-partial.cpp
- examples/magic-square.cpp