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;
126 int *vs = home.
alloc<
int>(
n);
127 for (
unsigned int i = 0 ;
i <
n ;
i++)
139 using namespace Set::LDSB;
157 for (
int i = 0 ;
i < x.
size() ;
i++)
158 variableMap[x[
i].varimp()] =
i;
165 for (
int i = 0 ;
i <
n ;
i++) {
180 vars.
a.expand(home,x);
184 vars.
b.expand(home,x);
188 vars.
c.expand(home,x);
192 vars.
d.expand(home,x);
194 return branch(home,x,vars.
a,vals,syms,bf,vvp);
199 for (
int i = 0 ;
i < x.
size() ;
i++)
200 variableMap[x[
i].varimp()] =
i;
207 for (
int i = 0 ;
i <
n ;
i++) {
218 LDSBSetBrancher<SetView,2,int,2>::post(home,xv,vs,vsc,array,n,bf,vvp);
225 LDSBSetBrancher<SetView,3,int,2>::post(home,xv,vs,vsc,array,n,bf,vvp);
232 LDSBSetBrancher<SetView,4,int,2>::post(home,xv,vs,vsc,array,n,bf,vvp);
bool failed(void) const
Check whether corresponding space is failed.
Which values to select for branching first.
VarImpBase ** xs
Array of variables in symmetry.
Combine variable selection criteria for tie-breaking.
SetVarBranch SET_VAR_NONE(void)
Select first unassigned variable.
IntSet values
Set of symmetric values.
IntArgs values
Array of values in symmetry.
int size(void) const
Return size of array (number of elements)
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.
int ModEvent
Type for modification events.
Implementation of a variable sequence symmetry.
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Argument array for non-primitive types.
A reference-counted pointer to a SymmetryObject.
ViewSel< SetView > * viewsel(Space &home, const SetVarBranch &svb)
Return view selectors for set views.
Implementation of a variable symmetry at the modelling level.
Implementation of a value symmetry.
int nxs
Number of variables in symmetry.
int seq_size
Size of each sequence in symmetry.
ValSelCommitBase< SetView, int > * valselcommit(Space &home, const SetValBranch &svb)
Return value and commit for set views.
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
unsigned int size(void) const
Return size (cardinality) of set.
Set view for set variables
Random (uniform, for tie breaking)
Implementation of a single symmetry.
Node * x
Pointer to corresponding Boolean expression node.
void expand(Home home, const SetVarArgs &x)
Expand decay factor into AFC or activity.
static BrancherHandle post(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **_syms, int _nsyms, SetBranchFilter bf, VarValPrint vvp)
Brancher post function.
Implementation of a variable symmetry.
Value iterator for integer sets.
void(* SetVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, SetVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for set variables.
bool(* SetBranchFilter)(const Space &home, SetVar x, int i)
Branch filter function type for set variables.
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
VarBranch a
Branching criteria to try in order.
Implementation of a value sequence symmetry.
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Gecode toplevel namespace
Map from variable implementation to index.
BrancherHandle 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.
Which variable to select for branching.
Home class for posting propagators
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.