61 const int n =
opt.size();
70 for (
int i =
n;
i--; ) {
76 for (
int i =
n;
i--; ) {
77 c[
i] = 1;
c[
n+
i] = -1;
84 for (
int i =
n;
i--; ) {
115 for (
int i = 0;
i <
x.size();
i++) {
117 b +=
x[
i].val()*
x[
i].val();
120 os <<
" = " <<
a <<
", " <<
b << std::endl <<
"\t";
122 for (
int i = 0;
i <
y.size();
i++) {
124 b +=
y[
i].val()*
y[
i].val();
127 os <<
" = " <<
a <<
", " <<
b << std::endl;
141 Script::run<Partition,DFS,SizeOptions>(
opt);
IntVarArray x
First group of numbers.
Options for scripts with additional size parameter
Example: partition numbers into two groups
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 print(std::ostream &os) const
Print solution.
void update(Space &home, bool share, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
Partition(bool share, Partition &s)
Constructor used during cloning s.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
void ipl(IntPropLevel i)
Set default integer propagation level.
Partition(const SizeOptions &opt)
Actual model.
Parametric base-class for scripts.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
IntValBranch INT_VAL_MIN(void)
Select smallest value.
unsigned int size(I &i)
Size of all ranges of range iterator i.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
Passing integer variables.
Passing integer arguments.
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)
IntVarArray y
Second group of numbers.
Post propagator for SetVar SetOpType SetVar y
int main(int argc, char *argv[])
Main-functiona.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Post propagator for SetVar x
Gecode toplevel namespace
virtual Space * copy(bool share)
Copying during cloning.