Generated on for Gecode by doxygen 1.17.0
Test::Float::Test Class Referenceabstract

Base class for tests with float constraints More...

#include <test/float.hh>

Protected Attributes

int arity
 Number of variables.
Gecode::FloatVal dom
 Domain of variables.
Gecode::FloatNum step
 Step for going to next solution.
AssignmentType assignmentType
 Gives the type of assignment to use.
bool reified
 Does the constraint also exist as reified constraint.
int rms
 Which reification modes are supported.
bool testsearch
 Whether to perform search test.
bool testfix
 Whether to perform fixpoint test.
bool testsubsumed
 Whether to test for subsumption.

Test for reification modes

bool eqv (void) const
 Test whether equivalence as reification mode is supported.
bool imp (void) const
 Test whether implication as reification mode is supported.
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.
 Test (const std::string &s, int a, Gecode::FloatNum min, Gecode::FloatNum max, Gecode::FloatNum st, AssignmentType at, bool r)
 Constructor.
virtual Assignmentassignment (void) const
 Create assignment.
virtual bool extendAssignment (Assignment &a) const
 Complete the current assignment to get a feasible one (which satisfies all constraint). If such an assignment is computed, it returns true, false otherwise.
virtual MaybeType solution (const Assignment &) const =0
 Check for solution.
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 extended assignment.
virtual bool ignore (const Assignment &a) const
 Whether to ignore assignment for reification.
virtual void post (Gecode::Space &home, Gecode::FloatVarArray &x)=0
 Post constraint.
virtual void post (Gecode::Space &home, Gecode::FloatVarArray &x, Gecode::Reify r)
 Post reified constraint.
virtual bool run (void)
 Perform test.

General support

bool flip (void)
 Flip a coin and return true or false randomly.
static MaybeType cmp (Gecode::FloatVal x, Gecode::FloatRelType r, Gecode::FloatVal y)
 Compare x and y with respect to r.
static MaybeType eq (Gecode::FloatVal x, Gecode::FloatVal y)
 Whether x and y are equal.

Mapping scalar values to strings

static std::string str (Gecode::FloatRelType frt)
 Map float relation to string.
static std::string str (Gecode::FloatNum f)
 Map floatNum to string.
static std::string str (Gecode::FloatVal f)
 Map floatVal to string.
static std::string str (const Gecode::FloatValArgs &f)
 Map float array to string.

Additional Inherited Members

Public Member Functions inherited from Test::Base
 Base (std::string s)
 Create and register test with name s.
const std::string & name (void) const
 Return name of test.
Basenext (void) const
 Return next test.
void next (Base *n)
 Set next test.
bool fixpoint (void)
 Throw a coin whether to compute a fixpoint.
virtual ~Base (void)
 Destructor.
Static Public Member Functions inherited from Test::Base
static void sort (void)
 Sort tests alphabetically.
static Basetests (void)
 Return all tests.
static bool fixpoint (Gecode::Support::RandomGenerator &rand)
 Throw a coin whether to compute a fixpoint.
static std::string str (bool b)
 Map bool to string.
static std::string str (int i)
 Map integer to string.
static std::string str (const Gecode::IntArgs &i)
 Map integer array to string.
Gecode::Support::RandomGenerator _rand
 Random number generator.

Detailed Description

Base class for tests with float constraints

Definition at line 245 of file float.hh.

Constructor & Destructor Documentation

◆ Test() [1/2]

Test::Float::Test::Test ( const std::string & s,
int a,
const Gecode::FloatVal & d,
Gecode::FloatNum st,
AssignmentType at,
bool r )
inline

Constructor.

Constructs a test with name s and arity a and variable domain d and step st and assignment type at. Also tests for a reified constraint, if r is true.

Definition at line 173 of file float.hpp.

◆ Test() [2/2]

Test::Float::Test::Test ( const std::string & s,
int a,
Gecode::FloatNum min,
Gecode::FloatNum max,
Gecode::FloatNum st,
AssignmentType at,
bool r )
inline

Constructor.

Constructs a test with name s and arity a and variable domain min ... max and step st and assignment type at. Also tests for a reified constraint, if r is true.

Definition at line 183 of file float.hpp.

Member Function Documentation

◆ eqv()

bool Test::Float::Test::eqv ( void ) const
inlineprotected

Test whether equivalence as reification mode is supported.

Definition at line 161 of file float.hpp.

◆ imp()

bool Test::Float::Test::imp ( void ) const
inlineprotected

Test whether implication as reification mode is supported.

Definition at line 165 of file float.hpp.

◆ pmi()

bool Test::Float::Test::pmi ( void ) const
inlineprotected

Test whether reverse implication as reification mode is supported.

Definition at line 169 of file float.hpp.

◆ assignment()

virtual Assignment * Test::Float::Test::assignment ( void ) const
virtual

Create assignment.

◆ extendAssignment()

virtual bool Test::Float::Test::extendAssignment ( Assignment & a) const
virtual

Complete the current assignment to get a feasible one (which satisfies all constraint). If such an assignment is computed, it returns true, false otherwise.

◆ solution()

virtual MaybeType Test::Float::Test::solution ( const Assignment & ) const
pure virtual

Check for solution.

◆ subsumed()

bool Test::Float::Test::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 extended assignment.

◆ ignore()

virtual bool Test::Float::Test::ignore ( const Assignment & a) const
virtual

Whether to ignore assignment for reification.

◆ post() [1/2]

virtual void Test::Float::Test::post ( Gecode::Space & home,
Gecode::FloatVarArray & x )
pure virtual

Post constraint.

◆ post() [2/2]

virtual void Test::Float::Test::post ( Gecode::Space & home,
Gecode::FloatVarArray & x,
Gecode::Reify r )
virtual

Post reified constraint.

◆ run()

virtual bool Test::Float::Test::run ( void )
virtual

Perform test.

Implements Test::Base.

◆ str() [1/4]

std::string Test::Float::Test::str ( Gecode::FloatRelType frt)
inlinestatic

Map float relation to string.

Definition at line 195 of file float.hpp.

◆ str() [2/4]

std::string Test::Float::Test::str ( Gecode::FloatNum f)
inlinestatic

Map floatNum to string.

Definition at line 212 of file float.hpp.

◆ str() [3/4]

std::string Test::Float::Test::str ( Gecode::FloatVal f)
inlinestatic

Map floatVal to string.

Definition at line 220 of file float.hpp.

◆ str() [4/4]

std::string Test::Float::Test::str ( const Gecode::FloatValArgs & f)
inlinestatic

Map float array to string.

Definition at line 228 of file float.hpp.

◆ cmp()

MaybeType Test::Float::Test::cmp ( Gecode::FloatVal x,
Gecode::FloatRelType r,
Gecode::FloatVal y )
inlinestatic

Compare x and y with respect to r.

Definition at line 236 of file float.hpp.

◆ eq()

MaybeType Test::Float::Test::eq ( Gecode::FloatVal x,
Gecode::FloatVal y )
inlinestatic

Whether x and y are equal.

Definition at line 269 of file float.hpp.

◆ flip()

bool Test::Float::Test::flip ( void )
inline

Flip a coin and return true or false randomly.

Definition at line 274 of file float.hpp.

Member Data Documentation

◆ arity

int Test::Float::Test::arity
protected

Number of variables.

Definition at line 248 of file float.hh.

◆ dom

Gecode::FloatVal Test::Float::Test::dom
protected

Domain of variables.

Definition at line 250 of file float.hh.

◆ step

Gecode::FloatNum Test::Float::Test::step
protected

Step for going to next solution.

Definition at line 252 of file float.hh.

◆ assignmentType

AssignmentType Test::Float::Test::assignmentType
protected

Gives the type of assignment to use.

Definition at line 254 of file float.hh.

◆ reified

bool Test::Float::Test::reified
protected

Does the constraint also exist as reified constraint.

Definition at line 256 of file float.hh.

◆ rms

int Test::Float::Test::rms
protected

Which reification modes are supported.

Definition at line 258 of file float.hh.

◆ testsearch

bool Test::Float::Test::testsearch
protected

Whether to perform search test.

Definition at line 260 of file float.hh.

◆ testfix

bool Test::Float::Test::testfix
protected

Whether to perform fixpoint test.

Definition at line 262 of file float.hh.

◆ testsubsumed

bool Test::Float::Test::testsubsumed
protected

Whether to test for subsumption.

Definition at line 264 of file float.hh.


The documentation for this class was generated from the following files: