38 namespace Test {
namespace Float {
57 dsv(new Gecode::FloatVal[static_cast<unsigned int>(
n)]),
59 using namespace Gecode;
69 assert((
i>=0) && (
i<
n));
74 assert((
i>=0) && (
i<
n));
87 using namespace Gecode;
88 for (
int i=
n-1;
i--; )
98 assert((
i>=0) && (
i<
n));
103 assert((
i>=0) && (
i<
n));
113 using namespace Gecode;
142 assert((
i>=0) && (
i<
n));
147 assert((
i>=0) && (
i<
n));
175 :
Base(
"Float::"+s), arity(
a),
dom(
d),
step(st), assigmentType(at),
176 reified(
r), rms((1 << Gecode::
RM_EQV) |
179 testsearch(true), testfix(true), testsubsumed(true) {}
186 assigmentType(at), reified(
r),
187 rms((1 << Gecode::
RM_EQV) |
190 testsearch(true), testfix(true), testsubsumed(true) {}
195 using namespace Gecode;
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]) +
"]";
236 using namespace Gecode;
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
Floating point rounding policy.
Base class for all tests to be run
static Gecode::Support::RandomGenerator rand
Random number generator.
Base class for assignments
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 void set(int i, const Gecode::FloatVal &val)
Set assignment to value val for variable i.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
CpltAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s)
Initialize assignments for n variables and values d with step s.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb)
Initialize assignments for n variables and values d with step s.
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.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
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.
RandomAssignment(int n, const Gecode::FloatVal &d, int a)
Initialize for a assignments for n variables and values d.
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.
Gecode::FloatNum randval(void)
Gecode::FloatVal * vals
The current values for the variables.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
int a
How many assigments still to be generated Generate new value according to domain.
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 eqv(void) const
Test whether equivalence as reification mode is supported.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
bool flip(void)
Flip a coin and return true or false randomly.
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 imp(void) const
Test whether implication as reification mode is supported.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Post propagator for SetVar SetOpType SetVar y
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 FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
const int max
Largest allowed integer value.
const Gecode::FloatNum step
AssignmentType
Assignment possible types.
MaybeType operator&(MaybeType a, MaybeType b)
Three-valued conjunction of MaybeType.
MaybeType
Type for comparisons and solutions.
Gecode::IntArgs i({1, 2, 3, 4})
#define GECODE_NEVER
Assert that this command is never executed.