Go to the documentation of this file.
66 n(example_size(examples[
opt.
size()])),
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++)
88 if (
int v = sudokuField(examples[
opt.size()], nn,
i, j))
109 for (
int i = 0;
i<
n*
n*
n*
n;
i++) {
114 os << (char)(
x[
i].val()+
'A'-10) <<
" ";
119 os << std::endl <<
" ";
130 main(
int argc,
char* argv[]) {
136 if (
opt.size() >= n_examples) {
137 std::cerr <<
"Error: size must be between 0 and "
138 << n_examples-1 << std::endl;
141 Script::run<Sudoku,DFS,SizeOptions>(
opt);
virtual void print(std::ostream &os) const
Print solution.
Post propagator for SetVar x
unsigned int size(I &i)
Size of all ranges of range iterator i.
Slice< A > row(int r) const
Access row r.
bool assigned(View x, int v)
Whether x is assigned to value v.
void ipl(IntPropLevel i)
Set default integer propagation level.
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
IntVarArray x
Values for the fields.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
virtual Space * copy(void)
Perform copying during cloning.
Gecode toplevel namespace
Parametric base-class for scripts.
Domain propagation Options: basic versus advanced propagation.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Base class for Sudoku puzzles.
Slice< A > slice(int fc, int tc, int fr, int tr) const
Access slice of the matrix.
Matrix-interface for arrays.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Slice< A > col(int c) const
Access column c.
void update(Space &home, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
void solutions(unsigned int n)
Set default number of solutions to search for.
Sudoku(const SizeOptions &opt)
Constructor.
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
int n
Number of negative literals for node type.
int main(int argc, char *argv[])
Gecode::IntArgs i({1, 2, 3, 4})
Sudoku(Sudoku &s)
Constructor for cloning s.
Options for scripts with additional size parameter