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>
506 SetVarArgs(InputIterator first, InputIterator last);
515 int lubMin,
int lubMax,
516 unsigned int minCard = 0,
526 int lubMin,
int lubMax,
527 unsigned int minCard = 0,
536 SetVarArgs(
Space& home,
int n,
int glbMin,
int glbMax,
538 unsigned int minCard = 0,
547 SetVarArgs(
Space& home,
int n,
549 unsigned int minCard = 0,
589 SetVarArray(
Space& home,
int n,
int glbMin,
int glbMax,
int lubMin,
int lubMax,
590 unsigned int minCard = 0,
599 SetVarArray(
Space& home,
int n,
const IntSet& glb,
int lubMin,
int lubMax,
600 unsigned int minCard = 0,
609 SetVarArray(
Space& home,
int n,
int glbMin,
int glbMax,
const IntSet& lub,
610 unsigned int minCard = 0,
619 SetVarArray(
Space& home,
int n,
621 unsigned int minCard = 0,
1277 SEL_ACTIVITY_SIZE_MAX
1298 Select select(
void)
const;
1406 Select select(
void)
const;
1476 Select select(
void)
const;
1649 Iter::Ranges::RangeList> {
1666 Set::LubRanges<Set::SetView> > {
1725 virtual void init(
const Space& home,
const SetTraceRecorder&
t);
1727 virtual void prune(
const Space& home,
const SetTraceRecorder&
t,
1730 virtual void fix(
const Space& home,
const SetTraceRecorder&
t);
1732 virtual void done(
const Space& home,
const SetTraceRecorder&
t);
1746 SetTracer&
t = StdSetTracer::def);
1754 SetTracer&
t = StdSetTracer::def);
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.
Tracer< Set::SetView > SetTracer
Tracer for set variables.
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.
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
With smallest accumulated failure count divided by domain size.
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
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.
Standard set variable tracer.
Random (uniform, for tie breaking)
Range iterator for range lists
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.
Iterator over new glb Set::GlbRanges< Set::SetView > n
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)
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
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.
Iterator over old lub Iter::Ranges::RangeList o
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
TraceRecorder< Set::SetView > SetTraceRecorder
TraceRecorder for set variables.
Gecode::FloatVal c(-8, 8)
void 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.
SetAssign SET_ASSIGN_MAX_EXC(void)
Exclude largest element.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
int p
Number of positive literals for node type.
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)
Base-class for branchers.
Class for AFC (accumulated failure count) management.
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
int n
Number of negative literals for node type.
A reference-counted pointer to a SymmetryObject.
union Gecode::@554::NNF::@60 u
Union depending on nodetype t.
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.
Propagator for recording trace information.
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(* SetVarValPrint)(const Space &home, const Brancher &b, unsigned int a, SetVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for set variables.
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.
SetValBranch SET_VAL_MAX_INC(void)
Include largest element.
SetVarBranch SET_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest maximum unknown element.
Output stream to use std::ostream & os
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.
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.
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.
Trace delta information for set variables.
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.
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
SetVarBranch SET_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Select
Which value selection.
Variable branching information.
Node * x
Pointer to corresponding Boolean expression node.
Generic domain change information to be supplied to advisors.
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.
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
SetAssign SET_ASSIGN_MED_EXC(void)
Exclude median element (rounding downwards)
Iterator for the values in the greatest lower bound of a set variable.
Iterator over new lub Set::LubRanges< Set::SetView > n
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
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)
bool(* SetBranchFilter)(const Space &home, SetVar x, int i)
Branch filter function type for set variables.
Include median element (rounding downwards)
Tracer that process trace information.
Select
Which value selection.
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Lists of ranges (intervals)
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.
Range iterator for computing set difference.
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.
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.
Iterator over old glb Iter::Ranges::RangeList o
Select s
Which value to select.
SetValBranch SET_VAL_RND_INC(Rnd r)
Include random element.
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
Home class for posting propagators
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
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.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
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.