Go to the documentation of this file.
52 b = (
v*(
v-1)*lambda)/(k*(k-1));
53 r = (lambda*(
v-1)) / (k-1);
57 int v0,
int k0,
int lambda0)
58 :
Options(s),
v(v0), k(k0), lambda(lambda0) {
62 void parse(
int& argc,
char* argv[]) {
68 lambda = atoi(argv[3]);
74 std::cerr <<
"\t(unsigned int) default: " <<
v << std::endl
75 <<
"\t\tparameter v" << std::endl
76 <<
"\t(unsigned int) default: " << k << std::endl
77 <<
"\t\tparameter k" << std::endl
78 <<
"\t(unsigned int) default: " << lambda << std::endl
79 <<
"\t\tparameter lambda" << std::endl;
112 for (
int i=0;
i<
opt.v;
i++)
116 for (
int j=0; j<
opt.b; j++)
120 for (
int i1=0; i1<
opt.v; i1++)
121 for (
int i2=i1+1; i2<
opt.v; i2++) {
123 for (
int j=0; j<
opt.b; j++)
124 row[j] =
expr(*
this,
p(j,i1) &&
p(j,i2));
128 if (
opt.symmetry() == SYMMETRY_LDSB) {
134 if (
opt.symmetry() == SYMMETRY_LEX) {
135 for (
int i=1;
i<
opt.v;
i++)
137 for (
int j=1; j<
opt.b; j++)
149 <<
opt.v <<
"," <<
opt.k <<
","
150 <<
opt.lambda <<
")" << std::endl;
152 for (
int i = 0;
i<
opt.v;
i++) {
154 for (
int j = 0; j<
opt.b; j++)
170 return new BIBD(*
this);
194 Script::run<BIBD,DFS,BIBDOptions>(
opt);
BIBD(BIBD &s)
Constructor for cloning s.
SymmetryHandle rows_interchange(const Matrix< A > &m)
Interchangeable rows symmetry specification.
Example: Balanced incomplete block design (BIBD)
SymmetryHandle columns_interchange(const Matrix< A > &m)
Interchangeable columns symmetry specification.
int main(int argc, char *argv[])
Main-function.
@ IRT_GQ
Greater or equal ( )
virtual Space * copy(void)
Copy during cloning.
@ SYMMETRY_LEX
Lex-constraints on rows/columns.
const BIBDOptions & opt
Options providing access to parameters.
BoolVarArray _p
Matrix of Boolean variables.
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.
virtual void help(void)
Print help message.
Collection of symmetries.
Gecode toplevel namespace
BoolVar expr(Home home, const BoolExpr &e, const IntPropLevels &ipls)
Post Boolean expression and return its value.
Passing Boolean variables.
Parametric base-class for scripts.
Options for BIBD problems
Post propagator for SetVar SetOpType SetVar SetRelType r
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
@ SYMMETRY_NONE
No symmetry breaking.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
virtual void print(std::ostream &os) const
Print solution.
@ SYMMETRY_LDSB
LDSB on rows/columns.
Matrix-interface for arrays.
virtual void help(void)
Print help text.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
void symmetry(int v)
Set default symmetry value.
int r
Derived parameters Derive additional parameters.
BIBDOptions(const char *s, int v0, int k0, int lambda0)
Initialize options for example with name s.
BIBD(const BIBDOptions &o)
Actual model.
Gecode::IntArgs i({1, 2, 3, 4})
int p
Number of positive literals for node type.
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.