38 namespace Gecode {
namespace Set {
namespace LDSB {
40 template<
class View,
int n,
class Val,
unsigned int a>
48 :
LDSBBrancher<View,n,Val,
a>(home, x, vs, vsc, syms, nsyms, bf, vvp),
55 int dest = this->_nsyms - 1;
56 for (
int i = 0 ;
i < this->_nsyms - seen ;
i++) {
59 this->_syms[
i] = this->_syms[dest];
60 this->_syms[dest] =
t;
65 _nValueSymmetries = seen;
66 _nNonValueSymmetries = this->_nsyms - seen;
69 template<
class View,
int n,
class Val,
unsigned int a>
74 _nNonValueSymmetries(b._nNonValueSymmetries),
75 _nValueSymmetries(b._nValueSymmetries),
76 _nCopiedSyms(b._nCopiedSyms),
77 _leftBranchValues(b._leftBranchValues),
108 if (usedValues.
in(
i))
118 if (intersection.
size() < 2)
120 int *
a =
new int[intersection.
size()];
121 for (
int i = 0 ;
i < intersection.
size() ;
i++) {
122 a[
i] = intersection[
i];
130 template<
class View,
int n,
class Val,
unsigned int a>
152 this->_syms[this->
_nsyms] = ns;
178 template<
class View,
int n,
class Val,
unsigned int a>
187 int choicePos = pvc->
pos().pos;
196 template<
class View,
int n,
class Val,
unsigned int a>
202 int choicePos = pvc.
pos().pos;
203 int choiceVal = pvc.
val();
229 for (
int i = 0 ;
i < nliterals ;
i++) {
239 template<
class View,
int n,
class Val,
unsigned int a>
245 template<
class View,
int n,
class Val,
unsigned int a>
253 return *
new (home)
LDSBSetBrancher<View,n,Val,a>(home,x,
vs,vsc,syms,nsyms,bf,vvp);
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
int _nsyms
Number of symmetry implementations.
Symmetry-breaking brancher with generic view and value selection.
BranchFilter bf
Branch filter function.
int size(void) const
Return size of array (number of elements)
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
A Literal is a pair of variable index and value.
ValueSymmetryImp< View > * specialUpdate(Space &home, ValueSymmetryImp< View > *s, IntSet usedValues)
Bulk update of a value symmetry s, using usedValues.
T * realloc(T *b, long unsigned int n, long unsigned int m)
Reallocate block of n objects starting at b to m objects of type T from the space heap...
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
int ModEvent
Type for modification events.
virtual const Choice * choice(Space &home)
Return choice.
Support::BitSetOffset< Space > values
Symmetric values.
int _value
The value of the literal. For int and bool variables, this is the value itself; for set variables...
int _variable
Variable index. The ViewArray that the index is meant for is assumed to be known by context...
const Pos & pos(void) const
Return position in array.
SymmetryImp< View > ** _syms
Array of symmetry implementations.
Base-class for both propagators and branchers.
ValueSymmetryImp< View > ** _copiedSyms
Copy of value symmetries from the first node where the current variable was branched on...
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
void updatePart1(Space &home, int choicePos)
Part one of the update phase.
int _nValueSymmetries
Number of value symmetries.
Choice storing position and value, and symmetric literals to be excluded on the right branch...
LDSBSetBrancher(Space &home, bool share, LDSBSetBrancher &b)
Constructor for cloning b.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Implementation of a value symmetry.
ViewSel< View > * vs[n]
View selection objects.
int _nCopiedSyms
Number of copied symmetries.
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Symmetry-breaking brancher with generic view and value selection.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
const Val & val(void) const
Return value to branch with.
VarValPrint vvp
Print function.
virtual const Choice * choice(Space &home)
Return choice.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
int _nNonValueSymmetries
Number of non-value symmetries.
void(* VarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int b, typename View::VarType x, int i, const Val &m, std::ostream &o)
Function type for printing variable and value selection.
Passing integer arguments.
static const IntSet empty
Empty set.
void free(T *b, long unsigned int n)
Delete n objects allocated from space heap starting at b.
int nliterals(void) const
Return number of literals.
struct Gecode::@519::NNF::@60::@61 b
For binary nodes (and, or, eqv)
Implementation of a single symmetry.
void update(Literal)
Left-branch update.
virtual const Choice * choice(Space &home)
Return choice.
Node * x
Pointer to corresponding Boolean expression node.
Choice for performing commit
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.
Value iterator for integer sets.
bool(* SetBranchFilter)(const Space &home, SetVar x, int i)
Branch filter function type for set variables.
virtual Actor * copy(Space &home, bool share)
Perform cloning.
int _prevPos
Position of previous variable that was branched on.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
const Literal * literals(void) const
Return literals.
IntSet _leftBranchValues
Set of values used on left branches for the current variable.
Gecode toplevel namespace
bool in(int n) const
Return whether n is included in the set.
ViewArray< View > x
Views to branch on.
Home class for posting propagators
Choice storing position and value
bool _stable
Is the state of the brancher "stable"?