Go to the documentation of this file.
34 namespace Gecode {
namespace Set {
namespace LDSB {
36 template<
class View,
int n,
class Val,
unsigned int a,
37 class Filter,
class Print>
46 (home,
x, vs, vsc, syms, nsyms, bf, vvp),
53 int dest = this->_nsyms - 1;
54 for (
int i = 0 ;
i < this->_nsyms - seen ;
i++) {
57 this->_syms[
i] = this->_syms[dest];
58 this->_syms[dest] =
t;
63 _nValueSymmetries = seen;
64 _nNonValueSymmetries = this->_nsyms - seen;
67 template<
class View,
int n,
class Val,
unsigned int a,
68 class Filter,
class Print>
74 _nNonValueSymmetries(
b._nNonValueSymmetries),
75 _nValueSymmetries(
b._nValueSymmetries),
76 _nCopiedSyms(
b._nCopiedSyms),
77 _leftBranchValues(
b._leftBranchValues),
83 b._copiedSyms[
i]->copy(home));
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,
131 class Filter,
class Print>
135 if (_nValueSymmetries > 0) {
138 if (choicePos != _prevPos) {
139 if (_prevPos != -1) {
141 for (
int j = _nNonValueSymmetries ; j < this->_nsyms ; j++) {
142 this->_syms[j] = _copiedSyms[
i];
146 for (
int i = 0 ;
i < _nCopiedSyms ;
i++) {
153 this->_syms[this->_nsyms] = ns;
155 this->_nValueSymmetries++;
162 _prevPos = choicePos;
163 if (_nCopiedSyms > 0) home.
free(_copiedSyms, _nCopiedSyms);
164 _nCopiedSyms = _nValueSymmetries;
168 for (
int j = _nNonValueSymmetries ; j < this->_nsyms ; j++) {
181 template<
class View,
int n,
class Val,
unsigned int a,
182 class Filter,
class Print>
191 int choicePos = pvc->
pos().pos;
195 updatePart1(home, choicePos);
200 template<
class View,
int n,
class Val,
unsigned int a,
201 class Filter,
class Print>
207 int choicePos = pvc.
pos().pos;
208 int choiceVal = pvc.
val();
211 updatePart1(home, choicePos);
219 _leftBranchValues =
IntSet(ia);
225 for (
int i = 0 ;
i < this->_nsyms ;
i++)
236 for (
int i = 0 ;
i < nliterals ;
i++) {
238 ModEvent me = prune<View>(home, this->x[
l._variable],
l._value);
246 template<
class View,
int n,
class Val,
unsigned int a,
247 class Filter,
class Print>
254 template<
class View,
int n,
class Val,
unsigned int a,
255 class Filter,
class Print>
264 (home,
x,vs,vsc,syms,nsyms,bf,vvp);
267 template<
class View,
int n,
class Val,
unsigned int a>
279 ::post(home,
x,vs,vsc,syms,nsyms,bf,vvp);
282 ::post(home,
x,vs,vsc,syms,nsyms,bf,vvp);
287 ::post(home,
x,vs,vsc,syms,nsyms,bf,vvp);
290 ::post(home,
x,vs,vsc,syms,nsyms,bf,vvp);
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl)
Post constraint .
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Post propagator for SetVar x
bool in(int n) const
Return whether n is included in the set.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
Choice storing position and value, and symmetric literals to be excluded on the right branch.
ValueSymmetryImp< View > * specialUpdate(Space &home, ValueSymmetryImp< View > *s, IntSet usedValues)
Bulk update of a value symmetry s, using usedValues.
static void post(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **_syms, int _nsyms, BranchFilter< Var > bf, VarValPrint< Var, Val > vvp)
Brancher post function.
void free(T *b, long unsigned int n)
Delete n objects allocated from space heap starting at b.
Implementation of a value symmetry.
static const IntSet empty
Empty set.
Class without print function.
LDSBSetBrancher(Space &home, LDSBSetBrancher &b)
Constructor for cloning b.
Support::BitSetOffset< Space > values
Symmetric values.
Symmetry-breaking brancher with generic view and value selection.
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.
virtual Actor * copy(Space &home)
Perform cloning.
Class storing a print function.
Gecode toplevel namespace
View::VarType Var
The corresponding variable.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
void update(IntSet &y, Space &home, IntSet &py)
virtual const Choice * choice(Space &home)
Return choice.
virtual const Choice * choice(Space &home)
Return choice.
Home class for posting propagators
virtual const Choice * choice(Space &home)
Return choice.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
A Literal is a pair of variable index and value.
void updatePart1(Space &home, int choicePos)
Part one of the update phase.
int nliterals(void) const
Return number of literals.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
int ModEvent
Type for modification events.
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)
const Val & val(void) const
void update(Literal)
Left-branch update.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
Choice storing position and value
Symmetry-breaking brancher with generic view and value selection.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
int _nCopiedSyms
Number of copied symmetries.
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.
Gecode::FloatVal c(-8, 8)
Implementation of a single symmetry.
const Literal * literals(void) const
Return literals.
int n
Number of negative literals for node type.
Choice for performing commit
Passing integer arguments.
Value iterator for integer sets.
Gecode::IntArgs i({1, 2, 3, 4})
std::function< void(const Space &home, const Brancher &b, unsigned int a, Var x, int i, const Val &m, std::ostream &o)> VarValPrint
Function type for printing variable and value selection.
@ ES_OK
Execution is okay.
SymmetryImp< View > * copy(Space &home) const
Copy function.
const Pos & pos(void) const
Return position in array.