Example: Solving Sudoku puzzles using integer constraints More...
Public Types | |
enum | { PROP_NONE , PROP_SAME } |
Propagation variants. More... | |
![]() | |
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 SizeOptions &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. | |
![]() | |
Sudoku (const SizeOptions &opt) | |
Constructor. | |
Sudoku (Sudoku &s) | |
Constructor for cloning s. | |
Sudoku (const SizeOptions &opt) | |
Constructor. | |
Sudoku (Sudoku &s) | |
Constructor for cloning s. | |
![]() | |
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. | |
Protected Attributes | |
IntVarArray | x |
Values for the fields. | |
![]() | |
const int | n |
The size of the problem. | |
IntVarArray | x |
Values for the fields. | |
Additional Inherited Members | |
![]() | |
static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs) |
Choose output stream according to sn. | |
template<class Script , template< class > class Engine, class Options > | |
static void | run (const Options &opt, Script *s=NULL) |
![]() | |
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. | |
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. | |
Example: Solving Sudoku puzzles using integer constraints
Definition at line 92 of file sudoku-advanced.cpp.
anonymous enum |
Propagation variants.
Enumerator | |
---|---|
PROP_NONE | No additional constraints. |
PROP_SAME | Use "same" constraint with integer model. |
Definition at line 99 of file sudoku-advanced.cpp.
|
inline |
Constructor.
Definition at line 105 of file sudoku-advanced.cpp.
|
inline |
Constructor for cloning s.
Definition at line 182 of file sudoku-advanced.cpp.
|
inlinevirtual |
Perform copying during cloning.
Reimplemented from Sudoku.
Reimplemented in SudokuMixed.
Definition at line 188 of file sudoku-advanced.cpp.
|
inlinevirtual |
Print solution.
Reimplemented from Sudoku.
Reimplemented in SudokuMixed.
Definition at line 194 of file sudoku-advanced.cpp.
|
protected |
Values for the fields.
Definition at line 95 of file sudoku-advanced.cpp.