set.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Gabor Szokoli <szokoli@gecode.org>
*
* Copyright:
* Guido Tack, 2004
* Christian Schulte, 2004
* Gabor Szokoli, 2004
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_SET_HH__
#define __GECODE_SET_HH__
#include <gecode/kernel.hh>
#include <gecode/int.hh>
#include <gecode/iter.hh>
#include <functional>
/*
* Configure linking
*
*/
#if !defined(GECODE_STATIC_LIBS) && \
(defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
#ifdef GECODE_BUILD_SET
#define GECODE_SET_EXPORT __declspec( dllexport )
#else
#define GECODE_SET_EXPORT __declspec( dllimport )
#endif
#else
#ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
#define GECODE_SET_EXPORT __attribute__ ((visibility("default")))
#else
#define GECODE_SET_EXPORT
#endif
#endif
// Configure auto-linking
#ifndef GECODE_BUILD_SET
#define GECODE_LIBRARY_NAME "Set"
#include <gecode/support/auto-link.hpp>
#endif
#include <gecode/set/exception.hpp>
namespace Gecode { namespace Set {
namespace Limits {
const int max = (Gecode::Int::Limits::max / 2) - 1;
const int min = -max;
const unsigned int card = max-min+1;
void check(int n, const char* l);
void check(unsigned int n, const char* l);
void check(const IntSet& s, const char* l);
}
}}
#include <gecode/set/limits.hpp>
#include <gecode/set/var-imp.hpp>
namespace Gecode {
namespace Set {
class SetView;
}
class SetVar : public VarImpVar<Set::SetVarImp> {
friend class SetVarArray;
friend class SetVarArgs;
using VarImpVar<Set::SetVarImp>::x;
public:
SetVar(void);
SetVar(const SetVar& y);
SetVar(const Set::SetView& y);
GECODE_SET_EXPORT SetVar(Space& home);
GECODE_SET_EXPORT
SetVar(Space& home,int glbMin,int glbMax,int lubMin,int lubMax,
unsigned int cardMin = 0,
unsigned int cardMax = Set::Limits::card);
GECODE_SET_EXPORT
SetVar(Space& home,const IntSet& glbD,int lubMin,int lubMax,
unsigned int cardMin = 0,
unsigned int cardMax = Set::Limits::card);
GECODE_SET_EXPORT
SetVar(Space& home,int glbMin,int glbMax,const IntSet& lubD,
unsigned int cardMin = 0,
unsigned int cardMax = Set::Limits::card);
GECODE_SET_EXPORT
SetVar(Space& home,const IntSet& glbD,const IntSet& lubD,
unsigned int cardMin = 0,
unsigned int cardMax = Set::Limits::card);
unsigned int glbSize(void) const;
unsigned int lubSize(void) const;
unsigned int unknownSize(void) const;
unsigned int cardMin(void) const;
unsigned int cardMax(void) const;
int lubMin(void) const;
int lubMax(void) const;
int glbMin(void) const;
int glbMax(void) const;
bool contains(int i) const;
bool notContains(int i) const;
};
class SetVarGlbRanges {
private:
Set::GlbRanges<Set::SetVarImp*> iter;
public:
SetVarGlbRanges(void);
SetVarGlbRanges(const SetVar& x);
bool operator ()(void) const;
void operator ++(void);
int min(void) const;
int max(void) const;
unsigned int width(void) const;
};
class SetVarLubRanges {
private:
Set::LubRanges<Set::SetVarImp*> iter;
public:
SetVarLubRanges(void);
SetVarLubRanges(const SetVar& x);
bool operator ()(void) const;
void operator ++(void);
int min(void) const;
int max(void) const;
unsigned int width(void) const;
};
class SetVarUnknownRanges {
private:
Set::UnknownRanges<Set::SetVarImp*> iter;
public:
SetVarUnknownRanges(void);
SetVarUnknownRanges(const SetVar& x);
bool operator ()(void) const;
void operator ++(void);
int min(void) const;
int max(void) const;
unsigned int width(void) const;
};
class SetVarGlbValues {
private:
Iter::Ranges::ToValues<SetVarGlbRanges> iter;
public:
SetVarGlbValues(void);
SetVarGlbValues(const SetVar& x);
bool operator ()(void) const;
void operator ++(void);
int val(void) const;
};
class SetVarLubValues {
private:
Iter::Ranges::ToValues<SetVarLubRanges> iter;
public:
SetVarLubValues(void);
SetVarLubValues(const SetVar& x);
bool operator ()(void) const;
void operator ++(void);
int val(void) const;
};
class SetVarUnknownValues {
private:
Iter::Ranges::ToValues<SetVarUnknownRanges> iter;
public:
SetVarUnknownValues(void);
SetVarUnknownValues(const SetVar& x);
bool operator ()(void) const;
void operator ++(void);
int val(void) const;
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const SetVar& x);
}
#include <gecode/set/view.hpp>
namespace Gecode {
}
#include <gecode/set/array-traits.hpp>
namespace Gecode {
class SetVarArgs : public VarArgArray<SetVar> {
public:
SetVarArgs(void);
explicit SetVarArgs(int n);
SetVarArgs(const SetVarArgs& a);
SetVarArgs(const VarArray<SetVar>& a);
SetVarArgs(const std::vector<SetVar>& a);
SetVarArgs(std::initializer_list<SetVar> a);
template<class InputIterator>
SetVarArgs(InputIterator first, InputIterator last);
GECODE_SET_EXPORT
SetVarArgs(Space& home,int n,int glbMin,int glbMax,
int lubMin,int lubMax,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
GECODE_SET_EXPORT
SetVarArgs(Space& home,int n,const IntSet& glb,
int lubMin, int lubMax,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
GECODE_SET_EXPORT
SetVarArgs(Space& home,int n,int glbMin,int glbMax,
const IntSet& lub,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
GECODE_SET_EXPORT
SetVarArgs(Space& home,int n,
const IntSet& glb,const IntSet& lub,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
};
class SetVarArray : public VarArray<SetVar> {
public:
SetVarArray(void);
SetVarArray(const SetVarArray&);
SetVarArray(Space& home, const SetVarArgs&);
GECODE_SET_EXPORT SetVarArray(Space& home, int n);
GECODE_SET_EXPORT
SetVarArray(Space& home,int n,int glbMin,int glbMax,int lubMin,int lubMax,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
GECODE_SET_EXPORT
SetVarArray(Space& home,int n,const IntSet& glb, int lubMin, int lubMax,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
GECODE_SET_EXPORT
SetVarArray(Space& home,int n,int glbMin,int glbMax,const IntSet& lub,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
GECODE_SET_EXPORT
SetVarArray(Space& home,int n,
const IntSet& glb,const IntSet& lub,
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
};
}
#include <gecode/set/array.hpp>
namespace Gecode {
enum SetRelType {
SRT_EQ,
SRT_NQ,
SRT_SUB,
SRT_SUP,
SRT_DISJ,
SRT_CMPL,
SRT_LQ,
SRT_LE,
SRT_GQ,
SRT_GR
};
enum SetOpType {
SOT_UNION,
SOT_DUNION,
SOT_INTER,
SOT_MINUS
};
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetRelType r, int i);
GECODE_SET_EXPORT void
dom(Home home, const SetVarArgs& x, SetRelType r, int i);
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetRelType r, int i, int j);
GECODE_SET_EXPORT void
dom(Home home, const SetVarArgs& x, SetRelType r, int i, int j);
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetRelType r, const IntSet& s);
GECODE_SET_EXPORT void
dom(Home home, const SetVarArgs& x, SetRelType r, const IntSet& s);
GECODE_SET_EXPORT void
cardinality(Home home, SetVar x, unsigned int i, unsigned int j);
GECODE_SET_EXPORT void
cardinality(Home home, const SetVarArgs& x, unsigned int i, unsigned int j);
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetRelType rt, int i, Reify r);
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetRelType rt, int i, int j, Reify r);
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetRelType rt, const IntSet& s, Reify r);
GECODE_SET_EXPORT void
dom(Home home, SetVar x, SetVar d);
GECODE_SET_EXPORT void
dom(Home home, const SetVarArgs& x, const SetVarArgs& d);
GECODE_SET_EXPORT void
rel(Home home, SetVar x, SetRelType r, SetVar y);
GECODE_SET_EXPORT void
rel(Home home, SetVar x, SetRelType rt, SetVar y, Reify r);
GECODE_SET_EXPORT void
rel(Home home, SetVar s, SetRelType r, IntVar x);
GECODE_SET_EXPORT void
rel(Home home, IntVar x, SetRelType r, SetVar s);
GECODE_SET_EXPORT void
rel(Home home, SetVar s, SetRelType rt, IntVar x, Reify r);
GECODE_SET_EXPORT void
rel(Home home, IntVar x, SetRelType rt, SetVar s, Reify r);
GECODE_SET_EXPORT void
rel(Home home, SetVar s, IntRelType rt, IntVar x);
void
rel(Home home, IntVar x, IntRelType rt, SetVar s);
GECODE_SET_EXPORT void
rel(Home home, SetVar s, IntRelType rt, IntVar x, Reify r);
void
rel(Home home, IntVar x, IntRelType rt, SetVar s, Reify r);
}
#include <gecode/set/int.hpp>
namespace Gecode {
GECODE_SET_EXPORT void
rel(Home home, SetVar x, SetOpType op, SetVar y, SetRelType r, SetVar z);
GECODE_SET_EXPORT void
rel(Home home, SetOpType op, const SetVarArgs& x, SetVar y);
GECODE_SET_EXPORT void
rel(Home home, SetOpType op, const SetVarArgs& x, const IntSet& z, SetVar y);
GECODE_SET_EXPORT void
rel(Home home, SetOpType op, const IntVarArgs& x, const IntSet& z, SetVar y);
GECODE_SET_EXPORT void
rel(Home home, SetOpType op, const IntVarArgs& x, SetVar y);
GECODE_SET_EXPORT void
rel(Home home, const IntSet& x, SetOpType op, SetVar y,
SetRelType r, SetVar z);
GECODE_SET_EXPORT void
rel(Home home, SetVar x, SetOpType op, const IntSet& y,
SetRelType r, SetVar z);
GECODE_SET_EXPORT void
rel(Home home, SetVar x, SetOpType op, SetVar y,
SetRelType r, const IntSet& z);
GECODE_SET_EXPORT void
rel(Home home, const IntSet& x, SetOpType op, SetVar y, SetRelType r,
const IntSet& z);
GECODE_SET_EXPORT void
rel(Home home, SetVar x, SetOpType op, const IntSet& y, SetRelType r,
const IntSet& z);
GECODE_SET_EXPORT void
ite(Home home, BoolVar b, SetVar x, SetVar y, SetVar z);
GECODE_SET_EXPORT void
convex(Home home, SetVar x);
GECODE_SET_EXPORT void
convex(Home home, SetVar x, SetVar y);
GECODE_SET_EXPORT void
sequence(Home home, const SetVarArgs& x);
GECODE_SET_EXPORT void
sequence(Home home, const SetVarArgs& y, SetVar x);
GECODE_SET_EXPORT void
atmostOne(Home home, const SetVarArgs& x, unsigned int c);
GECODE_SET_EXPORT void
min(Home home, SetVar s, IntVar x);
GECODE_SET_EXPORT void
notMin(Home home, SetVar s, IntVar x);
GECODE_SET_EXPORT void
min(Home home, SetVar s, IntVar x, Reify r);
GECODE_SET_EXPORT void
max(Home home, SetVar s, IntVar x);
GECODE_SET_EXPORT void
notMax(Home home, SetVar s, IntVar x);
GECODE_SET_EXPORT void
max(Home home, SetVar s, IntVar x, Reify r);
GECODE_SET_EXPORT void
cardinality(Home home, SetVar s, IntVar x);
GECODE_SET_EXPORT void
cardinality(Home home, SetVar s, IntVar x, Reify r);
GECODE_SET_EXPORT void
weights(Home home, IntSharedArray elements, IntSharedArray weights,
SetVar x, IntVar y);
GECODE_SET_EXPORT void
channel(Home home, const IntVarArgs& x,const SetVarArgs& y);
GECODE_SET_EXPORT void
channelSorted(Home home, const IntVarArgs& x, SetVar y);
GECODE_SET_EXPORT void
channel(Home home, const BoolVarArgs& x, SetVar y);
GECODE_SET_EXPORT void
channel(Home home, const SetVarArgs& x, const SetVarArgs& y);
GECODE_SET_EXPORT void
precede(Home home, const SetVarArgs& x, int s, int t);
GECODE_SET_EXPORT void
precede(Home home, const SetVarArgs& x, const IntArgs& c);
GECODE_SET_EXPORT void
element(Home home, SetOpType op, const SetVarArgs& x, SetVar y, SetVar z,
const IntSet& u = IntSet(Set::Limits::min,Set::Limits::max));
GECODE_SET_EXPORT void
element(Home home, SetOpType op, const IntVarArgs& x, SetVar y, SetVar z,
const IntSet& u = IntSet(Set::Limits::min,Set::Limits::max));
GECODE_SET_EXPORT void
element(Home home, SetOpType op, const IntSetArgs& x, SetVar y, SetVar z,
const IntSet& u = IntSet(Set::Limits::min,Set::Limits::max));
GECODE_SET_EXPORT void
element(Home home, SetOpType op, const IntArgs& x, SetVar y, SetVar z,
const IntSet& u = IntSet(Set::Limits::min,Set::Limits::max));
GECODE_SET_EXPORT void
element(Home home, const SetVarArgs& x, IntVar y, SetVar z);
GECODE_SET_EXPORT void
element(Home home, const IntSetArgs& s, IntVar y, SetVar z);
GECODE_SET_EXPORT void
element(Home home, const IntSetArgs& a,
IntVar x, int w, IntVar y, int h, SetVar z);
GECODE_SET_EXPORT void
element(Home home, const SetVarArgs& a,
IntVar x, int w, IntVar y, int h, SetVar z);
GECODE_SET_EXPORT void
wait(Home home, SetVar x, std::function<void(Space& home)> c);
GECODE_SET_EXPORT void
wait(Home home, const SetVarArgs& x, std::function<void(Space& home)> c);
}
namespace Gecode {
typedef std::function<bool(const Space& home, SetVar x, int i)>
SetBranchFilter;
typedef std::function<double(const Space& home, SetVar x, int i)>
SetBranchMerit;
typedef std::function<int(const Space& home, SetVar x, int i)>
SetBranchVal;
typedef std::function<void(Space& home, unsigned int a,
SetVar x, int i, int n)>
SetBranchCommit;
}
#include <gecode/set/branch/traits.hpp>
namespace Gecode {
class SetAFC : public AFC {
public:
SetAFC(void);
SetAFC(const SetAFC& a);
SetAFC& operator =(const SetAFC& a);
SetAFC(Home home, const SetVarArgs& x, double d=1.0, bool share=true);
void init(Home home, const SetVarArgs& x, double d=1.0, bool share=true);
};
}
#include <gecode/set/branch/afc.hpp>
namespace Gecode {
class SetAction : public Action {
public:
SetAction(void);
SetAction(const SetAction& a);
SetAction& operator =(const SetAction& a);
GECODE_SET_EXPORT
SetAction(Home home, const SetVarArgs& x, double d=1.0,
SetBranchMerit bm=nullptr);
GECODE_SET_EXPORT void
init(Home home, const SetVarArgs& x, double d=1.0,
SetBranchMerit bm=nullptr);
};
}
#include <gecode/set/branch/action.hpp>
namespace Gecode {
class SetCHB : public CHB {
public:
SetCHB(void);
SetCHB(const SetCHB& chb);
SetCHB& operator =(const SetCHB& chb);
GECODE_SET_EXPORT
SetCHB(Home home, const SetVarArgs& x, SetBranchMerit bm=nullptr);
GECODE_SET_EXPORT void
init(Home home, const SetVarArgs& x, SetBranchMerit bm=nullptr);
};
}
#include <gecode/set/branch/chb.hpp>
namespace Gecode {
typedef std::function<void(const Space &home, const Brancher& b,
unsigned int a,
SetVar x, int i, const int& n,
std::ostream& o)>
SetVarValPrint;
}
namespace Gecode {
class SetVarBranch : public VarBranch<SetVar> {
public:
enum Select {
SEL_NONE = 0,
SEL_RND,
SEL_MERIT_MIN,
SEL_MERIT_MAX,
SEL_DEGREE_MIN,
SEL_DEGREE_MAX,
SEL_AFC_MIN,
SEL_AFC_MAX,
SEL_ACTION_MIN,
SEL_ACTION_MAX,
SEL_CHB_MIN,
SEL_CHB_MAX,
SEL_MIN_MIN,
SEL_MIN_MAX,
SEL_MAX_MIN,
SEL_MAX_MAX,
SEL_SIZE_MIN,
SEL_SIZE_MAX,
SEL_DEGREE_SIZE_MIN,
SEL_DEGREE_SIZE_MAX,
SEL_AFC_SIZE_MIN,
SEL_AFC_SIZE_MAX,
SEL_ACTION_SIZE_MIN,
SEL_ACTION_SIZE_MAX,
SEL_CHB_SIZE_MIN,
SEL_CHB_SIZE_MAX
};
protected:
Select s;
public:
SetVarBranch(void);
SetVarBranch(Rnd r);
SetVarBranch(Select s, BranchTbl t);
SetVarBranch(Select s, double d, BranchTbl t);
SetVarBranch(Select s, SetAFC a, BranchTbl t);
SetVarBranch(Select s, SetAction a, BranchTbl t);
SetVarBranch(Select s, SetCHB c, BranchTbl t);
SetVarBranch(Select s, SetBranchMerit mf, BranchTbl t);
Select select(void) const;
void expand(Home home, const SetVarArgs& x);
};
SetVarBranch SET_VAR_NONE(void);
SetVarBranch SET_VAR_RND(Rnd r);
SetVarBranch SET_VAR_MERIT_MIN(SetBranchMerit bm, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_MERIT_MAX(SetBranchMerit bm, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_DEGREE_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_DEGREE_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_MIN(SetAFC a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_MAX(SetAFC a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_MIN(SetAction a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_MAX(SetAction a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_MIN(SetCHB c, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_MAX(SetCHB c, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_MIN_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_MIN_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_MAX_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_MAX_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_SIZE_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_SIZE_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_SIZE_MIN(SetAFC a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_AFC_SIZE_MAX(SetAFC a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_SIZE_MIN(SetAction a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_ACTION_SIZE_MAX(SetAction a, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_SIZE_MIN(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_SIZE_MIN(SetCHB c, BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_SIZE_MAX(BranchTbl tbl=nullptr);
SetVarBranch SET_VAR_CHB_SIZE_MAX(SetCHB c, BranchTbl tbl=nullptr);
}
#include <gecode/set/branch/var.hpp>
namespace Gecode {
class SetValBranch : public ValBranch<SetVar> {
public:
enum Select {
SEL_MIN_INC,
SEL_MIN_EXC,
SEL_MED_INC,
SEL_MED_EXC,
SEL_MAX_INC,
SEL_MAX_EXC,
SEL_RND_INC,
SEL_RND_EXC,
SEL_VAL_COMMIT
};
protected:
Select s;
public:
SetValBranch(Select s = SEL_MIN_INC);
SetValBranch(Select s, Rnd r);
SetValBranch(SetBranchVal v, SetBranchCommit c);
Select select(void) const;
};
SetValBranch SET_VAL_MIN_INC(void);
SetValBranch SET_VAL_MIN_EXC(void);
SetValBranch SET_VAL_MED_INC(void);
SetValBranch SET_VAL_MED_EXC(void);
SetValBranch SET_VAL_MAX_INC(void);
SetValBranch SET_VAL_MAX_EXC(void);
SetValBranch SET_VAL_RND_INC(Rnd r);
SetValBranch SET_VAL_RND_EXC(Rnd r);
SetValBranch SET_VAL(SetBranchVal v, SetBranchCommit c=nullptr);
}
#include <gecode/set/branch/val.hpp>
namespace Gecode {
class SetAssign : public ValBranch<SetVar> {
public:
enum Select {
SEL_MIN_INC,
SEL_MIN_EXC,
SEL_MED_INC,
SEL_MED_EXC,
SEL_MAX_INC,
SEL_MAX_EXC,
SEL_RND_INC,
SEL_RND_EXC,
SEL_VAL_COMMIT
};
protected:
Select s;
public:
SetAssign(Select s = SEL_MIN_INC);
SetAssign(Select s, Rnd r);
SetAssign(SetBranchVal v, SetBranchCommit c);
Select select(void) const;
};
SetAssign SET_ASSIGN_MIN_INC(void);
SetAssign SET_ASSIGN_MIN_EXC(void);
SetAssign SET_ASSIGN_MED_INC(void);
SetAssign SET_ASSIGN_MED_EXC(void);
SetAssign SET_ASSIGN_MAX_INC(void);
SetAssign SET_ASSIGN_MAX_EXC(void);
SetAssign SET_ASSIGN_RND_INC(Rnd r);
SetAssign SET_ASSIGN_RND_EXC(Rnd r);
SetAssign SET_ASSIGN(SetBranchVal v, SetBranchCommit c=nullptr);
}
#include <gecode/set/branch/assign.hpp>
namespace Gecode {
GECODE_SET_EXPORT void
branch(Home home, const SetVarArgs& x,
SetVarBranch vars, SetValBranch vals,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
GECODE_SET_EXPORT void
branch(Home home, const SetVarArgs& x,
TieBreak<SetVarBranch> vars, SetValBranch vals,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
GECODE_SET_EXPORT void
branch(Home home, SetVar x, SetValBranch vals,
SetVarValPrint vvp=nullptr);
GECODE_SET_EXPORT void
assign(Home home, const SetVarArgs& x,
SetVarBranch vars, SetAssign vals,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
GECODE_SET_EXPORT void
assign(Home home, const SetVarArgs& x,
TieBreak<SetVarBranch> vars, SetAssign vals,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
GECODE_SET_EXPORT void
assign(Home home, SetVar x, SetAssign vals,
SetVarValPrint vvp=nullptr);
}
namespace Gecode {
void
branch(Home home, const SetVarArgs& x,
SetValBranch vals,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
void
assign(Home home, const SetVarArgs& x,
SetAssign vals,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
}
#include <gecode/set/branch.hpp>
// LDSB-related declarations.
namespace Gecode {
GECODE_SET_EXPORT SymmetryHandle VariableSymmetry(const SetVarArgs& x);
GECODE_SET_EXPORT
SymmetryHandle VariableSequenceSymmetry(const SetVarArgs& x, int ss);
GECODE_SET_EXPORT void
branch(Home home, const SetVarArgs& x,
SetVarBranch vars, SetValBranch vals,
const Symmetries& syms,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
GECODE_SET_EXPORT void
branch(Home home, const SetVarArgs& x,
TieBreak<SetVarBranch> vars, SetValBranch vals,
const Symmetries& syms,
SetBranchFilter bf=nullptr,
SetVarValPrint vvp=nullptr);
}
namespace Gecode {
/*
* \brief Relaxed assignment of variables in \a x from values in \a sx
*
* The variables in \a x are assigned values from the assigned variables
* in the solution \a sx with a relaxation probability \a p. That is,
* if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
* assigned a value from \a sx.
*
* The random numbers are generated from the generator \a r. At least
* one variable will not be assigned: in case the relaxation attempt
* would suggest that all variables should be assigned, a single
* variable will be selected randomly to remain unassigned.
*
* Throws an exception of type Set::ArgumentSizeMismatch, if \a x and
* \a sx are of different size.
*
* Throws an exception of type Set::OutOfLimits, if \a p is not between
* \a 0.0 and \a 1.0.
*
* \ingroup TaskModeSet
*/
GECODE_SET_EXPORT void
relax(Home home, const SetVarArgs& x, const SetVarArgs& sx,
Rnd r, double p);
}
#include <gecode/set/trace/trace-view.hpp>
namespace Gecode {
class SetTraceDelta {
protected:
public:
class Glb
: public Iter::Ranges::Diff<Set::GlbRanges<Set::SetView>,
Iter::Ranges::RangeList> {
protected:
Iter::Ranges::RangeList o;
Set::GlbRanges<Set::SetView> n;
public:
Glb(RangeList* o, Set::SetView n);
};
Glb _glb;
class Lub
: public Iter::Ranges::Diff<Iter::Ranges::RangeList,
Set::LubRanges<Set::SetView> > {
protected:
Iter::Ranges::RangeList o;
Set::LubRanges<Set::SetView> n;
public:
Lub(RangeList* o, Set::SetView n);
};
Lub _lub;
SetTraceDelta(Set::SetTraceView o, Set::SetView n, const Delta& d);
Glb& glb(void);
Lub& lub(void);
};
}
#include <gecode/set/trace/delta.hpp>
#include <gecode/set/trace/traits.hpp>
namespace Gecode {
typedef ViewTracer<Set::SetView> SetTracer;
typedef ViewTraceRecorder<Set::SetView> SetTraceRecorder;
class GECODE_SET_EXPORT StdSetTracer : public SetTracer {
protected:
std::ostream& os;
public:
StdSetTracer(std::ostream& os0 = std::cerr);
virtual void init(const Space& home, const SetTraceRecorder& t);
virtual void prune(const Space& home, const SetTraceRecorder& t,
const ViewTraceInfo& vti, int i, SetTraceDelta& d);
virtual void fix(const Space& home, const SetTraceRecorder& t);
virtual void fail(const Space& home, const SetTraceRecorder& t);
virtual void done(const Space& home, const SetTraceRecorder& t);
static StdSetTracer def;
};
GECODE_SET_EXPORT void
trace(Home home, const SetVarArgs& x,
TraceFilter tf,
int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
SetTracer& t = StdSetTracer::def);
void
trace(Home home, const SetVarArgs& x,
int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
SetTracer& t = StdSetTracer::def);
}
#include <gecode/set/trace.hpp>
#endif
// IFDEF: GECODE_HAS_SET_VARS
// STATISTICS: set-post
auto-link.hpp
Gecode::AFC::AFC
AFC(void)
Construct as not yet intialized.
Definition afc.hpp:119
Gecode::Action::Action
Action(void)
Construct as not yet intialized.
Definition action.hpp:323
Gecode::ArgArrayBase< SetVar >::a
SetVar * a
Definition array.hpp:544
Gecode::ArgArrayBase< SetVar >::n
int n
Definition array.hpp:540
Gecode::BoolVarArgs
Passing Boolean variables.
Definition int.hh:712
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::CHB::CHB
CHB(void)
Construct as not yet intialized.
Definition chb.hpp:346
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::IntArgs
Passing integer arguments.
Definition int.hh:628
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::IntVarArgs
Passing integer variables.
Definition int.hh:656
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::Iter::Ranges::Diff
Range iterator for computing set difference.
Definition ranges-diff.hpp:43
Gecode::Iter::Ranges::RangeList
Range iterator for range lists
Definition ranges-rangelist.hpp:44
Gecode::Iter::Ranges::ToValues
Value iterator from range iterator.
Definition ranges-values.hpp:42
Gecode::RangeList
Lists of ranges (intervals).
Definition range-list.hpp:49
Gecode::Reify
Reification specification.
Definition int.hh:876
Gecode::Rnd
Random number generator.
Definition rnd.hpp:42
Gecode::SetAFC
Recording AFC information for set variables.
Definition set.hh:1136
Gecode::SetAFC::operator=
SetAFC & operator=(const SetAFC &a)
Assignment operator.
Definition afc.hpp:44
Gecode::SetAFC::init
void init(Home home, const SetVarArgs &x, double d=1.0, bool share=true)
Initialize for set variables x with decay factor d.
Definition afc.hpp:54
Gecode::SetAFC::SetAFC
SetAFC(void)
Construct as not yet initialized.
Definition afc.hpp:37
Gecode::SetAction
Recording actions for set variables.
Definition set.hh:1183
Gecode::SetAction::SetAction
SetAction(void)
Construct as not yet initialized.
Definition action.hpp:37
Gecode::SetAction::operator=
SetAction & operator=(const SetAction &a)
Assignment operator.
Definition action.hpp:44
Gecode::SetAction::init
void init(Home home, const SetVarArgs &x, double d=1.0, SetBranchMerit bm=nullptr)
Initialize for set variables x with decay factor d.
Definition action.cpp:45
Gecode::SetAssign
Which value to select for assignment.
Definition set.hh:1517
Gecode::SetAssign::SetAssign
SetAssign(Select s=SEL_MIN_INC)
Initialize with selection strategy s.
Definition assign.hpp:37
Gecode::SetAssign::s
Select s
Which value to select.
Definition set.hh:1533
Gecode::SetAssign::Select
Select
Which value selection.
Definition set.hh:1520
Gecode::SetAssign::SEL_MED_EXC
@ SEL_MED_EXC
Exclude median element (rounding downwards).
Definition set.hh:1524
Gecode::SetAssign::SEL_MIN_EXC
@ SEL_MIN_EXC
Exclude smallest element.
Definition set.hh:1522
Gecode::SetAssign::SEL_RND_EXC
@ SEL_RND_EXC
Exclude random element.
Definition set.hh:1528
Gecode::SetAssign::SEL_MIN_INC
@ SEL_MIN_INC
Include smallest element.
Definition set.hh:1521
Gecode::SetAssign::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition set.hh:1529
Gecode::SetAssign::SEL_MAX_INC
@ SEL_MAX_INC
Include largest element.
Definition set.hh:1525
Gecode::SetAssign::SEL_MAX_EXC
@ SEL_MAX_EXC
Exclude largest element.
Definition set.hh:1526
Gecode::SetAssign::SEL_MED_INC
@ SEL_MED_INC
Include median element (rounding downwards).
Definition set.hh:1523
Gecode::SetAssign::SEL_RND_INC
@ SEL_RND_INC
Include random element.
Definition set.hh:1527
Gecode::SetAssign::select
Select select(void) const
Return selection strategy.
Definition assign.hpp:49
Gecode::SetCHB
Recording CHB for set variables.
Definition set.hh:1235
Gecode::SetCHB::operator=
SetCHB & operator=(const SetCHB &chb)
Assignment operator.
Definition chb.hpp:44
Gecode::SetCHB::init
void init(Home home, const SetVarArgs &x, SetBranchMerit bm=nullptr)
Initialize for set variables x.
Definition chb.cpp:44
Gecode::SetCHB::SetCHB
SetCHB(void)
Construct as not yet initialized.
Definition chb.hpp:37
Gecode::SetTraceDelta::Glb
Delta for the greatest lower bound.
Definition set.hh:1755
Gecode::SetTraceDelta::Glb::n
Set::GlbRanges< Set::SetView > n
Iterator over new glb.
Definition set.hh:1760
Gecode::SetTraceDelta::Glb::o
Iter::Ranges::RangeList o
Iterator over old glb.
Definition set.hh:1758
Gecode::SetTraceDelta::Glb::Glb
Glb(RangeList *o, Set::SetView n)
Initialize with old glb and new glb.
Definition delta.hpp:37
Gecode::SetTraceDelta::Lub
Delta for the least upper bound.
Definition set.hh:1772
Gecode::SetTraceDelta::Lub::o
Iter::Ranges::RangeList o
Iterator over old lub.
Definition set.hh:1775
Gecode::SetTraceDelta::Lub::Lub
Lub(RangeList *o, Set::SetView n)
Initialize with old lub o and new lub n.
Definition delta.hpp:42
Gecode::SetTraceDelta::Lub::n
Set::LubRanges< Set::SetView > n
Iterator over new lub.
Definition set.hh:1777
Gecode::SetTraceDelta
Trace delta information for set variables.
Definition set.hh:1748
Gecode::SetTraceDelta::_glb
Glb _glb
Definition set.hh:1768
Gecode::SetTraceDelta::glb
Glb & glb(void)
Give access to iterator for delta in greatest lower bound (values that have been included).
Definition delta.hpp:52
Gecode::SetTraceDelta::SetTraceDelta
SetTraceDelta(Set::SetTraceView o, Set::SetView n, const Delta &d)
Initialize with old trace view o, new view n, and delta d.
Definition delta.hpp:48
Gecode::SetTraceDelta::lub
Lub & lub(void)
Give access iterator for delta in leat bound (values that have been removed).
Definition delta.hpp:56
Gecode::SetTraceDelta::_lub
Lub _lub
Definition set.hh:1785
Gecode::SetValBranch
Which values to select for branching first.
Definition set.hh:1447
Gecode::SetValBranch::SetValBranch
SetValBranch(Select s=SEL_MIN_INC)
Initialize with selection strategy s.
Definition val.hpp:37
Gecode::SetValBranch::Select
Select
Which value selection.
Definition set.hh:1450
Gecode::SetValBranch::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition set.hh:1459
Gecode::SetValBranch::SEL_MAX_INC
@ SEL_MAX_INC
Include largest element.
Definition set.hh:1455
Gecode::SetValBranch::SEL_MIN_EXC
@ SEL_MIN_EXC
Exclude smallest element.
Definition set.hh:1452
Gecode::SetValBranch::SEL_RND_EXC
@ SEL_RND_EXC
Exclude random element.
Definition set.hh:1458
Gecode::SetValBranch::SEL_MIN_INC
@ SEL_MIN_INC
Include smallest element.
Definition set.hh:1451
Gecode::SetValBranch::SEL_MAX_EXC
@ SEL_MAX_EXC
Exclude largest element.
Definition set.hh:1456
Gecode::SetValBranch::SEL_MED_EXC
@ SEL_MED_EXC
Exclude median element (rounding downwards).
Definition set.hh:1454
Gecode::SetValBranch::SEL_RND_INC
@ SEL_RND_INC
Include random element.
Definition set.hh:1457
Gecode::SetValBranch::SEL_MED_INC
@ SEL_MED_INC
Include median element (rounding downwards).
Definition set.hh:1453
Gecode::SetValBranch::s
Select s
Which value to select.
Definition set.hh:1463
Gecode::SetValBranch::select
Select select(void) const
Return selection strategy.
Definition val.hpp:49
Gecode::SetVarArgs
Passing set variables.
Definition set.hh:488
Gecode::SetVarArgs::SetVarArgs
SetVarArgs(void)
Allocate empty array.
Definition array.hpp:48
Gecode::SetVarArray::SetVarArray
SetVarArray(void)
Default constructor (array of size 0).
Definition array.hpp:77
Gecode::SetVarBranch
Which variable to select for branching.
Definition set.hh:1296
Gecode::SetVarBranch::expand
void expand(Home home, const SetVarArgs &x)
Expand AFC, action, and CHB.
Definition var.hpp:74
Gecode::SetVarBranch::Select
Select
Which variable selection.
Definition set.hh:1299
Gecode::SetVarBranch::SEL_ACTION_SIZE_MIN
@ SEL_ACTION_SIZE_MIN
With smallest action divided by domain size.
Definition set.hh:1322
Gecode::SetVarBranch::SEL_CHB_MIN
@ SEL_CHB_MIN
With lowest CHB Q-score.
Definition set.hh:1310
Gecode::SetVarBranch::SEL_CHB_MAX
@ SEL_CHB_MAX
With highest CHB Q-score.
Definition set.hh:1311
Gecode::SetVarBranch::SEL_MERIT_MIN
@ SEL_MERIT_MIN
With least merit.
Definition set.hh:1302
Gecode::SetVarBranch::SEL_DEGREE_SIZE_MAX
@ SEL_DEGREE_SIZE_MAX
With largest degree divided by domain size.
Definition set.hh:1319
Gecode::SetVarBranch::SEL_AFC_SIZE_MIN
@ SEL_AFC_SIZE_MIN
With smallest accumulated failure count divided by domain size.
Definition set.hh:1320
Gecode::SetVarBranch::SEL_AFC_MIN
@ SEL_AFC_MIN
With smallest accumulated failure count.
Definition set.hh:1306
Gecode::SetVarBranch::SEL_CHB_SIZE_MAX
@ SEL_CHB_SIZE_MAX
With largest CHB Q-score divided by domain size.
Definition set.hh:1325
Gecode::SetVarBranch::SEL_NONE
@ SEL_NONE
First unassigned.
Definition set.hh:1300
Gecode::SetVarBranch::SEL_ACTION_SIZE_MAX
@ SEL_ACTION_SIZE_MAX
With largest action divided by domain size.
Definition set.hh:1323
Gecode::SetVarBranch::SEL_DEGREE_MAX
@ SEL_DEGREE_MAX
With largest degree.
Definition set.hh:1305
Gecode::SetVarBranch::SEL_AFC_MAX
@ SEL_AFC_MAX
With largest accumulated failure count.
Definition set.hh:1307
Gecode::SetVarBranch::SEL_CHB_SIZE_MIN
@ SEL_CHB_SIZE_MIN
With smallest CHB Q-score divided by domain size.
Definition set.hh:1324
Gecode::SetVarBranch::SEL_MERIT_MAX
@ SEL_MERIT_MAX
With highest merit.
Definition set.hh:1303
Gecode::SetVarBranch::SEL_SIZE_MIN
@ SEL_SIZE_MIN
With smallest unknown set.
Definition set.hh:1316
Gecode::SetVarBranch::SEL_RND
@ SEL_RND
Random (uniform, for tie breaking).
Definition set.hh:1301
Gecode::SetVarBranch::SEL_ACTION_MAX
@ SEL_ACTION_MAX
With highest action.
Definition set.hh:1309
Gecode::SetVarBranch::SEL_AFC_SIZE_MAX
@ SEL_AFC_SIZE_MAX
With largest accumulated failure count divided by domain size.
Definition set.hh:1321
Gecode::SetVarBranch::SEL_ACTION_MIN
@ SEL_ACTION_MIN
With lowest action.
Definition set.hh:1308
Gecode::SetVarBranch::SEL_MIN_MAX
@ SEL_MIN_MAX
With largest minimum unknown element.
Definition set.hh:1313
Gecode::SetVarBranch::SEL_MAX_MAX
@ SEL_MAX_MAX
With largest maximum unknown element.
Definition set.hh:1315
Gecode::SetVarBranch::SEL_MAX_MIN
@ SEL_MAX_MIN
With smallest maximum unknown element.
Definition set.hh:1314
Gecode::SetVarBranch::SEL_DEGREE_SIZE_MIN
@ SEL_DEGREE_SIZE_MIN
With smallest degree divided by domain size.
Definition set.hh:1318
Gecode::SetVarBranch::SEL_MIN_MIN
@ SEL_MIN_MIN
With smallest minimum unknown element.
Definition set.hh:1312
Gecode::SetVarBranch::SEL_DEGREE_MIN
@ SEL_DEGREE_MIN
With smallest degree.
Definition set.hh:1304
Gecode::SetVarBranch::SEL_SIZE_MAX
@ SEL_SIZE_MAX
With largest unknown set.
Definition set.hh:1317
Gecode::SetVarBranch::SetVarBranch
SetVarBranch(void)
Initialize with strategy SEL_NONE.
Definition var.hpp:37
Gecode::SetVarBranch::s
Select s
Which variable to select.
Definition set.hh:1329
Gecode::SetVarBranch::select
Select select(void) const
Return selection strategy.
Definition var.hpp:69
Gecode::SetVarGlbRanges::operator()
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition set.hpp:111
Gecode::SetVarGlbRanges::max
int max(void) const
Return largest value of range.
Definition set.hpp:123
Gecode::SetVarGlbRanges::operator++
void operator++(void)
Move iterator to next range (if possible).
Definition set.hpp:115
Gecode::SetVarGlbRanges::min
int min(void) const
Return smallest value of range.
Definition set.hpp:119
Gecode::SetVarGlbRanges::width
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
Definition set.hpp:127
Gecode::SetVarGlbRanges::SetVarGlbRanges
SetVarGlbRanges(void)
Default constructor.
Definition set.hpp:103
Gecode::SetVarGlbValues::operator()
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition set.hpp:191
Gecode::SetVarGlbValues::val
int val(void) const
Return current value.
Definition set.hpp:201
Gecode::SetVarGlbValues::operator++
void operator++(void)
Move iterator to next value (if possible).
Definition set.hpp:196
Gecode::SetVarGlbValues::SetVarGlbValues
SetVarGlbValues(void)
Default constructor.
Gecode::SetVarLubRanges::operator++
void operator++(void)
Move iterator to next range (if possible).
Definition set.hpp:142
Gecode::SetVarLubRanges::SetVarLubRanges
SetVarLubRanges(void)
Default constructor.
Definition set.hpp:130
Gecode::SetVarLubRanges::width
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
Definition set.hpp:154
Gecode::SetVarLubRanges::max
int max(void) const
Return largest value of range.
Definition set.hpp:150
Gecode::SetVarLubRanges::operator()
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition set.hpp:138
Gecode::SetVarLubRanges::min
int min(void) const
Return smallest value of range.
Definition set.hpp:146
Gecode::SetVarLubValues::operator()
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition set.hpp:212
Gecode::SetVarLubValues::val
int val(void) const
Return current value.
Definition set.hpp:222
Gecode::SetVarLubValues::SetVarLubValues
SetVarLubValues(void)
Default constructor.
Gecode::SetVarLubValues::operator++
void operator++(void)
Move iterator to next value (if possible).
Definition set.hpp:217
Gecode::SetVarUnknownRanges::max
int max(void) const
Return largest value of range.
Definition set.hpp:178
Gecode::SetVarUnknownRanges::operator()
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition set.hpp:166
Gecode::SetVarUnknownRanges::width
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
Definition set.hpp:182
Gecode::SetVarUnknownRanges::operator++
void operator++(void)
Move iterator to next range (if possible).
Definition set.hpp:170
Gecode::SetVarUnknownRanges::min
int min(void) const
Return smallest value of range.
Definition set.hpp:174
Gecode::SetVarUnknownRanges::SetVarUnknownRanges
SetVarUnknownRanges(void)
Default constructor.
Definition set.hpp:157
Gecode::SetVarUnknownValues::val
int val(void) const
Return current value.
Definition set.hpp:243
Gecode::SetVarUnknownValues::operator()
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition set.hpp:233
Gecode::SetVarUnknownValues::SetVarUnknownValues
SetVarUnknownValues(void)
Default constructor.
Gecode::SetVarUnknownValues::operator++
void operator++(void)
Move iterator to next value (if possible).
Definition set.hpp:238
Gecode::SetVar
Set variables
Definition set.hh:127
Gecode::SetVar::cardMax
unsigned int cardMax(void) const
Return cardinality maximum.
Definition set.hpp:81
Gecode::SetVar::SetVar
SetVar(void)
Default constructor.
Definition set.hpp:46
Gecode::SetVar::notContains
bool notContains(int i) const
Test whether i is not in the least upper bound.
Definition set.hpp:75
Gecode::SetVar::SetVarArgs
friend class SetVarArgs
Definition set.hh:129
Gecode::SetVar::lubMin
int lubMin(void) const
Return minimum element of least upper bound.
Definition set.hpp:84
Gecode::SetVar::SetVarArray
friend class SetVarArray
Definition set.hh:128
Gecode::SetVar::lubSize
unsigned int lubSize(void) const
Return number of elements in the least upper bound.
Definition set.hpp:66
Gecode::SetVar::lubMax
int lubMax(void) const
Return maximum element of least upper bound.
Definition set.hpp:87
Gecode::SetVar::glbSize
unsigned int glbSize(void) const
Return number of elements in the greatest lower bound.
Definition set.hpp:63
Gecode::SetVar::glbMin
int glbMin(void) const
Return minimum element of greatest lower bound.
Definition set.hpp:90
Gecode::SetVar::unknownSize
unsigned int unknownSize(void) const
Return number of unknown elements (elements in lub but not in glb).
Definition set.hpp:69
Gecode::SetVar::glbMax
int glbMax(void) const
Return maximum of greatest lower bound.
Definition set.hpp:93
Gecode::SetVar::contains
bool contains(int i) const
Test whether i is in greatest lower bound.
Definition set.hpp:72
Gecode::SetVar::cardMin
unsigned int cardMin(void) const
Return cardinality minimum.
Definition set.hpp:78
Gecode::Set::GlbRanges
Range iterator for the greatest lower bound.
Definition var-imp.hpp:359
Gecode::Set::LubRanges
Range iterator for the least upper bound.
Definition var-imp.hpp:317
Gecode::Set::SetTraceView
Duplicate of a set view.
Definition trace-view.hpp:37
Gecode::Set::SetVarImp
Finite integer set variable implementation.
Definition var-imp.hpp:430
Gecode::Set::SetView
Set view for set variables
Definition view.hpp:56
Gecode::Set::UnknownRanges
Range iterator for the unknown set.
Definition var-imp.hpp:402
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::StdSetTracer::done
virtual void done(const Space &home, const SetTraceRecorder &t)
Print that trace recorder is done.
Definition tracer.cpp:121
Gecode::StdSetTracer::init
virtual void init(const Space &home, const SetTraceRecorder &t)
Print init information.
Definition tracer.cpp:43
Gecode::StdSetTracer::StdSetTracer
StdSetTracer(std::ostream &os0=std::cerr)
Initialize with output stream os0.
Definition tracer.cpp:39
Gecode::StdSetTracer::fail
virtual void fail(const Space &home, const SetTraceRecorder &t)
Print failure information.
Definition tracer.cpp:103
Gecode::StdSetTracer::prune
virtual void prune(const Space &home, const SetTraceRecorder &t, const ViewTraceInfo &vti, int i, SetTraceDelta &d)
Print prune information.
Definition tracer.cpp:52
Gecode::StdSetTracer::fix
virtual void fix(const Space &home, const SetTraceRecorder &t)
Print fixpoint information.
Definition tracer.cpp:85
Gecode::StdSetTracer::os
std::ostream & os
Output stream to use.
Definition set.hh:1826
Gecode::StdSetTracer::def
static StdSetTracer def
Default tracer (printing to std::cerr).
Definition set.hh:1842
Gecode::Symmetries
Collection of symmetries.
Definition int.hh:5292
Gecode::SymmetryHandle
A reference-counted pointer to a SymmetryObject.
Definition int.hh:5255
Gecode::TieBreak
Combine variable selection criteria for tie-breaking.
Definition tiebreak.hpp:38
Gecode::TraceFilter
Trace filters.
Definition filter.hpp:133
Gecode::ValBranch< SetVar >::ValBranch
ValBranch(void)
Definition val.hpp:72
Gecode::ValBranch< SetVar >::r
Rnd r
Definition val.hpp:49
Gecode::VarArgArray< SetVar >::VarArgArray
VarArgArray(void)
Definition array.hpp:1839
Gecode::VarArray
Variable arrays
Definition array.hpp:112
Gecode::VarArray< SetVar >::n
int n
Definition array.hpp:115
Gecode::VarArray< SetVar >::VarArray
VarArray(void)
Definition array.hpp:901
Gecode::VarBranch< SetVar >::VarBranch
VarBranch(void)
Definition var.hpp:116
Gecode::VarImpVar< Set::SetVarImp >::x
Set::SetVarImp * x
Definition var.hpp:50
Gecode::VarImpVar< Set::SetVarImp >::VarImpVar
VarImpVar(void)
Definition var.hpp:88
Gecode::ViewTraceInfo
View trace information.
Definition core.hpp:908
Gecode::ViewTraceRecorder
Propagator for recording view trace information.
Definition recorder.hpp:60
Gecode::ViewTracer
Tracer that process view trace information.
Definition tracer.hpp:51
int.hh
int.hpp
GECODE_SET_EXPORT
#define GECODE_SET_EXPORT
Definition set.hh:67
Gecode::trace
GECODE_FLOAT_EXPORT void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te=(TE_INIT|TE_PRUNE|TE_FIX|TE_FAIL|TE_DONE), FloatTracer &t=StdFloatTracer::def)
Create a tracer for float variables.
Definition trace.cpp:39
Gecode::BranchTbl
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition var.hpp:48
Gecode::assign
void assign(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatAssign vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Assign all x with variable selection vars and value selection vals.
Definition branch.cpp:111
Gecode::branch
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Branch over x with variable selection vars and value selection vals.
Definition branch.cpp:39
Gecode::rel
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
Gecode::ite
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition bool.cpp:39
Gecode::precede
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel=IPL_DEF)
Post propagator that s precedes t in x.
Definition precede.cpp:43
Gecode::IntRelType
IntRelType
Relation types for integers.
Definition int.hh:925
Gecode::SetBranchFilter
std::function< bool(const Space &home, SetVar x, int i)> SetBranchFilter
Branch filter function type for set variables.
Definition set.hh:1083
Gecode::SetBranchMerit
std::function< double(const Space &home, SetVar x, int i)> SetBranchMerit
Branch merit function type for set variables.
Definition set.hh:1095
Gecode::SetBranchVal
std::function< int(const Space &home, SetVar x, int i)> SetBranchVal
Branch value function type for set variables.
Definition set.hh:1108
Gecode::SetBranchCommit
std::function< void(Space &home, unsigned int a, SetVar x, int i, int n)> SetBranchCommit
Branch commit function type for set variables.
Definition set.hh:1123
Gecode::weights
void weights(Home home, IntSharedArray elements, IntSharedArray weights, SetVar x, IntVar y)
Post propagator for .
Definition int.cpp:292
Gecode::notMin
void notMin(Home home, SetVar s, IntVar x)
Post propagator that x is not the minimal element of s.
Definition int.cpp:235
Gecode::notMax
void notMax(Home home, SetVar s, IntVar x)
Post propagator that x is not the maximal element of s.
Definition int.cpp:267
Gecode::SetOpType
SetOpType
Common operations for sets.
Definition set.hh:660
Gecode::SetRelType
SetRelType
Common relation types for sets.
Definition set.hh:643
Gecode::SOT_MINUS
@ SOT_MINUS
Difference.
Definition set.hh:664
Gecode::SOT_DUNION
@ SOT_DUNION
Disjoint union.
Definition set.hh:662
Gecode::SOT_UNION
@ SOT_UNION
Union.
Definition set.hh:661
Gecode::SOT_INTER
@ SOT_INTER
Intersection
Definition set.hh:663
Gecode::SRT_GQ
@ SRT_GQ
Greater or equal ( ).
Definition set.hh:652
Gecode::SRT_CMPL
@ SRT_CMPL
Complement.
Definition set.hh:649
Gecode::SRT_GR
@ SRT_GR
Greater ( ).
Definition set.hh:653
Gecode::SRT_LQ
@ SRT_LQ
Less or equal ( ).
Definition set.hh:650
Gecode::SRT_NQ
@ SRT_NQ
Disequality ( ).
Definition set.hh:645
Gecode::SRT_LE
@ SRT_LE
Less ( ).
Definition set.hh:651
Gecode::SRT_EQ
@ SRT_EQ
Equality ( ).
Definition set.hh:644
Gecode::SRT_SUP
@ SRT_SUP
Superset ( ).
Definition set.hh:647
Gecode::SRT_DISJ
@ SRT_DISJ
Disjoint ( ).
Definition set.hh:648
Gecode::SRT_SUB
@ SRT_SUB
Subset ( ).
Definition set.hh:646
Gecode::SetTracer
ViewTracer< Set::SetView > SetTracer
Tracer for set variables.
Definition set.hh:1812
Gecode::SetTraceRecorder
ViewTraceRecorder< Set::SetView > SetTraceRecorder
Trace recorder for set variables.
Definition set.hh:1817
Gecode::TE_INIT
@ TE_INIT
Trace init events.
Definition recorder.hpp:43
Gecode::TE_PRUNE
@ TE_PRUNE
Trace prune events.
Definition recorder.hpp:44
Gecode::TE_FIX
@ TE_FIX
Trace fixpoint events.
Definition recorder.hpp:45
Gecode::TE_FAIL
@ TE_FAIL
Trace fail events.
Definition recorder.hpp:46
Gecode::TE_DONE
@ TE_DONE
Trace done events.
Definition recorder.hpp:47
iter.hh
kernel.hh
Gecode::Int::Limits
Numerical limits for integer variables.
Definition int.hh:114
Gecode::Int::Limits::check
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Definition limits.hpp:46
Gecode::Int::Limits::max
const int max
Largest allowed integer value.
Definition int.hh:116
Gecode::Set::Limits::min
const int min
Smallest allowed integer in integer set.
Definition set.hh:99
Gecode::Set::Limits::card
const unsigned int card
Maximum cardinality of an integer set.
Definition set.hh:101
Gecode::Set::Limits::max
const int max
Largest allowed integer in integer set.
Definition set.hh:97
Gecode
Gecode toplevel namespace
Gecode::SET_VAR_MERIT_MAX
SetVarBranch SET_VAR_MERIT_MAX(SetBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:111
Gecode::SET_VAL_MED_INC
SetValBranch SET_VAL_MED_INC(void)
Include median element (rounding downwards).
Definition val.hpp:65
Gecode::IntSetArgs
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition int.hh:619
Gecode::atmostOne
void atmostOne(Home home, const SetVarArgs &x, unsigned int c)
Post propagator for and .
Definition distinct.cpp:41
Gecode::SET_VAR_ACTION_SIZE_MIN
SetVarBranch SET_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest action divided by domain size with decay factor d.
Definition var.hpp:246
Gecode::SET_VAR_CHB_SIZE_MIN
SetVarBranch SET_VAR_CHB_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest CHB Q-score divided by domain size.
Definition var.hpp:266
Gecode::SET_VAR_ACTION_SIZE_MAX
SetVarBranch SET_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest action divided by domain size with decay factor d.
Definition var.hpp:256
Gecode::SET_ASSIGN_RND_EXC
SetAssign SET_ASSIGN_RND_EXC(Rnd r)
Exclude random element.
Definition assign.hpp:90
Gecode::channel
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition channel.cpp:41
Gecode::SET_VAR_NONE
SetVarBranch SET_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:96
Gecode::SET_VAL_RND_INC
SetValBranch SET_VAL_RND_INC(Rnd r)
Include random element.
Definition val.hpp:85
Gecode::SET_VAR_DEGREE_SIZE_MAX
SetVarBranch SET_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree divided by domain size.
Definition var.hpp:221
Gecode::sequence
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition sequence.cpp:47
Gecode::channelSorted
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
Post propagator for and .
Definition channel.cpp:45
Gecode::IntSharedArray
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition int.hh:1477
Gecode::operator<<
Archive & operator<<(Archive &e, FloatNumBranch nl)
Definition val-sel.hpp:39
Gecode::SET_VAL_RND_EXC
SetValBranch SET_VAL_RND_EXC(Rnd r)
Exclude random element.
Definition val.hpp:90
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:67
Gecode::SET_VAR_CHB_MIN
SetVarBranch SET_VAR_CHB_MIN(BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:166
Gecode::SET_VAR_MIN_MAX
SetVarBranch SET_VAR_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest minimum unknown element.
Definition var.hpp:191
Gecode::SET_ASSIGN_MED_EXC
SetAssign SET_ASSIGN_MED_EXC(void)
Exclude median element (rounding downwards).
Definition assign.hpp:70
Gecode::SET_VAR_CHB_MAX
SetVarBranch SET_VAR_CHB_MAX(BranchTbl tbl=nullptr)
Select variable with highest CHB Q-score.
Definition var.hpp:176
Gecode::SET_ASSIGN_MED_INC
SetAssign SET_ASSIGN_MED_INC(void)
Include median element (rounding downwards).
Definition assign.hpp:65
Gecode::dom
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition dom.cpp:40
Gecode::element
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Definition element.cpp:39
Gecode::SET_VAL
SetValBranch SET_VAL(SetBranchVal v, SetBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition val.hpp:95
Gecode::SET_VAR_SIZE_MIN
SetVarBranch SET_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest unknown set.
Definition var.hpp:206
Gecode::SET_VAR_RND
SetVarBranch SET_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:101
Gecode::SET_VAR_MAX_MAX
SetVarBranch SET_VAR_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest maximum unknown element.
Definition var.hpp:201
Gecode::SET_VAR_AFC_MAX
SetVarBranch SET_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:136
Gecode::SET_ASSIGN_MAX_INC
SetAssign SET_ASSIGN_MAX_INC(void)
Include largest element.
Definition assign.hpp:75
Gecode::SET_VAR_MIN_MIN
SetVarBranch SET_VAR_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest minimum unknown element.
Definition var.hpp:186
Gecode::SET_VAL_MED_EXC
SetValBranch SET_VAL_MED_EXC(void)
Exclude median element (rounding downwards).
Definition val.hpp:70
Gecode::SET_VAL_MAX_INC
SetValBranch SET_VAL_MAX_INC(void)
Include largest element.
Definition val.hpp:75
Gecode::SET_ASSIGN_RND_INC
SetAssign SET_ASSIGN_RND_INC(Rnd r)
Include random element.
Definition assign.hpp:85
Gecode::SET_VAR_CHB_SIZE_MAX
SetVarBranch SET_VAR_CHB_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score divided by domain size.
Definition var.hpp:276
Gecode::SET_VAR_DEGREE_MIN
SetVarBranch SET_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:116
Gecode::VariableSymmetry
SymmetryHandle VariableSymmetry(const IntVarArgs &x)
Variables in x are interchangeable.
Definition ldsb.cpp:62
Gecode::relax
GECODE_FLOAT_EXPORT void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition relax.cpp:57
Gecode::convex
void convex(Home home, SetVar x)
Post propagator that propagates that x is convex.
Definition convex.cpp:41
Gecode::SET_VAR_AFC_MIN
SetVarBranch SET_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:126
Gecode::SET_VAR_MAX_MIN
SetVarBranch SET_VAR_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest maximum unknown element.
Definition var.hpp:196
Gecode::wait
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition exec.cpp:39
Gecode::SET_VAR_DEGREE_MAX
SetVarBranch SET_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:121
Gecode::SET_VAL_MIN_INC
SetValBranch SET_VAL_MIN_INC(void)
Include smallest element.
Definition val.hpp:55
Gecode::max
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:49
Gecode::SET_VAR_AFC_SIZE_MIN
SetVarBranch SET_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:226
Gecode::VariableSequenceSymmetry
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &x, int ss)
Variable sequences in x of size ss are interchangeable.
Definition ldsb.cpp:90
Gecode::SET_ASSIGN_MIN_EXC
SetAssign SET_ASSIGN_MIN_EXC(void)
Exclude smallest element.
Definition assign.hpp:60
Gecode::SET_ASSIGN_MIN_INC
SetAssign SET_ASSIGN_MIN_INC(void)
Include smallest element.
Definition assign.hpp:55
Gecode::SET_VAL_MAX_EXC
SetValBranch SET_VAL_MAX_EXC(void)
Exclude largest element.
Definition val.hpp:80
Gecode::SET_ASSIGN
SetAssign SET_ASSIGN(SetBranchVal v, SetBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition assign.hpp:95
Gecode::SET_ASSIGN_MAX_EXC
SetAssign SET_ASSIGN_MAX_EXC(void)
Exclude largest element.
Definition assign.hpp:80
Gecode::SET_VAR_AFC_SIZE_MAX
SetVarBranch SET_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:236
Gecode::SET_VAR_ACTION_MIN
SetVarBranch SET_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:146
Gecode::cardinality
LinIntExpr cardinality(const SetExpr &)
Cardinality of set expression.
Definition set-expr.cpp:817
Gecode::SetVarValPrint
std::function< void(const Space &home, const Brancher &b, unsigned int a, SetVar x, int i, const int &n, std::ostream &o)> SetVarValPrint
Function type for printing branching alternatives for set variables.
Definition set.hh:1285
Gecode::SET_VAR_MERIT_MIN
SetVarBranch SET_VAR_MERIT_MIN(SetBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:106
Gecode::SET_VAR_DEGREE_SIZE_MIN
SetVarBranch SET_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree divided by domain size.
Definition var.hpp:216
Gecode::SET_VAL_MIN_EXC
SetValBranch SET_VAL_MIN_EXC(void)
Exclude smallest element.
Definition val.hpp:60
Gecode::SET_VAR_SIZE_MAX
SetVarBranch SET_VAR_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest unknown set.
Definition var.hpp:211
Gecode::SET_VAR_ACTION_MAX
SetVarBranch SET_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:156
array-traits.hpp
array.hpp
action.hpp
afc.hpp
assign.hpp
chb.hpp
traits.hpp
val.hpp
var.hpp
branch.hpp
exception.hpp
limits.hpp
delta.hpp
trace-view.hpp
traits.hpp
trace.hpp
var-imp.hpp
view.hpp