Go to the documentation of this file.
43 using namespace Int::LDSB;
50 for (
int i = 0 ;
i <
x.size() ;
i++)
56 for (
int i = 0 ;
i <
x.size() ;
i++)
62 namespace Gecode {
namespace Int {
namespace LDSB {
65 return x.exclude(home,
v);
69 namespace Gecode {
namespace Set {
namespace LDSB {
90 int* indices = home.
alloc<
int>(
n);
91 for (
int i = 0 ;
i <
n ;
i++) {
92 VariableMap::const_iterator index = variableMap.find(varref->
xs[
i]);
93 if (index == variableMap.end())
96 indices[
i] = index->second;
102 int *vs = home.
alloc<
int>(
n);
111 int n = varseqref->
nxs;
112 int* indices = home.
alloc<
int>(
n);
113 for (
int i = 0 ;
i <
n ;
i++) {
114 VariableMap::const_iterator index =
115 variableMap.find(varseqref->
xs[
i]);
116 if (index == variableMap.end())
119 indices[
i] = index->second;
125 unsigned int n = valseqref->
values.size();
126 int *vs = home.
alloc<
int>(
n);
127 for (
unsigned int i = 0 ;
i <
n ;
i++)
139 using namespace Set::LDSB;
148 if (home.
failed())
return;
158 for (
int i = 0 ;
i <
x.size() ;
i++)
159 variableMap[
x[
i].varimp()] =
i;
166 for (
int i = 0 ;
i <
n ;
i++) {
170 postldsbsetbrancher<SetView,1,int,2>
181 if (home.
failed())
return;
182 vars.
a.expand(home,
x);
186 vars.
b.expand(home,
x);
190 vars.
c.expand(home,
x);
194 vars.
d.expand(home,
x);
196 branch(home,
x,vars.
a,vals,syms,bf,vvp);
201 for (
int i = 0 ;
i <
x.size() ;
i++)
202 variableMap[
x[
i].varimp()] =
i;
209 for (
int i = 0 ;
i <
n ;
i++) {
219 postldsbsetbrancher<SetView,2,int,2>(home,xv,vs,vsc,array,
n,bf,vvp);
225 postldsbsetbrancher<SetView,3,int,2>(home,xv,vs,vsc,array,
n,bf,vvp);
231 postldsbsetbrancher<SetView,4,int,2>(home,xv,vs,vsc,array,
n,bf,vvp);
int seq_size
Size of each sequence in symmetry.
Post propagator for SetVar x
ValSelCommitBase< SetView, int > * valselcommit(Space &home, const SetValBranch &svb)
Return value and commit for set views.
VarImpBase ** xs
Array of variables in symmetry.
Combine variable selection criteria for tie-breaking.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Which values to select for branching first.
IntSet values
Set of symmetric values.
VarImpBase ** xs
Array of variables in symmetry.
Implementation of a value symmetry.
Gecode::IntArgs i(4, 1, 2, 3, 4)
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.
@ SEL_NONE
First unassigned.
SetVarBranch SET_VAR_NONE(void)
Implementation of a variable symmetry.
unsigned int size(void) const
Return size (cardinality) of set.
Collection of symmetries.
Gecode toplevel namespace
IntArgs values
Array of values in symmetry.
std::function< bool(const Space &home, SetVar x, int i)> SetBranchFilter
Branch filter function type for set variables.
Implementation of a value sequence symmetry at the modelling level.
Argument array for non-primitive types.
Implementation of a variable sequence symmetry.
SymmetryImp< SetView > * createSetSym(Space &home, const SymmetryHandle &s, VariableMap variableMap)
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
int nxs
Number of variables in symmetry.
Implementation of a variable symmetry at the modelling level.
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
int nxs
Number of variables in symmetry.
Implementation of a value symmetry at the modelling level.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Implementation of a value sequence symmetry.
ViewSel< SetView > * viewsel(Space &home, const SetVarBranch &svb)
Return view selectors for set views.
#define GECODE_NEVER
Assert that this command is never executed.
Base class for value selection and commit.
Exception: Variable in symmetry not branched on
int ModEvent
Type for modification events.
bool failed(void) const
Check whether corresponding space is failed.
A reference-counted pointer to a SymmetryObject.
Abstract class for view selection.
Set view for set variables
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Implementation of a variable sequence symmetry at the modelling level.
int seq_size
Size of each sequence in symmetry.
Map from variable implementation to index.
Expand and CHB void expand(Home home, const SetVarArgs &x)
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Implementation of a single symmetry.
int n
Number of negative literals for node type.
Value iterator for integer sets.
@ SEL_RND
Random (uniform, for tie breaking)
Which variable to select for branching.
VarBranch a
Branching criteria to try in order.