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) {}
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
Gecode::FloatNum step
Step for going to next solution.
virtual ~RandomAssignment(void)
Destructor.
FloatNum add_down(FloatNum x, FloatNum y)
Return lower bound of x plus y (domain: )
AssignmentType
Assignment possible types.
FloatNum mul_down(FloatNum x, FloatNum y)
Return lower bound of x times y (domain: )
Inverse implication for reification.
void reset(void)
Reset iterator.
int size(void) const
Return size of array (number of elements)
Gecode::FloatRelType frt(void) const
Return current relation type.
const FloatNum max
Largest allowed float value.
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.
bool operator()(void) const
Test whether iterator is done.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb)
Initialize assignments for n variables and values d with step s.
bool testfix
Whether to perform fixpoint test.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
bool imp(void) const
Test whether implication as reification mode is supported.
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.
int n
Number of variables.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
const int max
Largest allowed integer value.
FloatRelTypes(void)
Initialize iterator.
int a
How many assigments still to be generated Generate new value according to domain. ...
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.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
Base class for all tests to be run
MaybeType operator&(MaybeType a, MaybeType b)
Three-valued conjunction of MaybeType.
bool testsearch
Whether to perform search test.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
Floating point rounding policy.
virtual ~ExtAssignment(void)
Destructor.
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
struct Gecode::@519::NNF::@60::@61 b
For binary nodes (and, or, eqv)
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.
Gecode::FloatVal dom
Domain of variables.
AssignmentType assigmentType
Gives the type of assignment to use.
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.
Gecode::FloatVal * vals
The current values for the variables.
virtual bool operator()(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.
int size(void) const
Return number of variables.
Gecode toplevel namespace
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
Implication for reification.
int arity
Number of variables.
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)
virtual bool operator()(void) const
Test whether all assignments have been iterated.
double FloatNum
Floating point number base type.
#define GECODE_NEVER
Assert that this command is never executed.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
virtual ~CpltAssignment(void)
Destructor.
int rms
Which reification modes are supported.
Assignment(int n0, const Gecode::FloatVal &d0)
Initialize assignments for n0 variables and values d0.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
bool flip(void)
Flip a coin and return true or false randomly.
Base class for assignments
Equivalence for reification (default)