Example: Solving Sudoku puzzles using integer constraints More...
Public Types | |
| enum | { PROP_NONE , PROP_SAME } |
| Propagation variants. More... | |
| Public Types inherited from Sudoku | |
| enum | { MODEL_INT , MODEL_SET , MODEL_MIXED } |
| Model variants. More... | |
| enum | { BRANCH_NONE , BRANCH_SIZE , BRANCH_SIZE_DEGREE , BRANCH_SIZE_AFC , BRANCH_AFC } |
Public Member Functions | |
| SudokuInt (const InstanceOptions &opt) | |
| Constructor. | |
| SudokuInt (SudokuInt &s) | |
| Constructor for cloning s. | |
| virtual Space * | copy (void) |
| Perform copying during cloning. | |
| virtual void | print (std::ostream &os) const |
| Print solution. | |
| Public Member Functions inherited from Sudoku | |
| Sudoku (const InstanceOptions &opt) | |
| Constructor. | |
| Sudoku (Sudoku &s) | |
| Constructor for cloning s. | |
| Sudoku (const InstanceOptions &opt) | |
| Constructor. | |
| Sudoku (Sudoku &s) | |
| Constructor for cloning s. | |
| Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > > | |
| ScriptBase (const Options &opt) | |
| Constructor. | |
| ScriptBase (ScriptBase &e) | |
| Constructor used for cloning. | |
| virtual void | compare (const Space &home, std::ostream &os) const |
| Compare with s. | |
| Public Member Functions inherited from Gecode::Driver::IgnoreStepOption< BaseSpace > | |
| IgnoreStepOption (const Options &) | |
| Constructor. | |
| IgnoreStepOption (BaseSpace &e) | |
| Constructor used for cloning. | |
Protected Attributes | |
| IntVarArray | x |
| Values for the fields. | |
| Protected Attributes inherited from Sudoku | |
| int | nn |
| The side of the grid. | |
| int | bw |
| The width of a box. | |
| int | bh |
| The height of a box. | |
| IntSharedArray | givens |
| Given values in row-major order (0 for blank). | |
| IntVarArray | x |
| Values for the fields. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > > | |
| static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs) |
| Choose output stream according to sn. | |
| static void | run (const Options &opt, Script *s=nullptr) |
| Related Symbols inherited from Sudoku | |
| int | main (int argc, char *argv[]) |
| Main-function. | |
| const char * | examples [] |
| The specifications. | |
| const unsigned int | n_examples = sizeof(examples)/sizeof(char*) |
| The number of instances. | |
| const char * | instance_spec |
| Reader spec for sudoku files. | |
| int | example_size (const char *s) |
| The size of an instance. | |
| int | sudokuField (const char *s, int n, int i, int j) |
| Return value at position (i,j) in the example s of size n. | |
| void | print_value (std::ostream &os, int v) |
| Print value v of a field, with the symbols of the scaled sudoku corpus. | |
Detailed Description
Example: Solving Sudoku puzzles using integer constraints
Definition at line 112 of file sudoku-advanced.cpp.
Member Enumeration Documentation
◆ anonymous enum
| anonymous enum |
Propagation variants.
| Enumerator | |
|---|---|
| PROP_NONE | No additional constraints. |
| PROP_SAME | Use "same" constraint with integer model. |
Definition at line 119 of file sudoku-advanced.cpp.
Constructor & Destructor Documentation
◆ SudokuInt() [1/2]
|
inline |
Constructor.
Definition at line 125 of file sudoku-advanced.cpp.
◆ SudokuInt() [2/2]
|
inline |
Constructor for cloning s.
Definition at line 176 of file sudoku-advanced.cpp.
Member Function Documentation
◆ copy()
|
inlinevirtual |
Perform copying during cloning.
Reimplemented from Sudoku.
Reimplemented in SudokuMixed.
Definition at line 182 of file sudoku-advanced.cpp.
◆ print()
|
inlinevirtual |
Print solution.
Reimplemented from Sudoku.
Reimplemented in SudokuMixed.
Definition at line 188 of file sudoku-advanced.cpp.
Member Data Documentation
◆ x
|
protected |
Values for the fields.
Definition at line 115 of file sudoku-advanced.cpp.
The documentation for this class was generated from the following file:
- examples/sudoku-advanced.cpp
