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>
134 if (_nValueSymmetries > 0) {
137 if (choicePos != _prevPos) {
138 if (_prevPos != -1) {
140 for (
int j = _nNonValueSymmetries ; j < this->_nsyms ; j++) {
141 this->_syms[j] = _copiedSyms[
i];
145 for (
int i = 0 ; i < _nCopiedSyms ; i++) {
152 this->_syms[this->_nsyms] = ns;
154 this->_nValueSymmetries++;
161 _prevPos = choicePos;
162 if (_nCopiedSyms > 0) home.
free(_copiedSyms, _nCopiedSyms);
163 _nCopiedSyms = _nValueSymmetries;
166 for (
int j = _nNonValueSymmetries ; j < this->_nsyms ; j++) {
178 template<
class View,
int n,
class Val,
unsigned int a>
187 int choicePos = pvc->
pos().pos;
191 updatePart1(home, choicePos);
196 template<
class View,
int n,
class Val,
unsigned int a>
202 int choicePos = pvc.
pos().pos;
203 int choiceVal = pvc.
val();
206 updatePart1(home, choicePos);
214 _leftBranchValues =
IntSet(ia);
219 for (
int i = 0 ;
i < this->_nsyms ;
i++)
220 this->_syms[
i]->update(
Literal(choicePos, choiceVal));
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);