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));
89 for (
int i=
n-1; i--; )
95 return dsv[0].min() <=
d.max();
99 assert((i>=0) && (i<
n));
104 assert((i>=0) && (i<
n));
143 assert((i>=0) && (i<
n));
148 assert((i>=0) && (i<
n));
222 s <<
"[" << f.
min() <<
":" << f.
max() <<
"]";
230 for (
int i=0; i<x.
size()-1; i++)
231 s +=
str(x[i]) +
",";
232 return "[" + s +
str(x[x.
size()-1]) +
"]";
275 return _rand(2U) == 0U;
int size(void) const
Return size of array (number of elements).
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
Floating point rounding policy.
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: ).
FloatNum div_down(FloatNum x, FloatNum y)
Return lower bound of x divided by y (domain: ).
FloatNum mul_down(FloatNum x, FloatNum y)
Return lower bound of x times y (domain: ).
FloatNum add_down(FloatNum x, FloatNum y)
Return lower bound of x plus y (domain: ).
Gecode::Support::RandomGenerator _rand
Random number generator.
Base(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 bool has_more(void) const
Test whether all assignments have been iterated.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
CpltAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s)
Initialize assignments for n variables and values d with step s.
virtual bool has_more(void) const
Test whether all assignments have been iterated.
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.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb, Gecode::Support::RandomGenerator &rand)
Initialize assignments for n variables and values d with step s.
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.
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.
RandomAssignment(int n, const Gecode::FloatVal &d, int a0, Gecode::Support::RandomGenerator &rand)
Initialize for a assignments for n variables and values d.
Gecode::FloatNum randval(Gecode::Support::RandomGenerator &rand)
Gecode::FloatVal * vals
The current values for the variables.
int a
How many assignments still to be generated Generate new value according to domain.
virtual bool has_more(void) const
Test whether all assignments have been iterated.
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.
AssignmentType assignmentType
Gives the type of assignment to use.
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.
Gecode::FloatVal dom
Domain of variables.
bool imp(void) const
Test whether implication as reification mode is supported.
LinearCongruentialGenerator< 2147483647, 48271, 44488, 3399 > RandomGenerator
Default values for linear congruential generator.
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 .
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
AssignmentType
Assignment possible types.
MaybeType
Type for comparisons and solutions.
#define GECODE_NEVER
Assert that this command is never executed.