84 const int n = m.
size();
85 const int n_d = (
n*
n-
n)/2;
91 for (
int k=0,
i=0;
i<
n-1;
i++)
92 for (
int j=
i+1; j<
n; j++, k++)
108 return m[m.
size()-1];
114 os <<
"\tm[" << m.
size() <<
"] = " << m << std::endl;
140 IntMinimizeScript::run<GolombRuler,BAB,SizeOptions>(
opt);
Options for scripts with additional size parameter
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
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.
int size(void) const
Return size of array (number of elements)
virtual IntVar cost(void) const
Return cost.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
GolombRuler(const SizeOptions &opt)
Actual model.
void ipl(IntPropLevel i)
Set default integer propagation level.
Example: Finding optimal Golomb rulers
Parametric base-class for scripts.
void update(Space &, bool share, VarArray< Var > &a)
Update array to be a clone of array a.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
unsigned int size(I &i)
Size of all ranges of range iterator i.
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
Passing integer variables.
IntVarArray m
Array for ruler marks.
BoolVar expr(Home home, const BoolExpr &e, IntPropLevel ipl)
Post Boolean expression and return its value.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
GolombRuler(bool share, GolombRuler &s)
Constructor for cloning s.
virtual Space * copy(bool share)
Copy during cloning.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
void solutions(unsigned int n)
Set default number of solutions to search for.
Gecode toplevel namespace
virtual void print(std::ostream &os) const
Print solution.
int main(int argc, char *argv[])
Main-function.