Go to the documentation of this file.
38 namespace Test {
namespace Float {
57 dsv(new
Gecode::FloatVal[static_cast<unsigned int>(
n)]),
69 assert((
i>=0) && (
i<
n));
74 assert((
i>=0) && (
i<
n));
88 for (
int i=
n-1;
i--; )
98 assert((
i>=0) && (
i<
n));
103 assert((
i>=0) && (
i<
n));
142 assert((
i>=0) && (
i<
n));
147 assert((
i>=0) && (
i<
n));
175 :
Base(
"Float::"+s), arity(
a),
dom(
d),
step(st), assigmentType(at),
179 testsearch(true), testfix(true), testsubsumed(true) {}
186 assigmentType(at), reified(
r),
190 testsearch(true), testfix(true), testsubsumed(true) {}
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]) +
"]";
Post propagator for SetVar SetOpType SetVar y
const Gecode::FloatNum step
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.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
Test(const std::string &s, int a, const Gecode::FloatVal &d, Gecode::FloatNum st, AssignmentType at, bool r)
Constructor.
@ RM_PMI
Inverse implication for reification.
bool operator()(void) const
Test whether iterator is done.
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
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.
friend FloatVal min(const FloatVal &x, const FloatVal &y)
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
FloatRelTypes(void)
Initialize iterator.
Gecode::FloatVal * dsv
Iterator for each variable.
bool reified
Does the constraint also exist as reified constraint.
@ RM_IMP
Implication for reification.
RandomAssignment(int n, const Gecode::FloatVal &d, int a)
Initialize for a assignments for n variables and values d.
AssignmentType
Assignment possible types.
const FloatNum min
Smallest allowed float value.
virtual void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
FloatRelType
Relation types for floats.
Gecode::FloatVal * dsv
Iterator for each variable.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb)
Initialize assignments for n variables and values d with step s.
static Gecode::Support::RandomGenerator rand
Random number generator.
Assignment(int n0, const Gecode::FloatVal &d0)
Initialize assignments for n0 variables and values d0.
virtual ~Assignment(void)
Destructor.
Gecode::FloatNum randval(void)
Gecode::FloatRelType frt(void) const
Return current relation type.
Gecode toplevel namespace
Base class for all tests to be run
Node * x
Pointer to corresponding Boolean expression node.
void reset(void)
Reset iterator.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
@ RM_EQV
Equivalence for reification (default)
int rms
Which reification modes are supported.
bool flip(void)
Flip a coin and return true or false randomly.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
double FloatNum
Floating point number base type.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Floating point rounding policy.
void operator++(void)
Increment to next relation type.
const int max
Largest allowed integer value.
@ FRT_LQ
Less or equal ( )
virtual bool operator()(void) const
Test whether all assignments have been iterated.
Gecode::FloatVal d
Domain for each variable.
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
virtual ~CpltAssignment(void)
Destructor.
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
@ FRT_GQ
Greater or equal ( )
MaybeType operator&(MaybeType a, MaybeType b)
Three-valued conjunction of MaybeType.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
virtual ~ExtAssignment(void)
Destructor.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
MaybeType
Type for comparisons and solutions.
int size(void) const
Return number of variables.
Base class for assignments
Gecode::FloatNum step
Step for next assignment.
CpltAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s)
Initialize assignments for n variables and values d with step s.
int n
Number of negative literals for node type.
bool imp(void) const
Test whether implication as reification mode is supported.
int n
Number of variables.
Gecode::IntArgs i({1, 2, 3, 4})
int a
How many assigments still to be generated Generate new value according to domain.
const FloatNum max
Largest allowed float value.
virtual Gecode::FloatVal operator[](int i) const
Return value for variable i.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
virtual ~RandomAssignment(void)
Destructor.