38namespace 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));
164 Test::imp(
void)
const {
168 Test::pmi(
void)
const {
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) {}
185 :
Base(
"Float::"+s), arity(
a), dom(min,max), step(st),
186 assigmentType(at), reified(
r),
187 rms((1 <<
Gecode::RM_EQV) |
190 testsearch(true), testfix(true), testsubsumed(true) {}
197 case FRT_EQ:
return "Eq";
198 case FRT_NQ:
return "Nq";
199 case FRT_LQ:
return "Lq";
200 case FRT_LE:
return "Le";
201 case FRT_GQ:
return "Gq";
202 case FRT_GR:
return "Gr";
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]) +
"]";
274 return Base::rand(2U) == 0U;
289 FloatRelTypes::FloatRelTypes(
void)
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
int size(void) const
Return size of array (number of elements)
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::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.
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.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
double FloatNum
Floating point number base type.
FloatRelType
Relation types for floats.
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
@ RM_EQV
Equivalence for reification (default)
const int max
Largest allowed integer value.
Gecode toplevel namespace
AssignmentType
Assignment possible types.
MaybeType
Type for comparisons and solutions.
#define GECODE_NEVER
Assert that this command is never executed.