39 using namespace Int::LDSB;
46 for (
int i = 0 ;
i < x.
size() ;
i++)
52 for (
int i = 0 ;
i < x.
size() ;
i++)
58 namespace Gecode {
namespace Int {
namespace LDSB {
61 return x.exclude(home,
v);
65 namespace 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++)
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++) {
166 postldsbsetbrancher<SetView,1,int,2>
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);
Which values to select for branching first.
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
VarImpBase ** xs
Array of variables in symmetry.
Combine variable selection criteria for tie-breaking.
int size(void) const
Return size of array (number of elements)
IntSet values
Set of symmetric values.
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.
IntArgs values
Array of values in symmetry.
Implementation of a value symmetry at the modelling level.
Implementation of a value sequence symmetry at the modelling level.
Abstract class for view selection.
Collection of symmetries.
Expand and CHB void expand(Home home, const SetVarArgs &x)
int ModEvent
Type for modification events.
Implementation of a variable sequence symmetry.
SetVarBranch SET_VAR_NONE(void)
Base class for value selection and commit.
int nxs
Number of variables in symmetry.
SymmetryImp< SetView > * createSetSym(Space &home, const SymmetryHandle &s, VariableMap variableMap)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
int n
Number of negative literals for node type.
Argument array for non-primitive types.
Gecode::IntArgs i({1, 2, 3, 4})
A reference-counted pointer to a SymmetryObject.
Implementation of a variable symmetry at the modelling level.
Implementation of a value symmetry.
unsigned int size(void) const
Return size (cardinality) of set.
bool failed(void) const
Check whether corresponding space is failed.
int nxs
Number of variables in symmetry.
int seq_size
Size of each sequence in symmetry.
Implementation of a variable sequence symmetry at the modelling level.
VarImpBase ** xs
Array of variables in symmetry.
int seq_size
Size of each sequence in symmetry.
Exception: Variable in symmetry not branched on
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
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
Set view for set variables
Implementation of a single symmetry.
Implementation of a variable symmetry.
Value iterator for integer sets.
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
VarBranch a
Branching criteria to try in order.
std::function< bool(const Space &home, SetVar x, int i)> SetBranchFilter
Branch filter function type for set variables.
Implementation of a value sequence symmetry.
Post propagator for SetVar x
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Random (uniform, for tie breaking)
Gecode toplevel namespace
Map from variable implementation to index.
Which variable to select for branching.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.