Go to the documentation of this file.
75 x1(*this,
n*
n,1,
n), x2(*this,
n*
n,1,
n) {
84 for (
int i=0;
i<
n;
i++)
85 for (
int j=0; j<
n; j++) {
89 for (
int i = nn;
i--; ) {
96 for (
int i =
n;
i--; ) {
98 for (
int j =
n; j--; )
101 for (
int j =
n; j--; )
105 for (
int j =
n; j--; ) {
107 for (
int i =
n;
i--; )
110 for (
int i =
n;
i--; )
115 for (
int i = 1;
i<
n;
i++) {
118 for (
int j =
n; j--; ) {
143 for (
int i = 0;
i<
n;
i++) {
145 for (
int j = 0; j<
n; j++) {
147 os << y1(
i,j) <<
" ";
152 for (
int i = 0;
i<
n;
i++) {
154 for (
int j = 0; j<
n; j++) {
156 os << y2(
i,j) <<
" ";
175 Script::run<OrthoLatinSquare,DFS,SizeOptions>(
opt);
OrthoLatinSquare(OrthoLatinSquare &s)
Constructor for cloning s.
virtual Space * copy(void)
Copy during cloning.
Passing integer variables.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
unsigned int size(I &i)
Size of all ranges of range iterator i.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
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.
const int n
Size of squares.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
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)
virtual void print(std::ostream &os) const
Print solution.
Example: Orthogonal latin squares
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
int main(int argc, char *argv[])
Main function.
IntVarArray x1
Fields of first square.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
IntVar & y2(int i, int j)
Access field at position i and j in second square.
IntVar & y1(int i, int j)
Access field at position i and j in first square.
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
OrthoLatinSquare(const SizeOptions &opt)
Actual model.
int n
Number of negative literals for node type.
IntVarArray x2
Fields of second square.
const IntVar & y1(int i, int j) const
Access field at position i and j in first square.
Passing integer arguments.
Gecode::IntArgs i({1, 2, 3, 4})
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
const IntVar & y2(int i, int j) const
Access field at position i and j in second square.
Options for scripts with additional size parameter