38 namespace Gecode {
namespace Set {
namespace LDSB {
40 template<
class View,
int n,
class Val,
unsigned int a,
41 class Filter,
class Print>
50 (home, x, vs, vsc, syms, nsyms, bf, vvp),
57 int dest = this->_nsyms - 1;
58 for (
int i = 0 ;
i < this->_nsyms - seen ;
i++) {
61 this->_syms[
i] = this->_syms[dest];
62 this->_syms[dest] =
t;
67 _nValueSymmetries = seen;
68 _nNonValueSymmetries = this->_nsyms - seen;
71 template<
class View,
int n,
class Val,
unsigned int a,
72 class Filter,
class Print>
78 _nNonValueSymmetries(b._nNonValueSymmetries),
79 _nValueSymmetries(b._nValueSymmetries),
80 _nCopiedSyms(b._nCopiedSyms),
81 _leftBranchValues(b._leftBranchValues),
102 template <
class View>
112 if (usedValues.
in(
i))
122 if (intersection.
size() < 2)
124 int *a =
new int[intersection.
size()];
125 for (
int i = 0 ;
i < intersection.
size() ;
i++) {
126 a[
i] = intersection[
i];
134 template<
class View,
int n,
class Val,
unsigned int a,
135 class Filter,
class Print>
157 this->_syms[this->
_nsyms] = ns;
183 template<
class View,
int n,
class Val,
unsigned int a,
184 class Filter,
class Print>
193 int choicePos = pvc->
pos().pos;
202 template<
class View,
int n,
class Val,
unsigned int a,
203 class Filter,
class Print>
209 int choicePos = pvc.
pos().pos;
210 int choiceVal = pvc.
val();
238 for (
int i = 0 ;
i < nliterals ;
i++) {
248 template<
class View,
int n,
class Val,
unsigned int a,
249 class Filter,
class Print>
256 template<
class View,
int n,
class Val,
unsigned int a,
257 class Filter,
class Print>
266 (home,
x,
vs,
vsc,syms,nsyms,bf,vvp);
269 template<
class View,
int n,
class Val,
unsigned int a>
281 ::post(home,x,
vs,vsc,syms,nsyms,bf,vvp);
284 ::post(home,x,
vs,vsc,syms,nsyms,bf,vvp);
289 ::post(home,x,
vs,vsc,syms,nsyms,bf,vvp);
292 ::post(home,x,
vs,vsc,syms,nsyms,bf,vvp);
int _nValueSymmetries
Number of value symmetries.
int _nNonValueSymmetries
Number of non-value symmetries.
Symmetry-breaking brancher with generic view and value selection.
int size(void) const
Return size of array (number of elements)
A Literal is a pair of variable index and value.
void updatePart1(Space &home, int choicePos)
Part one of the update phase.
ValueSymmetryImp< View > * specialUpdate(Space &home, ValueSymmetryImp< View > *s, IntSet usedValues)
Bulk update of a value symmetry s, using usedValues.
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.
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.
int _prevPos
Position of previous variable that was branched on.
Support::BitSetOffset< Space > values
Symmetric values.
ViewArray< View > x
Views to branch on.
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...
Class storing a print function.
const Pos & pos(void) const
Return position in array.
void postldsbsetbrancher(Home home, ViewArray< View0 > &x, ViewSel< View0 > *vs[n0], ValSelCommitBase< View0, Val0 > *vsc, SymmetryImp< View0 > **syms, int nsyms, BranchFilter< typename View0::VarType > bf, VarValPrint< typename View0::VarType, Val0 > vvp)
Post LDSB brancher.
Class without print function.
Base-class for both propagators and branchers.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
ViewSel< View > * vs[n]
View selection objects.
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.
IntSet _leftBranchValues
Set of values used on left branches for the current variable.
Gecode::FloatVal c(-8, 8)
Choice storing position and value, and symmetric literals to be excluded on the right branch...
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
bool _stable
Is the state of the brancher "stable"?
Implementation of a value symmetry.
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
int _nCopiedSyms
Number of copied symmetries.
Symmetry-breaking brancher with generic view and value selection.
LDSBSetBrancher(Space &home, LDSBSetBrancher &b)
Constructor for cloning b.
const Val & val(void) const
virtual const Choice * choice(Space &home)
Return choice.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
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::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Implementation of a single symmetry.
void update(Literal)
Left-branch update.
virtual Actor * copy(Space &home)
Perform cloning.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
Choice for performing commit
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.
Value iterator for integer sets.
ValueSymmetryImp< View > ** _copiedSyms
Copy of value symmetries from the first node where the current variable was branched on...
Post propagator for SetVar x
int _nsyms
Number of symmetry implementations.
SymmetryImp< View > ** _syms
Array of symmetry implementations.
const Literal * literals(void) const
Return literals.
Gecode toplevel namespace
bool in(int n) const
Return whether n is included in the set.
SymmetryImp< View > * copy(Space &home) const
Copy function.
virtual const Choice * choice(Space &home)
Return choice.
Home class for posting propagators
Choice storing position and value
virtual const Choice * choice(Space &home)
Return choice.
void update(IntSet &y, Space &home, IntSet &py)