38#ifndef GECODE_TEST_FLOAT_HH
39#define GECODE_TEST_FLOAT_HH
268 bool eqv(
void)
const;
270 bool imp(
void)
const;
272 bool pmi(
void)
const;
292 Test(
const std::string& s,
int a,
Reification specification.
Base(std::string s)
Create and register test with name s.
Base class for assignments
int n
Number of variables.
Assignment(int n0, const Gecode::FloatVal &d0)
Initialize assignments for n0 variables and values d0.
virtual void next(Gecode::Support::RandomGenerator &rand)=0
Move to next assignment.
Gecode::FloatVal d
Domain for each variable.
virtual bool has_more(void) const =0
Test whether all assignments have been iterated.
virtual Gecode::FloatVal operator[](int i) const =0
Return value for variable i.
virtual void set(int i, const Gecode::FloatVal &val)=0
Set assignment to value val for variable i.
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.
virtual void next(Gecode::Support::RandomGenerator &rand)
Move to next assignment.
Gecode::FloatVal * dsv
Iterator for each variable.
virtual bool has_more(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.
CpltAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s)
Initialize assignments for n variables and values d with step s.
virtual void next(Gecode::Support::RandomGenerator &rand)
Move to next assignment.
virtual bool has_more(void) const
Test whether all assignments have been iterated.
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.
Gecode::FloatNum step
Step for next assignment.
const Test * curPb
Current problem used to complete assignment.
ExtAssignment(int n, const Gecode::FloatVal &d, Gecode::FloatNum s, const Test *pb, Gecode::Support::RandomGenerator &rand)
Initialize assignments for n variables and values d with step s.
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.
virtual void next(Gecode::Support::RandomGenerator &rand)
Move to next assignment.
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.
RandomAssignment(int n, const Gecode::FloatVal &d, int a0, Gecode::Support::RandomGenerator &rand)
Initialize for a assignments for n variables and values d.
Gecode::FloatNum randval(Gecode::Support::RandomGenerator &rand)
Gecode::FloatVal * vals
The current values for the variables.
int a
How many assignments still to be generated Generate new value according to domain.
virtual bool has_more(void) const
Test whether all assignments have been iterated.
virtual ~RandomAssignment(void)
Destructor.
Space for executing tests.
TestSpace(int n, Gecode::FloatVal &d, Gecode::FloatNum s, Test *t, Gecode::ReifyMode rm)
Create test space.
void bound(Gecode::Support::RandomGenerator &rand)
Assign a random variable to a random bound.
void prune(int i, Gecode::Support::RandomGenerator &rand)
Prune some random values from variable i.
Gecode::FloatVarArray x
Variables to be tested.
bool prune(const Assignment &a, bool testfix, Gecode::Support::RandomGenerator &rand)
Prune values but not those in assignment a.
Gecode::FloatNum cut(int *cutDirections)
Cut the bigger variable to an half sized interval. It returns the new size of the cut interval....
bool matchAssignment(const Assignment &a) const
Test whether all variables match assignment a.
Gecode::Reify r
Reification information.
virtual void dropUntil(const Assignment &a)
Add constraints to skip solutions to the a assignment.
unsigned int propagators(void)
Return the number of propagators.
void disable(void)
Disable propagators in space and compute fixpoint (make all idle).
void rel(bool sol)
Perform Boolean tell on b.
Gecode::FloatVal d
Initial domain.
void post(void)
Post propagator.
TestSpace(int n, Gecode::FloatVal &d, Gecode::FloatNum s, Test *t)
Create test space.
virtual Gecode::Space * copy(void)
Copy space during cloning.
Test * test
The test currently run.
bool reified
Whether the test is for a reified propagator.
void enable(void)
Enable propagators in space.
bool failed(void)
Compute a fixpoint and check for failure.
bool assigned(void) const
Test whether all variables are assigned.
Gecode::FloatNum step
Step for going to next solution.
void assign(const Assignment &a, MaybeType &sol, bool skip, Gecode::Support::RandomGenerator &rand)
Assign all (or all but one, if skip is true) variables to values in a If assignment of a variable is ...
void rel(int i, Gecode::FloatRelType frt, Gecode::FloatVal n)
Perform integer tell operation on x[i].
TestSpace(TestSpace &s)
Constructor for cloning s.
void prune(Gecode::Support::RandomGenerator &rand)
Prune some random values for some random variable.
int rms
Which reification modes are supported.
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
virtual bool ignore(const Assignment &a) const
Whether to ignore assignment for reification.
static MaybeType cmp(Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
Compare x and y with respect to r.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x, Gecode::Reify r)
Post reified constraint.
bool testsubsumed
Whether to test for subsumption.
bool testfix
Whether to perform fixpoint test.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
int arity
Number of variables.
virtual bool run(void)
Perform test.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post constraint.
static std::string str(Gecode::FloatRelType frt)
Map float relation to string.
bool flip(void)
Flip a coin and return true or false randomly.
Gecode::FloatNum step
Step for going to next solution.
AssignmentType assignmentType
Gives the type of assignment to use.
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
virtual Assignment * assignment(void) const
Create assignment.
bool subsumed(const TestSpace &ts) const
Test if ts is subsumed or not (i.e. if there is no more propagator unless the assignment is an extend...
bool reified
Does the constraint also exist as reified constraint.
virtual bool extendAssignment(Assignment &a) const
Complete the current assignment to get a feasible one (which satisfies all constraint)....
bool testsearch
Whether to perform search test.
virtual MaybeType solution(const Assignment &) const =0
Check for solution.
Gecode::FloatVal dom
Domain of variables.
bool imp(void) const
Test whether implication as reification mode is supported.
LinearCongruentialGenerator< 2147483647, 48271, 44488, 3399 > RandomGenerator
Default values for linear congruential generator.
double FloatNum
Floating point number base type.
FloatRelType
Relation types for floats.
ReifyMode
Mode for reification.
AssignmentType
Assignment possible types.
MaybeType operator&(MaybeType a, MaybeType b)
Three-valued conjunction of MaybeType.
MaybeType
Type for comparisons and solutions.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const Dictionary &d)
Print statistics summary.