39 using namespace Int::LDSB;
46 for (
int i = 0 ; i <
x.size() ; i++)
52 for (
int i = 0 ; i <
x.size() ; i++)
58namespace Gecode {
namespace Int {
namespace LDSB {
61 return x.exclude(home, v);
65namespace Gecode {
namespace Set {
namespace LDSB {
86 int* indices = home.
alloc<
int>(
n);
87 for (
int i = 0 ; i <
n ; i++) {
88 VariableMap::const_iterator index = variableMap.find(varref->
xs[i]);
89 if (index == variableMap.end())
92 indices[i] = index->second;
98 int *vs = home.
alloc<
int>(
n);
107 int n = varseqref->
nxs;
108 int* indices = home.
alloc<
int>(
n);
109 for (
int i = 0 ; i <
n ; i++) {
110 VariableMap::const_iterator index =
111 variableMap.find(varseqref->
xs[i]);
112 if (index == variableMap.end())
115 indices[i] = index->second;
122 int *vs = home.
alloc<
int>(
n);
123 for (
unsigned int i = 0 ; i <
n ; i++)
124 vs[i] = valseqref->
values[i];
135 using namespace Set::LDSB;
144 if (home.
failed())
return;
154 for (
int i = 0 ; i <
x.size() ; i++)
155 variableMap[
x[i].varimp()] = i;
162 for (
int i = 0 ; i <
n ; i++) {
177 if (home.
failed())
return;
178 vars.
a.expand(home,
x);
182 vars.
b.expand(home,
x);
186 vars.
c.expand(home,
x);
190 vars.
d.expand(home,
x);
192 branch(home,
x,vars.
a,vals,syms,bf,vvp);
197 for (
int i = 0 ; i <
x.size() ; i++)
198 variableMap[
x[i].varimp()] = i;
205 for (
int i = 0 ; i <
n ; i++) {
215 postldsbsetbrancher<SetView,2,int,2>(home,xv,vs,vsc,array,
n,bf,vvp);
221 postldsbsetbrancher<SetView,3,int,2>(home,xv,vs,vsc,array,
n,bf,vvp);
227 postldsbsetbrancher<SetView,4,int,2>(home,xv,vs,vsc,array,
n,bf,vvp);
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
int size(void) const
Return size of array (number of elements)
Argument array for non-primitive types.
Home class for posting propagators
bool failed(void) const
Check whether corresponding space is failed.
Value iterator for integer sets.
unsigned int size(void) const
Return size (cardinality) of set.
Exception: Variable in symmetry not branched on
Implementation of a single symmetry.
Implementation of a value sequence symmetry.
Implementation of a value sequence symmetry at the modelling level.
IntArgs values
Array of values in symmetry.
int seq_size
Size of each sequence in symmetry.
Implementation of a value symmetry.
Implementation of a value symmetry at the modelling level.
IntSet values
Set of symmetric values.
Map from variable implementation to index.
Implementation of a variable sequence symmetry.
Implementation of a variable sequence symmetry at the modelling level.
int seq_size
Size of each sequence in symmetry.
int nxs
Number of variables in symmetry.
VarImpBase ** xs
Array of variables in symmetry.
Implementation of a variable symmetry.
Implementation of a variable symmetry at the modelling level.
int nxs
Number of variables in symmetry.
VarImpBase ** xs
Array of variables in symmetry.
Which values to select for branching first.
Which variable to select for branching.
Expand and CHB void expand(Home home, const SetVarArgs &x)
@ SEL_NONE
First unassigned.
@ SEL_RND
Random (uniform, for tie breaking)
Set view for set variables
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Collection of symmetries.
A reference-counted pointer to a SymmetryObject.
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Combine variable selection criteria for tie-breaking.
VarBranch a
Branching criteria to try in order.
Base class for value selection and commit.
Abstract class for view selection.
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.
std::function< bool(const Space &home, SetVar x, int i)> SetBranchFilter
Branch filter function type for set variables.
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
ModEvent prune< Set::SetView >(Space &home, Set::SetView x, int v)
void postldsbsetbrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **syms, int nsyms, BranchFilter< typename View::VarType > bf, VarValPrint< typename View::VarType, Val > vvp)
SymmetryImp< SetView > * createSetSym(Space &home, const SymmetryHandle &s, VariableMap variableMap)
Gecode toplevel namespace
Select first unassigned variable SetVarBranch SET_VAR_NONE(void)
Function type for printing branching alternatives for set variables typedef std::function< void(const Space &home, const Brancher &b, unsigned int a, SetVar x, int i, const int &n, std::ostream &o)> SetVarValPrint
SymmetryHandle VariableSymmetry(const IntVarArgs &x)
Variables in x are interchangeable.
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &x, int ss)
Variable sequences in x of size ss are interchangeable.
Post propagator for SetVar x
int ModEvent
Type for modification events.
#define GECODE_NEVER
Assert that this command is never executed.