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++) {
110 if (
x[i].assigned()) {
114 os << (char)(
x[i].val()+
'A'-10) <<
" ";
119 os << std::endl <<
" ";
130main(
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;
static void run(const Options &opt, Script *s=NULL)
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
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.
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Branch over x with variable selection vars and value selection vals.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
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.
int main(int argc, char *argv[])