73 for (
int i=0;
i<nn;
i++) {
79 for (
int i=0;
i<nn;
i+=
n) {
80 for (
int j=0; j<nn; j+=
n) {
86 for (
int i=0;
i<nn;
i++)
87 for (
int j=0; j<nn; j++)
109 for (
int i = 0;
i<
n*
n*
n*
n;
i++) {
114 os << (char)(
x[
i].val()+
'A'-10) <<
" ";
119 os << std::endl <<
" ";
130main(
int argc,
char* argv[]) {
137 std::cerr <<
"Error: size must be between 0 and "
141 Script::run<Sudoku,DFS,SizeOptions>(
opt);
int main(int argc, char *argv[])
Main-function.
const unsigned int n_examples
The number of examples.
Parametric base-class for scripts.
Matrix-interface for arrays.
Slice< A > slice(int fc, int tc, int fr, int tr) const
Access slice of the matrix.
Slice< A > col(int c) const
Access column c.
Slice< A > row(int r) const
Access row r.
Options for scripts with additional size parameter
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
Base class for Sudoku puzzles.
int example_size(const char *s)
The size of an instance.
Sudoku(const SizeOptions &opt)
Constructor.
virtual Space * copy(void)
Perform copying during cloning.
const char * examples[]
The specifications.
IntVarArray x
Values for the fields.
int sudokuField(const char *s, int n, int i, int j)
Return value at position (i,j) in the example s of size n.
const int n
The size of the problem.
virtual void print(std::ostream &os) const
Print solution.
Sudoku(Sudoku &s)
Constructor for cloning s.
void parse(int argc, char *argv[])
Parse commandline arguments.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
void branch(Home home, const IntVarArgs &x, const BoolVarArgs &y, IntBoolVarBranch vars, IntValBranch vals)
Branch function for integer and Boolean variables.
bool assigned(View x, int v)
Whether x is assigned to value v.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Gecode toplevel namespace
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl=IPL_DEF)
Post propagator for for all .
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Gecode::IntArgs i({1, 2, 3, 4})