Base class for tests with integer constraints More...
#include <int.hh>
Public Member Functions | |
Test (const std::string &p, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntConLevel i=Gecode::ICL_DEF) | |
Constructor. More... | |
Test (const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntConLevel i=Gecode::ICL_DEF) | |
Constructor. More... | |
Test (const std::string &p, const std::string &s, int a, int min, int max, bool r=false, Gecode::IntConLevel i=Gecode::ICL_DEF) | |
Constructor. More... | |
Test (const std::string &s, int a, int min, int max, bool r=false, Gecode::IntConLevel i=Gecode::ICL_DEF) | |
Constructor. More... | |
virtual Assignment * | assignment (void) const |
Create assignment. More... | |
virtual bool | solution (const Assignment &) const =0 |
Check for solution. More... | |
virtual bool | ignore (const Assignment &) const |
Whether to ignore assignment for reification. More... | |
virtual void | post (Gecode::Space &home, Gecode::IntVarArray &x)=0 |
Post constraint. More... | |
virtual void | post (Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r) |
Post reified constraint. More... | |
virtual bool | run (void) |
Perform test. More... | |
![]() | |
Base (const std::string &s) | |
Create and register test with name s. More... | |
const std::string & | name (void) const |
Return name of test. More... | |
Base * | next (void) const |
Return next test. More... | |
void | next (Base *n) |
Set next test. More... | |
virtual | ~Base (void) |
Destructor. More... | |
Protected Attributes | |
int | arity |
Number of variables. More... | |
Gecode::IntSet | dom |
Domain of variables. More... | |
bool | reified |
Does the constraint also exist as reified constraint. More... | |
int | rms |
Which reification modes are supported. More... | |
Gecode::IntConLevel | icl |
Consistency level. More... | |
ConTestLevel | contest |
Whether to test for certain consistency. More... | |
bool | testsearch |
Whether to perform search test. More... | |
bool | testfix |
Whether to perform fixpoint test. More... | |
Test for reification modes | |
bool | eqv (void) const |
Test whether equivalence as reification mode is supported. More... | |
bool | imp (void) const |
Test whether implication as reification mode is supported. More... | |
bool | pmi (void) const |
Test whether reverse implication as reification mode is supported. More... | |
Mapping scalar values to strings | |
static std::string | str (Gecode::ExtensionalPropKind epk) |
Map extensional propagation kind to string. More... | |
static std::string | str (Gecode::IntConLevel icl) |
Map integer consistency level to string. More... | |
static std::string | str (Gecode::IntRelType irl) |
Map integer relation to string. More... | |
static std::string | str (Gecode::BoolOpType bot) |
Map Boolean operation to string. More... | |
static std::string | str (int i) |
Map integer to string. More... | |
static std::string | str (const Gecode::IntArgs &i) |
Map integer array to string. More... | |
General support | |
template<class T > | |
static bool | cmp (T x, Gecode::IntRelType r, T y) |
Compare x and y with respect to r. More... | |
Additional Inherited Members | |
![]() | |
static void | sort (void) |
Sort tests alphabetically. More... | |
static Base * | tests (void) |
Return all tests. More... | |
static bool | fixpoint (void) |
Throw a coin whether to compute a fixpoint. More... | |
![]() | |
static Gecode::Support::RandomGenerator | rand = Gecode::Support::RandomGenerator() |
Random number generator. More... | |
![]() | |
int | main (int argc, char *argv[]) |
Main function. More... | |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
virtual |
Create assignment.
Reimplemented in Test::Int::Cumulative::OptFlexCumulative, Test::Int::Cumulative::ManFlexCumulative, Test::Int::GCC::VarSome, Test::Int::Unary::OptFlexUnary, Test::Int::Cumulatives::Cumulatives, Test::Int::Cumulative::OptFixPCumulative, Test::Int::Unary::ManFlexUnary, Test::Int::BinPacking::BPT, Test::Int::Distinct::Random, Test::Int::Unary::OptFixPUnary, Test::Int::Cumulative::ManFixPCumulative, Test::Int::Unary::ManFixPUnary, and Test::Int::NValues::IntInt.
|
pure virtual |
Check for solution.
Implemented in Test::Int::Arithmetic::ArgMinShared, Test::Int::Arithmetic::ArgMin, Test::Int::Arithmetic::ArgMaxShared, Test::Int::Arithmetic::ArgMax, Test::Int::Arithmetic::MaxNaryShared, Test::Int::Arithmetic::MaxNary, Test::Int::Arithmetic::MinNaryShared, Test::Int::Arithmetic::MinNary, Test::Int::Arithmetic::MaxXXX, Test::Int::Arithmetic::MaxXYY, Test::Int::Arithmetic::MaxXYX, Test::Int::Arithmetic::MaxXXY, Test::Int::Arithmetic::MaxXYZ, Test::Int::Arithmetic::MinXXX, Test::Int::Arithmetic::MinXYY, Test::Int::Arithmetic::MinXYX, Test::Int::Arithmetic::MinXXY, Test::Int::Arithmetic::MinXYZ, Test::Int::Extensional::TupleSetBool, Test::Int::Arithmetic::AbsXX, Test::Int::Rel::BoolArray, Test::Int::Arithmetic::AbsXY, Test::Int::Element::MatrixBoolVarBoolVarXX, Test::Int::Extensional::TupleSetB, Test::Int::Rel::IntArrayDiff, Test::Int::Arithmetic::Mod, Test::Int::Bool::ITE, Test::Int::Element::MatrixBoolVarBoolVarXY, Test::Int::Arithmetic::Div, Test::Int::Element::MatrixIntVarIntVarXX, Test::Int::Rel::IntArray, Test::Int::Bool::ClauseConst, Test::Int::Arithmetic::DivMod, Test::Int::Cumulative::OptFlexCumulative, Test::Int::MiniModelLin::LinRelMixed, Test::Int::Element::MatrixIntVarIntVarXY, Test::Int::Bool::ClauseXXY, Test::Int::Extensional::TupleSetA, Test::Int::Arithmetic::NrootXX, Test::Int::Rel::BoolSharedSeq, Test::Int::Count::VarVarSharedC, Test::Int::Element::MatrixIntBoolVarXX, Test::Int::Arithmetic::NrootXY, Test::Int::Bool::ClauseXXYYX, Test::Int::Extensional::RegOpt, Test::Int::Rel::BoolSeq, Test::Int::Count::VarVarSharedB, Test::Int::Element::MatrixIntBoolVarXY, Test::Int::Extensional::RegEmptyREG, Test::Int::Bool::ClauseXYZ, Test::Int::Count::VarVarSharedA, Test::Int::Element::MatrixIntIntVarXX, Test::Int::Rel::IntSharedSeq, Test::Int::Extensional::RegEmptyDFA, Test::Int::Cumulative::ManFlexCumulative, Test::Int::MiniModelLin::LinRelBool, Test::Int::Bool::NaryConst, Test::Int::MiniModelArithmetic::MaxNary, Test::Int::Count::VarInt, Test::Int::Extensional::RegSharedD, Test::Int::Element::MatrixIntIntVarXY, Test::Int::Rel::IntSeq, Test::Int::Circuit::CircuitFullCost, Test::Int::Arithmetic::PowXX, Test::Int::MiniModelArithmetic::MinNary, Test::Int::Extensional::RegSharedC, Test::Int::Count::VarVar, Test::Int::Bool::NaryShared, Test::Int::Element::VarBoolInt, Test::Int::MiniModelArithmetic::Max, Test::Int::GCC::VarSome, Test::Int::MiniModelCount::IntArrayVar, Test::Int::Arithmetic::PowXY, Test::Int::Count::IntVarShared, Test::Int::Rel::BoolInt, Test::Int::Extensional::RegSharedB, Test::Int::MiniModelArithmetic::Min, Test::Int::Bool::Nary, Test::Int::Element::VarBoolVar, Test::Int::Unary::OptFlexUnary, Test::Int::NoOverlap::VarOptShared2, Test::Int::MiniModelSet::SetExprExpr, Test::Int::Linear::BoolVar, Test::Int::BinPacking::MBPT, Test::Int::Arithmetic::SqrtXX, Test::Int::Count::IntArrayVar, Test::Int::Circuit::PathCost, Test::Int::MiniModelArithmetic::Abs, Test::Int::Element::VarIntShared, Test::Int::Extensional::RegSharedA, Test::Int::MiniModelCount::IntArrayInt, Test::Int::Bool::BinConstXX, Test::Int::Cumulatives::Cumulatives, Test::Int::Rel::IntInt, Test::Int::Arithmetic::SqrtXY, Test::Int::MiniModelLin::LinRelInt, Test::Int::Cumulative::OptFixPCumulative, Test::Int::GCC::VarAll, Test::Int::MiniModelArithmetic::Sqrt, Test::Int::Element::VarIntInt, Test::Int::Extensional::RegRoland, Test::Int::Count::IntArrayInt, Test::Int::Bool::BinConstXY, Test::Int::NValues::BoolVar, Test::Int::Arithmetic::SqrXX, Test::Int::NoOverlap::VarOpt2, Test::Int::Channel::ChannelLinkMulti, Test::Int::Rel::BoolVarXX, Test::Int::Linear::BoolInt, Test::Int::MiniModelCount::VarInt, Test::Int::MiniModelArithmetic::Sqr, Test::Int::Unary::ManFlexUnary, Test::Int::BinPacking::BPT, Test::Int::Element::VarIntVar, Test::Int::Arithmetic::SqrXY, Test::Int::MiniModelLin::LinExprMixed, Test::Int::Bool::BinXXX, Test::Int::Count::SetVar, Test::Int::Circuit::CircuitCost, Test::Int::Channel::ChannelLinkSingle, Test::Int::GCC::IntSome< hole >, Test::Int::MiniModelBoolean::BoolExprVar, Test::Int::Element::IntBoolInt, Test::Float::MiniModelLin::LinRel, Test::Int::NValues::BoolInt, Test::Int::MiniModelArithmetic::Minus, Test::Int::Arithmetic::MultXXX, Test::Int::NoOverlap::Var2, Test::Int::Extensional::RegDistinct, Test::Int::Bool::BinXYY, Test::Int::MiniModelCount::VarVar, Test::Int::Dom::DomDom, Test::Int::MiniModelSet::SetExprConst, Test::Int::Channel::ChannelShared, Test::Int::Count::IntVar, Test::Int::MiniModelLin::LinExprBool, Test::Int::Rel::BoolVarXY, Test::Int::GCC::IntAllMax, Test::Int::Distinct::Random, Test::Int::Element::IntBoolVar, Test::Int::Linear::IntVar, Test::Int::Arithmetic::MultXYY, Test::Int::Exec::When, Test::Int::MiniModelBoolean::BoolExprInt, Test::Int::MiniModelArithmetic::Plus, Test::Int::Bool::BinXYX, Test::Int::Unary::OptFixPUnary, Test::Float::MiniModelLin::LinExpr, Test::Int::Dom::DomRangeEmpty, Test::Int::Sorted::PermVar, Test::Int::MiniModelLin::LinExprInt, Test::Int::NValues::IntVar, Test::Int::Count::IntIntDup, Test::Int::Element::IntIntShared, Test::Int::Rel::IntVarXX, Test::Int::Circuit::Path, Test::Int::Channel::ChannelHalf, Test::Int::Extensional::RegSimpleC, Test::Int::MiniModelCount::IntVar, Test::Int::NoOverlap::IntOpt2, Test::Int::Arithmetic::MultXYX, Test::Int::MiniModelArithmetic::Mod, Test::Int::Bool::BinXXY, Test::Int::Distinct::Offset, Test::Int::GCC::IntAllMinMaxDef, Test::Int::MiniModel::BoolLex, Test::Int::Member::Bool, Test::Int::Cumulative::ManFixPCumulative, Test::Int::Exec::BoolWait, Test::Int::Precede::Multi, Test::Int::Element::IntIntInt, Test::Int::Dom::DomRange, Test::Int::Extensional::RegSimpleB, Test::Int::Arithmetic::MultXXY, Test::Int::Count::SetInt, Test::Int::MiniModelArithmetic::Div, Test::Int::Linear::IntInt, Test::Int::Unshare::Bool, Test::Int::Unary::ManFixPUnary, Test::Int::Bool::BinXYZ, Test::Int::NValues::IntInt, Test::Int::MiniModelCount::IntInt, Test::Int::Sorted::NoVar, Test::Int::Sequence::SequenceTest, Test::Int::NoOverlap::Int2, Test::Int::Channel::ChannelFull, Test::Int::Distinct::Distinct< useCount >, Test::Int::Element::IntIntVar, Test::Int::Circuit::Circuit, Test::Int::Rel::IntVarXY, Test::Int::Arithmetic::MultXYZ, Test::Int::MiniModel::IntLex, Test::Int::Basic::Basic, Test::Int::Extensional::RegSimpleA, Test::Int::GCC::IntAllMinMax, Test::Int::MiniModelArithmetic::Mult, Test::Int::Count::IntInt, Test::Int::Precede::Single, Test::Int::Exec::IntWait, Test::Int::Unshare::Int, Test::Int::Member::Int, and Test::Int::Dom::DomInt.
|
virtual |
Whether to ignore assignment for reification.
Reimplemented in Test::Int::Linear::BoolVar.
|
pure virtual |
Post constraint.
Implemented in Test::Int::Arithmetic::ArgMinShared, Test::Int::Arithmetic::ArgMin, Test::Int::Arithmetic::ArgMaxShared, Test::Int::Arithmetic::ArgMax, Test::Int::Arithmetic::MaxNaryShared, Test::Int::Arithmetic::MaxNary, Test::Int::Arithmetic::MinNaryShared, Test::Int::Arithmetic::MinNary, Test::Int::Arithmetic::MaxXXX, Test::Int::Arithmetic::MaxXYY, Test::Int::Arithmetic::MaxXYX, Test::Int::Arithmetic::MaxXXY, Test::Int::Arithmetic::MaxXYZ, Test::Int::Arithmetic::MinXXX, Test::Int::Arithmetic::MinXYY, Test::Int::Arithmetic::MinXYX, Test::Int::Arithmetic::MinXXY, Test::Int::Arithmetic::MinXYZ, Test::Int::Extensional::TupleSetBool, Test::Int::Arithmetic::AbsXX, Test::Int::Rel::BoolArray, Test::Int::Element::MatrixBoolVarBoolVarXX, Test::Int::Arithmetic::AbsXY, Test::Int::Extensional::TupleSetB, Test::Int::Rel::IntArrayDiff, Test::Int::Arithmetic::Mod, Test::Int::Bool::ITE, Test::Int::Element::MatrixBoolVarBoolVarXY, Test::Int::Cumulative::OptFlexCumulative, Test::Int::Arithmetic::Div, Test::Int::Bool::ClauseConst, Test::Int::Element::MatrixIntVarIntVarXX, Test::Int::Rel::IntArray, Test::Int::Arithmetic::DivMod, Test::Int::Element::MatrixIntVarIntVarXY, Test::Int::MiniModelLin::LinRelMixed, Test::Int::Rel::BoolSharedSeq, Test::Int::Arithmetic::NrootXX, Test::Int::Extensional::TupleSetA, Test::Int::Bool::ClauseXXY, Test::Int::Element::MatrixIntBoolVarXX, Test::Int::Count::VarVarSharedC, Test::Int::Bool::ClauseXXYYX, Test::Int::Arithmetic::NrootXY, Test::Int::Rel::BoolSeq, Test::Int::Extensional::RegOpt, Test::Int::Count::VarVarSharedB, Test::Int::Element::MatrixIntBoolVarXY, Test::Int::Cumulative::ManFlexCumulative, Test::Int::Extensional::RegEmptyREG, Test::Int::Bool::ClauseXYZ, Test::Int::Rel::IntSharedSeq, Test::Int::Count::VarVarSharedA, Test::Int::Element::MatrixIntIntVarXX, Test::Int::Extensional::RegEmptyDFA, Test::Int::MiniModelLin::LinRelBool, Test::Int::Bool::NaryConst, Test::Int::Circuit::CircuitFullCost, Test::Int::Count::VarInt, Test::Int::MiniModelArithmetic::MaxNary, Test::Int::Element::MatrixIntIntVarXY, Test::Int::Rel::IntSeq, Test::Int::Extensional::RegSharedD, Test::Int::Arithmetic::PowXX, Test::Int::GCC::VarSome, Test::Int::MiniModelArithmetic::MinNary, Test::Int::Count::VarVar, Test::Int::Bool::NaryShared, Test::Int::Extensional::RegSharedC, Test::Int::Element::VarBoolInt, Test::Int::MiniModelArithmetic::Max, Test::Int::MiniModelCount::IntArrayVar, Test::Int::Arithmetic::PowXY, Test::Int::MiniModelSet::SetExprExpr, Test::Int::Count::IntVarShared, Test::Int::NoOverlap::VarOptShared2, Test::Int::Rel::BoolInt, Test::Int::Extensional::RegSharedB, Test::Int::Linear::BoolVar, Test::Int::Cumulative::OptFixPCumulative, Test::Int::Unary::OptFlexUnary, Test::Int::Bool::Nary, Test::Int::Circuit::PathCost, Test::Int::MiniModelArithmetic::Min, Test::Int::Element::VarBoolVar, Test::Int::BinPacking::MBPT, Test::Int::Cumulatives::Cumulatives, Test::Int::Arithmetic::SqrtXX, Test::Int::Count::IntArrayVar, Test::Int::MiniModelArithmetic::Abs, Test::Int::MiniModelCount::IntArrayInt, Test::Int::Extensional::RegSharedA, Test::Int::GCC::VarAll, Test::Int::Element::VarIntShared, Test::Int::Bool::BinConstXX, Test::Int::Rel::IntInt, Test::Int::Arithmetic::SqrtXY, Test::Int::MiniModelLin::LinRelInt, Test::Int::NValues::BoolVar, Test::Int::NoOverlap::VarOpt2, Test::Int::Channel::ChannelLinkMulti, Test::Int::Count::IntArrayInt, Test::Int::Extensional::RegRoland, Test::Int::MiniModelArithmetic::Sqrt, Test::Int::Element::VarIntInt, Test::Int::Bool::BinConstXY, Test::Int::Arithmetic::SqrXX, Test::Int::BinPacking::BPT, Test::Int::Linear::BoolInt, Test::Int::Rel::BoolVarXX, Test::Int::MiniModelCount::VarInt, Test::Int::Circuit::CircuitCost, Test::Int::Unary::ManFlexUnary, Test::Int::MiniModelArithmetic::Sqr, Test::Int::Arithmetic::SqrXY, Test::Int::MiniModelLin::LinExprMixed, Test::Int::Element::VarIntVar, Test::Int::Count::SetVar, Test::Int::GCC::IntSome< hole >, Test::Float::MiniModelLin::LinRel, Test::Int::Bool::BinXXX, Test::Int::NValues::BoolInt, Test::Int::Channel::ChannelLinkSingle, Test::Int::NoOverlap::Var2, Test::Int::MiniModelBoolean::BoolExprVar, Test::Int::MiniModelSet::SetExprConst, Test::Int::MiniModelArithmetic::Minus, Test::Int::Element::IntBoolInt, Test::Int::Extensional::RegDistinct, Test::Int::Arithmetic::MultXXX, Test::Int::Dom::DomDom, Test::Int::MiniModelCount::VarVar, Test::Int::Sorted::PermVar, Test::Int::Bool::BinXYY, Test::Int::Channel::ChannelShared, Test::Int::Count::IntVar, Test::Int::MiniModelLin::LinExprBool, Test::Int::Rel::BoolVarXY, Test::Int::GCC::IntAllMax, Test::Int::Distinct::Random, Test::Int::Cumulative::ManFixPCumulative, Test::Int::Linear::IntVar, Test::Int::Arithmetic::MultXYY, Test::Int::Element::IntBoolVar, Test::Int::MiniModelArithmetic::Plus, Test::Int::Unary::OptFixPUnary, Test::Int::Circuit::Path, Test::Int::Extensional::RegSimpleC, Test::Int::MiniModelBoolean::BoolExprInt, Test::Int::Exec::When, Test::Int::NValues::IntVar, Test::Int::Bool::BinXYX, Test::Int::NoOverlap::IntOpt2, Test::Int::Sequence::SequenceIntTest, Test::Float::MiniModelLin::LinExpr, Test::Int::Count::IntIntDup, Test::Int::Dom::DomRangeEmpty, Test::Int::MiniModelLin::LinExprInt, Test::Int::Channel::ChannelHalf, Test::Int::MiniModelCount::IntVar, Test::Int::Element::IntIntShared, Test::Int::Rel::IntVarXX, Test::Int::Arithmetic::MultXYX, Test::Int::GCC::IntAllMinMaxDef, Test::Int::Distinct::Offset, Test::Int::MiniModelArithmetic::Mod, Test::Int::MiniModel::BoolLex, Test::Int::Bool::BinXXY, Test::Int::Member::Bool, Test::Int::Precede::Multi, Test::Int::Exec::BoolWait, Test::Int::Sequence::SequenceBoolTest, Test::Int::Sorted::NoVar, Test::Int::Count::SetInt, Test::Int::Dom::DomRange, Test::Int::Element::IntIntInt, Test::Int::NValues::IntInt, Test::Int::Arithmetic::MultXXY, Test::Int::Linear::IntInt, Test::Int::Extensional::RegSimpleB, Test::Int::Unshare::Bool, Test::Int::MiniModelArithmetic::Div, Test::Int::Unary::ManFixPUnary, Test::Int::MiniModelCount::IntInt, Test::Int::NoOverlap::Int2, Test::Int::Circuit::Circuit, Test::Int::Bool::BinXYZ, Test::Int::GCC::IntAllMinMax, Test::Int::Distinct::Distinct< useCount >, Test::Int::Channel::ChannelFull, Test::Int::MiniModel::IntLex, Test::Int::Rel::IntVarXY, Test::Int::Precede::Single, Test::Int::Arithmetic::MultXYZ, Test::Int::Element::IntIntVar, Test::Int::Count::IntInt, Test::Int::Extensional::RegSimpleA, Test::Int::MiniModelArithmetic::Mult, Test::Int::Exec::IntWait, Test::Int::Basic::Basic, Test::Int::Member::Int, Test::Int::Unshare::Int, and Test::Int::Dom::DomInt.
|
virtual |
Post reified constraint.
Reimplemented in Test::Int::MiniModelLin::LinRelMixed, Test::Int::MiniModelLin::LinRelBool, Test::Int::MiniModelSet::SetExprExpr, Test::Int::Rel::BoolInt, Test::Int::Linear::BoolVar, Test::Int::MiniModelLin::LinRelInt, Test::Int::Rel::IntInt, Test::Int::Linear::BoolInt, Test::Int::MiniModelSet::SetExprConst, Test::Int::Dom::DomDom, Test::Int::Rel::BoolVarXY, Test::Int::Linear::IntVar, Test::Int::Dom::DomRangeEmpty, Test::Int::Rel::IntVarXX, Test::Int::Member::Bool, Test::Int::Dom::DomRange, Test::Int::Linear::IntInt, Test::Int::Rel::IntVarXY, Test::Int::Member::Int, Test::Int::Dom::DomInt, and Test::Int::Basic::Basic.
|
virtual |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |