57 dsv(new
Gecode::FloatVal[static_cast<unsigned int>(
n)]),
65 return dsv[0].min() <=
d.max();
69 assert((i>=0) && (i<
n));
74 assert((i>=0) && (i<
n));
88 for (
int i=
n-1; i--; )
94 return dsv[0].min() <=
d.max();
98 assert((i>=0) && (i<
n));
103 assert((i>=0) && (i<
n));
124 r.sub_down(
d.max(),
d.min())
142 assert((i>=0) && (i<
n));
147 assert((i>=0) && (i<
n));
221 s <<
"[" << f.min() <<
":" << f.max() <<
"]";
229 for (
int i=0; i<
x.size()-1; i++)
230 s +=
str(
x[i]) +
",";
231 return "[" + s +
str(
x[
x.size()-1]) +
"]";
Floating point rounding policy.
static Gecode::Support::RandomGenerator rand
Random number generator.
Base(const std::string &s)
Create and register test with name s.
int n
Number of variables.
Assignment(int n0, const Gecode::FloatVal &d0)
Initialize assignments for n0 variables and values d0.
Gecode::FloatVal d
Domain for each variable.
int size(void) const
Return number of variables.
virtual ~Assignment(void)
Destructor.
virtual ~CpltAssignment(void)
Destructor.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
Gecode::FloatNum step
Step for next assignment.
Gecode::FloatVal * dsv
Iterator for each variable.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
CpltAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s)
Initialize assignments for n variables and values d with step s.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb)
Initialize assignments for n variables and values d with step s.
virtual ~ExtAssignment(void)
Destructor.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
Gecode::FloatVal * dsv
Iterator for each variable.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
Gecode::FloatNum step
Step for next assignment.
const Test * curPb
Current problem used to complete assignment.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
void operator++(void)
Increment to next relation type.
Gecode::FloatRelType frt(void) const
Return current relation type.
FloatRelTypes(void)
Initialize iterator.
bool operator()(void) const
Test whether iterator is done.
void reset(void)
Reset iterator.
RandomAssignment(int n, const Gecode::FloatVal &d, int a)
Initialize for a assignments for n variables and values d.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
Gecode::FloatNum randval(void)
Gecode::FloatVal * vals
The current values for the variables.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
int a
How many assigments still to be generated Generate new value according to domain.
virtual ~RandomAssignment(void)
Destructor.
int rms
Which reification modes are supported.
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
bool testsubsumed
Whether to test for subsumption.
bool testfix
Whether to perform fixpoint test.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
int arity
Number of variables.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
bool flip(void)
Flip a coin and return true or false randomly.
Gecode::FloatNum step
Step for going to next solution.
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
Test(const std::string &s, int a, const Gecode::FloatVal &d, Gecode::FloatNum st, AssignmentType at, bool r)
Constructor.
bool reified
Does the constraint also exist as reified constraint.
bool testsearch
Whether to perform search test.
AssignmentType assigmentType
Gives the type of assignment to use.
Gecode::FloatVal dom
Domain of variables.
bool imp(void) const
Test whether implication as reification mode is supported.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
double FloatNum
Floating point number base type.
FloatRelType
Relation types for floats.
@ FRT_LQ
Less or equal ( )
@ FRT_GQ
Greater or equal ( )
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
@ RM_EQV
Equivalence for reification (default)
const int max
Largest allowed integer value.
Gecode toplevel namespace
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar SetOpType SetVar y
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar x
AssignmentType
Assignment possible types.
MaybeType
Type for comparisons and solutions.
#define GECODE_NEVER
Assert that this command is never executed.