Go to the documentation of this file.
57 const int n =
opt.size();
66 for (
int i =
n;
i--; ) {
72 for (
int i =
n;
i--; ) {
73 c[
i] = 1;
c[
n+
i] = -1;
80 for (
int i =
n;
i--; ) {
111 for (
int i = 0;
i <
x.size();
i++) {
113 b +=
x[
i].val()*
x[
i].val();
116 os <<
" = " <<
a <<
", " <<
b << std::endl <<
"\t";
118 for (
int i = 0;
i <
y.size();
i++) {
120 b +=
y[
i].val()*
y[
i].val();
123 os <<
" = " <<
a <<
", " <<
b << std::endl;
137 Script::run<Partition,DFS,SizeOptions>(
opt);
Post propagator for SetVar x
Post propagator for SetVar SetOpType SetVar y
IntVarArray y
Second group of numbers.
Passing integer variables.
unsigned int size(I &i)
Size of all ranges of range iterator i.
IntVarArray x
First group of numbers.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Example: partition numbers into two groups
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.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Gecode toplevel namespace
BoolVar expr(Home home, const BoolExpr &e, const IntPropLevels &ipls)
Post Boolean expression and return its value.
Parametric base-class for scripts.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
@ IPL_BND
Bounds propagation.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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 .
virtual Space * copy(void)
Copying during cloning.
void update(Space &home, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
virtual void print(std::ostream &os) const
Print solution.
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
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.
Partition(Partition &s)
Constructor used during cloning s.
Gecode::FloatVal c(-8, 8)
int n
Number of negative literals for node type.
int main(int argc, char *argv[])
Main-functiona.
Passing integer arguments.
Gecode::IntArgs i({1, 2, 3, 4})
Options for scripts with additional size parameter
Partition(const SizeOptions &opt)
Actual model.