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) {}
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.
AssignmentType
Assignment possible types.
Inverse implication for reification.
void reset(void)
Reset iterator.
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.
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.
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.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
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.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Base class for all tests to be run
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
Floating point rounding policy.
virtual ~ExtAssignment(void)
Destructor.
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Post propagator for SetVar SetOpType SetVar y
void operator++(void)
Increment to next relation type.
MaybeType operator &(MaybeType a, MaybeType b)
Three-valued conjunction of MaybeType.
Node * x
Pointer to corresponding Boolean expression node.
Gecode::FloatVal d
Domain for each variable.
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.
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)