42 namespace Test {
namespace Float {
61 dsv(new
Gecode::FloatVal[static_cast<unsigned int>(n)]),
73 assert((i>=0) && (i<
n));
78 assert((i>=0) && (i<
n));
92 for (
int i=n-1;
i--; )
102 assert((i>=0) && (i<
n));
107 assert((i>=0) && (i<
n));
146 assert((i>=0) && (i<
n));
151 assert((i>=0) && (i<
n));
179 :
Base(
"Float::"+s), arity(a),
dom(d),
step(st), assigmentType(at),
183 testsearch(true), testfix(true), testsubsumed(true) {}
189 :
Base(
"Float::"+s), arity(a),
dom(min,max),
step(st),
190 assigmentType(at), reified(r),
194 testsearch(true), testfix(true), testsubsumed(true) {}
225 s <<
"[" << f.
min() <<
":" << f.
max() <<
"]";
233 for (
int i=0;
i<x.
size()-1;
i++)
234 s +=
str(x[
i]) +
",";
235 return "[" + s +
str(x[x.
size()-1]) +
"]";
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
const Gecode::FloatNum step
virtual ~RandomAssignment(void)
Destructor.
FloatNum add_down(FloatNum x, FloatNum y)
Return lower bound of x plus y (domain: )
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
AssignmentType
Assignment possible types.
FloatNum mul_down(FloatNum x, FloatNum y)
Return lower bound of x times y (domain: )
bool operator()(void) const
Test whether iterator is done.
Inverse implication for reification.
void reset(void)
Reset iterator.
const FloatNum max
Largest allowed float value.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
int size(void) const
Return size of array (number of elements)
static Gecode::Support::RandomGenerator rand
Random number generator.
Test(const std::string &s, int a, const Gecode::FloatVal &d, Gecode::FloatNum st, AssignmentType at, bool r)
Constructor.
Gecode::FloatNum step
Step for next assignment.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb)
Initialize assignments for n variables and values d with step s.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
int n
Number of variables.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
const int max
Largest allowed integer value.
Gecode::FloatRelType frt(void) const
Return current relation type.
FloatRelTypes(void)
Initialize iterator.
int a
How many assigments still to be generated Generate new value according to domain. ...
bool imp(void) const
Test whether implication as reification mode is supported.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual ~Assignment(void)
Destructor.
CpltAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s)
Initialize assignments for n variables and values d with step s.
Gecode::FloatNum randval(void)
int n
Number of negative literals for node type.
FloatRelType
Relation types for floats.
RandomAssignment(int n, const Gecode::FloatVal &d, int a)
Initialize for a assignments for n variables and values d.
Base class for all tests to be run
Floating point rounding policy.
virtual ~ExtAssignment(void)
Destructor.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
void operator++(void)
Increment to next relation type.
Node * x
Pointer to corresponding Boolean expression node.
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: )
Gecode::FloatVal d
Domain for each variable.
FloatNum div_down(FloatNum x, FloatNum y)
Return lower bound of x divided by y (domain: )
MaybeType
Type for comparisons and solutions.
Gecode::FloatVal * dsv
Iterator for each variable.
MaybeType operator&(MaybeType a, MaybeType b)
Three-valued conjunction of MaybeType.
int size(void) const
Return number of variables.
Gecode::FloatVal * vals
The current values for the variables.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
Implication for reification.
Gecode::FloatVal * dsv
Iterator for each variable.
bool reified
Does the constraint also exist as reified constraint.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
double FloatNum
Floating point number base type.
#define GECODE_NEVER
Assert that this command is never executed.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
virtual ~CpltAssignment(void)
Destructor.
int rms
Which reification modes are supported.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
Assignment(int n0, const Gecode::FloatVal &d0)
Initialize assignments for n0 variables and values d0.
bool flip(void)
Flip a coin and return true or false randomly.
Base class for assignments
Equivalence for reification (default)