44 #ifndef __GECODE_SET_HH__ 45 #define __GECODE_SET_HH__ 55 #if !defined(GECODE_STATIC_LIBS) && \ 56 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER)) 58 #ifdef GECODE_BUILD_SET 59 #define GECODE_SET_EXPORT __declspec( dllexport ) 61 #define GECODE_SET_EXPORT __declspec( dllimport ) 66 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY 67 #define GECODE_SET_EXPORT __attribute__ ((visibility("default"))) 69 #define GECODE_SET_EXPORT 75 #ifndef GECODE_BUILD_SET 76 #define GECODE_LIBRARY_NAME "Set" 94 namespace Gecode {
namespace Set {
103 const unsigned int card = max-min+1;
105 void check(
int n,
const char*
l);
107 void check(
unsigned int n,
const char*
l);
164 SetVar(
Space& home,
int glbMin,
int glbMax,
int lubMin,
int lubMax,
165 unsigned int cardMin = 0,
186 unsigned int cardMin = 0,
208 unsigned int cardMin = 0,
230 unsigned int cardMin = 0,
236 unsigned int glbSize(
void)
const;
239 unsigned int lubSize(
void)
const;
241 unsigned int unknownSize(
void)
const;
243 unsigned int cardMin(
void)
const;
245 unsigned int cardMax(
void)
const;
247 int lubMin(
void)
const;
249 int lubMax(
void)
const;
251 int glbMin(
void)
const;
253 int glbMax(
void)
const;
258 bool contains(
int i)
const;
261 bool notContains(
int i)
const;
286 bool operator ()(
void)
const;
289 void operator ++(
void);
299 unsigned int width(
void)
const;
318 bool operator ()(
void)
const;
321 void operator ++(
void);
331 unsigned int width(
void)
const;
350 bool operator ()(
void)
const;
353 void operator ++(
void);
363 unsigned int width(
void)
const;
382 bool operator ()(
void)
const;
385 void operator ++(
void);
410 bool operator ()(
void)
const;
413 void operator ++(
void);
438 bool operator ()(
void)
const;
441 void operator ++(
void);
457 template<
class Char,
class Traits>
458 std::basic_ostream<Char,Traits>&
459 operator <<(std::basic_ostream<Char,Traits>& os,
const SetVar&
x);
505 template<
class InputIterator>
516 int lubMin,
int lubMax,
517 unsigned int minCard = 0,
527 int lubMin,
int lubMax,
528 unsigned int minCard = 0,
537 SetVarArgs(
Space& home,
int n,
int glbMin,
int glbMax,
539 unsigned int minCard = 0,
548 SetVarArgs(
Space& home,
int n,
550 unsigned int minCard = 0,
590 SetVarArray(
Space& home,
int n,
int glbMin,
int glbMax,
int lubMin,
int lubMax,
591 unsigned int minCard = 0,
600 SetVarArray(
Space& home,
int n,
const IntSet& glb,
int lubMin,
int lubMax,
601 unsigned int minCard = 0,
610 SetVarArray(
Space& home,
int n,
int glbMin,
int glbMax,
const IntSet& lub,
611 unsigned int minCard = 0,
620 SetVarArray(
Space& home,
int n,
622 unsigned int minCard = 0,
1278 SEL_ACTIVITY_SIZE_MAX
1299 Select select(
void)
const;
1407 Select select(
void)
const;
1477 Select select(
void)
const;
SetVarBranch SET_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest unknown set.
With largest accumulated failure count divided by domain size.
Which values to select for branching first.
SetVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
SetVarBranch SET_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
SetVarBranch SET_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest minimum unknown element.
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
Post propagator for and .
Variables as interfaces to variable implementations.
Include smallest element.
Combine variable selection criteria for tie-breaking.
void check(int n, const char *l)
Check whether integer n is in range, otherwise throw overflow exception with information l...
SetRelType
Common relation types for sets.
SetAssign SET_ASSIGN_MIN_EXC(void)
Exclude smallest element.
With largest accumulated failure count.
Range iterator for the unknown set.
SetVarBranch SET_VAR_NONE(void)
Select first unassigned variable.
const int min
Smallest allowed integer in integer set.
With smallest accumulated failure count divided by domain size.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
SetVarBranch SET_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
With smallest activity divided by domain size.
SetValBranch SET_VAL_MED_INC(void)
Include median element (rounding downwards)
With smallest maximum unknown element.
SetVarBranch SET_VAR_ACTIVITY_MIN(double d, BranchTbl tbl)
Select variable with lowest activity with decay factor d.
Random (uniform, for tie breaking)
SetValBranch SET_VAL_MIN_INC(void)
Include smallest element.
SetVarBranch SET_VAR_ACTIVITY_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest activity divided by domain size with decay factor d.
Select
Which variable selection.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Collection of symmetries.
SetAssign SET_ASSIGN(SetBranchVal v, SetBranchCommit c)
Select value as defined by the value function v and commit function c.
void atmostOne(Home home, const SetVarArgs &xa, unsigned int c)
Post propagator for and .
Range iterator for the greatest lower bound.
With largest minimum unknown element.
With largest degree divided by domain size.
SetOpType
Common operations for sets.
Recording activities for set variables.
SetAssign SET_ASSIGN_MAX_INC(void)
Include largest element.
SetValBranch SET_VAL_RND_EXC(Rnd r)
Exclude random element.
const unsigned int card
Maximum cardinality of an integer set.
const int max
Largest allowed integer in integer set.
const int max
Largest allowed integer value.
Exclude median element (rounding downwards)
SetAssign SET_ASSIGN_RND_EXC(Rnd r)
Exclude random element.
Exclude smallest element.
Range iterator for the least upper bound.
SetVarBranch SET_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest unknown set.
Exclude median element (rounding downwards)
Iterator for the unknown ranges of a set variable.
With largest maximum unknown element.
Iterator for the values in the unknown set of a set variable.
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntConLevel)
Post propagator for .
Gecode::FloatVal c(-8, 8)
SetAssign SET_ASSIGN_MAX_EXC(void)
Exclude largest element.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
SetVarBranch SET_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Class for AFC (accumulated failure count) management.
int n
Number of negative literals for node type.
A reference-counted pointer to a SymmetryObject.
int(* SetBranchVal)(const Space &home, SetVar x, int i)
Branch value function type for set variables.
IntRelType
Relation types for integers.
SetVarBranch SET_VAR_MERIT_MAX(SetBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
SetVarBranch SET_VAR_ACTIVITY_MAX(double d, BranchTbl tbl)
Select variable with highest activity with decay factor d.
Include smallest element.
With smallest unknown set.
Value iterator from range iterator.
Reification specification.
void(* SetBranchCommit)(Space &home, unsigned int a, SetVar x, int i, int n)
Branch commit function type for set variables.
SetValBranch SET_VAL_MAX_EXC(void)
Exclude largest element.
Iterator for the greatest lower bound ranges of a set variable.
Include median element (rounding downwards)
SetVarBranch SET_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
void precede(Home home, const IntVarArgs &x, int s, int t, IntConLevel)
Post propagator that s precedes t in x.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
SetValBranch SET_VAL_MAX_INC(void)
Include largest element.
SetVarBranch SET_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest maximum unknown element.
double(* SetBranchMerit)(const Space &home, SetVar x, int i)
Branch merit function type for set variables.
void(* VoidFunction)(void)
Base type for any function pointer.
With smallest minimum unknown element.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
SetVarBranch SET_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count divided by domain size with decay factor d...
With largest unknown set.
SetVarBranch SET_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest maximum unknown element.
Recording AFC information for set variables.
union Gecode::@519::NNF::@60 u
Union depending on nodetype t.
SetVarArgs(const VarArray< SetVar > &a)
Initialize from variable array a (copy elements)
Iterator for the least upper bound ranges of a set variable.
Passing integer variables.
Select s
Which value to select.
Passing integer arguments.
Passing Boolean variables.
void notMax(Home home, SetVar s, IntVar x)
Post propagator that propagates that x is not the maximal element of s.
SetValBranch SET_VAL_MIN_EXC(void)
Exclude smallest element.
SetVarBranch SET_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
SetAssign SET_ASSIGN_MIN_INC(void)
Include smallest element.
Set view for set variables
SetAssign SET_ASSIGN_MED_INC(void)
Include median element (rounding downwards)
Value branching information.
SetVarBranch SET_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Select
Which value selection.
Variable branching information.
BrancherHandle assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Node * x
Pointer to corresponding Boolean expression node.
SetVarArgs(int n)
Allocate array with n elements.
void convex(Home home, SetVar x)
Post propagator that propagates that x is convex.
SetVarBranch SET_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
SetAssign SET_ASSIGN_MED_EXC(void)
Exclude median element (rounding downwards)
Iterator for the values in the greatest lower bound of a set variable.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
SetVarArgs(const SetVarArgs &a)
Initialize from variable argument array a (copy elements)
With smallest degree divided by domain size.
void weights(Home home, IntSharedArray elements, IntSharedArray weights, SetVar x, IntVar y)
Post propagator for .
SetValBranch SET_VAL_MED_EXC(void)
Exclude median element (rounding downwards)
void(* SetVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, SetVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for set variables.
bool(* SetBranchFilter)(const Space &home, SetVar x, int i)
Branch filter function type for set variables.
Include median element (rounding downwards)
Select
Which value selection.
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Which value to select for assignment.
Gecode toplevel namespace
Argument array for variables.
void wait(Home home, FloatVar x, void(*c)(Space &home))
Execute c when x becomes assigned.
SetVarBranch SET_VAR_ACTIVITY_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest activity divided by domain size with decay factor d. ...
SetAssign SET_ASSIGN_RND_INC(Rnd r)
Include random element.
BrancherHandle branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Which variable to select for branching.
Select s
Which variable to select.
SetVarBranch SET_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest minimum unknown element.
Class for activity management.
Select s
Which value to select.
SetValBranch SET_VAL_RND_INC(Rnd r)
Include random element.
Home class for posting propagators
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
SetVarArgs(const std::vector< SetVar > &a)
Initialize from vector a.
void notMin(Home home, SetVar s, IntVar x)
Post propagator that propagates that x is not the minimal element of s.
SetVarBranch SET_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
SetVarBranch SET_VAR_MERIT_MIN(SetBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
With smallest accumulated failure count.
#define GECODE_SET_EXPORT
Iterator for the values in the least upper bound of a set variable.
SetValBranch SET_VAL(SetBranchVal v, SetBranchCommit c)
Select value as defined by the value function v and commit function c.
Exclude smallest element.
double(* BranchTbl)(const Space &home, double w, double b)
Tie-break limit function.