Generated on for Gecode by doxygen 1.15.0
ldsb.cpp
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Christopher Mears <chris.mears@monash.edu>
5 *
6 * Copyright:
7 * Christopher Mears, 2012
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.dev
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 *
32 */
33
34#include <gecode/int/ldsb.hh>
35#include <gecode/int/branch.hh>
36
37#include <map>
38
39namespace Gecode { namespace Int { namespace LDSB {
40
41 std::pair<int,int>
42 findVar(int *indices, unsigned int n_values, unsigned int seq_size, int index) {
43 unsigned int seq = 0;
44 unsigned int pos = 0;
45 for (unsigned int i=0U ; i<n_values ; i++) {
46 if (indices[i] == index)
47 return std::pair<int,int>(seq,pos);
48 pos++;
49 if (pos == seq_size) {
50 pos = 0;
51 seq++;
52 }
53 }
54 return std::pair<int,int>(-1,-1);
55 }
56
57}}}
58
59namespace Gecode {
60 using namespace Int::LDSB;
61
64 for (int i = 0 ; i < vars.size() ; i++)
65 a[i] = vars[i].varimp();
67 }
70 for (int i = 0 ; i < vars.size() ; i++)
71 a[i] = vars[i].varimp();
73 }
75 const IntArgs& indices) {
76 IntVarArgs xs(indices.size());
77 for (int i = 0 ; i < indices.size() ; i++)
78 xs[i] = x[indices[i]];
79 return VariableSymmetry(xs);
80 }
92 for (int i = 0 ; i < vars.size() ; i++)
93 a[i] = vars[i].varimp();
95 }
98 for (int i = 0 ; i < vars.size() ; i++)
99 a[i] = vars[i].varimp();
101 }
104 }
105
106 SymmetryHandle values_reflect(int lower, int upper) {
107 int n = (upper-lower+1)/2;
108 IntArgs a(n*2);
109 int i = lower;
110 int j = upper;
111 int k = 0;
112 while (i < j) {
113 a[k] = j;
114 a[n+k] = i;
115 i++;
116 j--;
117 k++;
118 }
119 return ValueSequenceSymmetry(a,n);
120 }
122 return values_reflect(x.min(), x.max());
123 }
124}
125
126
127namespace Gecode { namespace Int { namespace LDSB {
128
130 class VariableMap : public std::map<VarImpBase*,int> {};
131
132 /*
133 * The duplication in createIntSym/createBoolSym is undesirable,
134 * and so is the use of dynamic_cast to tell the symmetries
135 * apart.
136 */
137
141 VariableMap variableMap) {
142 VariableSymmetryObject* varref =
143 dynamic_cast<VariableSymmetryObject*>(s.ref);
144 ValueSymmetryObject* valref =
145 dynamic_cast<ValueSymmetryObject*>(s.ref);
147 dynamic_cast<VariableSequenceSymmetryObject*>(s.ref);
148 ValueSequenceSymmetryObject* valseqref =
149 dynamic_cast<ValueSequenceSymmetryObject*>(s.ref);
150 if (varref) {
151 int n = varref->nxs;
152 int* indices = home.alloc<int>(n);
153 for (int i = 0 ; i < n ; i++) {
154 VariableMap::const_iterator index = variableMap.find(varref->xs[i]);
155 if (index == variableMap.end())
156 throw LDSBUnbranchedVariable("VariableSymmetryObject::createInt");
157 indices[i] = index->second;
158 }
159 return new (home) VariableSymmetryImp<IntView>(home, indices, n);
160 }
161 if (valref) {
162 int n = valref->values.size();
163 int *vs = home.alloc<int>(n);
164 int i = 0;
165 for (IntSetValues v(valref->values) ; v() ; ++v) {
166 vs[i] = v.val();
167 i++;
168 }
169 return new (home) ValueSymmetryImp<IntView>(home, vs, n);
170 }
171 if (varseqref) {
172 int n = varseqref->nxs;
173 int* indices = home.alloc<int>(n);
174 for (int i = 0 ; i < n ; i++) {
175 VariableMap::const_iterator index =
176 variableMap.find(varseqref->xs[i]);
177 if (index == variableMap.end())
178 throw LDSBUnbranchedVariable("VariableSequenceSymmetryObject::createInt");
179 indices[i] = index->second;
180 }
181 return new (home) VariableSequenceSymmetryImp<IntView>(home, indices, n,
182 varseqref->seq_size);
183 }
184 if (valseqref) {
185 unsigned int n = valseqref->values.size();
186 int *vs = home.alloc<int>(n);
187 for (unsigned int i = 0 ; i < n ; i++)
188 vs[i] = valseqref->values[i];
189 return new (home) ValueSequenceSymmetryImp<IntView>(home, vs, n,
190 valseqref->seq_size);
191 }
193 return nullptr;
194 }
195
198 VariableMap variableMap) {
199 VariableSymmetryObject* varref =
200 dynamic_cast<VariableSymmetryObject*>(s.ref);
201 ValueSymmetryObject* valref =
202 dynamic_cast<ValueSymmetryObject*>(s.ref);
204 dynamic_cast<VariableSequenceSymmetryObject*>(s.ref);
205 ValueSequenceSymmetryObject* valseqref =
206 dynamic_cast<ValueSequenceSymmetryObject*>(s.ref);
207 if (varref) {
208 int n = varref->nxs;
209 int* indices = home.alloc<int>(n);
210 for (int i = 0 ; i < n ; i++) {
211 VariableMap::const_iterator index = variableMap.find(varref->xs[i]);
212 if (index == variableMap.end())
213 throw LDSBUnbranchedVariable("VariableSymmetryObject::createBool");
214 indices[i] = index->second;
215 }
216 return new (home) VariableSymmetryImp<BoolView>(home, indices, n);
217 }
218 if (valref) {
219 int n = valref->values.size();
220 int *vs = home.alloc<int>(n);
221 int i = 0;
222 for (IntSetValues v(valref->values) ; v() ; ++v) {
223 vs[i] = v.val();
224 i++;
225 }
226 return new (home) ValueSymmetryImp<BoolView>(home, vs, n);
227 }
228 if (varseqref) {
229 int n = varseqref->nxs;
230 int* indices = home.alloc<int>(n);
231 for (int i = 0 ; i < n ; i++) {
232 VariableMap::const_iterator index =
233 variableMap.find(varseqref->xs[i]);
234 if (index == variableMap.end())
235 throw LDSBUnbranchedVariable("VariableSequenceSymmetryObject::createBool");
236 indices[i] = index->second;
237 }
238 return new (home) VariableSequenceSymmetryImp<BoolView>(home, indices,
239 n, varseqref->seq_size);
240 }
241 if (valseqref) {
242 unsigned int n = valseqref->values.size();
243 int *vs = home.alloc<int>(n);
244 for (unsigned int i = 0 ; i < n ; i++)
245 vs[i] = valseqref->values[i];
246 return new (home) ValueSequenceSymmetryImp<BoolView>(home, vs, n,
247 valseqref->seq_size);
248 }
250 return nullptr;
251 }
252}}}
253
254namespace Gecode {
255
256 using namespace Int::LDSB;
257
258 void
259 branch(Home home, const IntVarArgs& x,
260 IntVarBranch vars, IntValBranch vals,
261 const Symmetries& syms,
263 IntVarValPrint vvp) {
264 using namespace Int;
265 if (home.failed()) return;
266 vars.expand(home,x);
267 ViewArray<IntView> xv(home,x);
268 ViewSel<IntView>* vs[1] = {
269 Branch::viewsel(home,vars)
270 };
271 switch (vals.select()) {
278 throw LDSBBadValueSelection("Int::LDSB::branch");
279 break;
281 if (vals.commit())
282 throw LDSBBadValueSelection("Int::LDSB::branch");
283 // If vals.commit() is valid, it means it will commit with
284 // binary branching, which is OK for LDSB, so we
285 // fall through
286 default:
287 // Construct mapping from each variable in the array to its index
288 // in the array.
289 VariableMap variableMap;
290 for (int i = 0 ; i < x.size() ; i++)
291 variableMap[x[i].varimp()] = i;
292
293 // Convert the modelling-level Symmetries object into an array of
294 // SymmetryImp objects.
295 int n = syms.size();
296 SymmetryImp<IntView>** array =
297 static_cast<Space&>(home).alloc<SymmetryImp<IntView>* >(n);
298 for (int i = 0 ; i < n ; i++) {
299 array[i] = createIntSym(home, syms[i], variableMap);
300 }
301
303 (home,xv,vs,Branch::valselcommit(home,vals),
304 array,n,bf,vvp);
305 }
306 }
307
308 void
309 branch(Home home, const IntVarArgs& x,
311 const Symmetries& syms,
313 IntVarValPrint vvp) {
314 using namespace Int;
315 if (home.failed()) return;
316 vars.a.expand(home,x);
317 if ((vars.a.select() == IntVarBranch::SEL_NONE) ||
318 (vars.a.select() == IntVarBranch::SEL_RND))
319 vars.b = INT_VAR_NONE();
320 vars.b.expand(home,x);
321 if ((vars.b.select() == IntVarBranch::SEL_NONE) ||
322 (vars.b.select() == IntVarBranch::SEL_RND))
323 vars.c = INT_VAR_NONE();
324 vars.c.expand(home,x);
325 if ((vars.c.select() == IntVarBranch::SEL_NONE) ||
326 (vars.c.select() == IntVarBranch::SEL_RND))
327 vars.d = INT_VAR_NONE();
328 vars.d.expand(home,x);
329 if (vars.b.select() == IntVarBranch::SEL_NONE) {
330 branch(home,x,vars.a,vals,syms,bf,vvp);
331 } else {
332 // Construct mapping from each variable in the array to its index
333 // in the array.
334 VariableMap variableMap;
335 for (int i = 0 ; i < x.size() ; i++)
336 variableMap[x[i].varimp()] = i;
337
338 // Convert the modelling-level Symmetries object into an array of
339 // SymmetryImp objects.
340 int n = syms.size();
341 SymmetryImp<IntView>** array =
342 static_cast<Space&>(home).alloc<SymmetryImp<IntView>* >(n);
343 for (int i = 0 ; i < n ; i++) {
344 array[i] = createIntSym(home, syms[i], variableMap);
345 }
346
347 ViewArray<IntView> xv(home,x);
348 if (vars.c.select() == IntVarBranch::SEL_NONE) {
349 ViewSel<IntView>* vs[2] = {
350 Branch::viewsel(home,vars.a),Branch::viewsel(home,vars.b)
351 };
352 switch (vals.select()) {
359 throw LDSBBadValueSelection("Int::LDSB::branch");
360 break;
362 if (vals.commit())
363 throw LDSBBadValueSelection("Int::LDSB::branch");
364 // If vals.commit() is valid, it means it will commit with
365 // binary branching, which is OK for LDSB, so we
366 // fall through
367 default:
369 (home,xv,vs,Branch::valselcommit(home,vals),
370 array,n,bf,vvp);
371 }
372 } else if (vars.d.select() == IntVarBranch::SEL_NONE) {
373 ViewSel<IntView>* vs[3] = {
374 Branch::viewsel(home,vars.a),Branch::viewsel(home,vars.b),
375 Branch::viewsel(home,vars.c)
376 };
377 switch (vals.select()) {
384 throw LDSBBadValueSelection("Int::LDSB::branch");
385 break;
387 if (vals.commit())
388 throw LDSBBadValueSelection("Int::LDSB::branch");
389 // If vals.commit() is valid, it means it will commit with
390 // binary branching, which is OK for LDSB, so we
391 // fall through
392 default:
394 (home,xv,vs,Branch::valselcommit(home,vals),
395 array,n,bf,vvp);
396 }
397 } else {
398 ViewSel<IntView>* vs[4] = {
399 Branch::viewsel(home,vars.a),Branch::viewsel(home,vars.b),
400 Branch::viewsel(home,vars.c),Branch::viewsel(home,vars.d)
401 };
402 switch (vals.select()) {
409 throw LDSBBadValueSelection("Int::LDSB::branch");
410 break;
412 if (vals.commit())
413 throw LDSBBadValueSelection("Int::LDSB::branch");
414 // If vals.commit() is valid, it means it will commit with
415 // binary branching, which is OK for LDSB, so we
416 // fall through
417 default:
419 (home,xv,vs,Branch::valselcommit(home,vals),
420 array,n,bf,vvp);
421 }
422 }
423 }
424 }
425
426 void
427 branch(Home home, const BoolVarArgs& x,
428 BoolVarBranch vars, BoolValBranch vals,
429 const Symmetries& syms,
431 BoolVarValPrint vvp) {
432 using namespace Int;
433 if (home.failed()) return;
434 vars.expand(home,x);
435 ViewArray<BoolView> xv(home,x);
436 ViewSel<BoolView>* vs[1] = {
437 Branch::viewsel(home,vars)
438 };
439
440 // Construct mapping from each variable in the array to its index
441 // in the array.
442 VariableMap variableMap;
443 for (int i = 0 ; i < x.size() ; i++)
444 variableMap[x[i].varimp()] = i;
445
446 // Convert the modelling-level Symmetries object into an array of
447 // SymmetryImp objects.
448 int n = syms.size();
449 SymmetryImp<BoolView>** array =
450 static_cast<Space&>(home).alloc<SymmetryImp<BoolView>* >(n);
451 for (int i = 0 ; i < n ; i++) {
452 array[i] = createBoolSym(home, syms[i], variableMap);
453 }
454
455 // Technically these "bad" value selection could in fact work with
456 // LDSB, because they degenerate to binary splitting for
457 // Booleans. Nonetheless, we explicitly forbid them for
458 // consistency with the integer version.
459 switch (vals.select()) {
461 if (vals.commit())
462 throw LDSBBadValueSelection("Int::LDSB::branch");
463 // If vals.commit() is valid, it means it will commit with
464 // binary branching, which is OK for LDSB, so we
465 // fall through
466 default:
468 (home,xv,vs,Branch::valselcommit(home,vals),array,n,bf,vvp);
469 }
470 }
471
472
473 void
474 branch(Home home, const BoolVarArgs& x,
476 const Symmetries& syms,
478 BoolVarValPrint vvp) {
479 using namespace Int;
480 if (home.failed()) return;
481 vars.a.expand(home,x);
482 if ((vars.a.select() == BoolVarBranch::SEL_NONE) ||
483 (vars.a.select() == BoolVarBranch::SEL_RND))
484 vars.b = BOOL_VAR_NONE();
485 vars.b.expand(home,x);
486 if ((vars.b.select() == BoolVarBranch::SEL_NONE) ||
487 (vars.b.select() == BoolVarBranch::SEL_RND))
488 vars.c = BOOL_VAR_NONE();
489 vars.c.expand(home,x);
490 if ((vars.c.select() == BoolVarBranch::SEL_NONE) ||
491 (vars.c.select() == BoolVarBranch::SEL_RND))
492 vars.d = BOOL_VAR_NONE();
493 vars.d.expand(home,x);
494 if (vars.b.select() == BoolVarBranch::SEL_NONE) {
495 branch(home,x,vars.a,vals,syms,bf,vvp);
496 } else {
497 // Construct mapping from each variable in the array to its index
498 // in the array.
499 VariableMap variableMap;
500 for (int i = 0 ; i < x.size() ; i++)
501 variableMap[x[i].varimp()] = i;
502
503 // Convert the modelling-level Symmetries object into an array of
504 // SymmetryImp objects.
505 int n = syms.size();
506 SymmetryImp<BoolView>** array =
507 static_cast<Space&>(home).alloc<SymmetryImp<BoolView>* >(n);
508 for (int i = 0 ; i < n ; i++) {
509 array[i] = createBoolSym(home, syms[i], variableMap);
510 }
511
512 // Technically these "bad" value selection could in fact work with
513 // LDSB, because they degenerate to binary splitting for
514 // Booleans. Nonetheless, we explicitly forbid them for
515 // consistency with the integer version.
516 switch (vals.select()) {
518 if (vals.commit())
519 throw LDSBBadValueSelection("Int::LDSB::branch");
520 // If vals.commit() is valid, it means it will commit with
521 // binary branching, which is OK for LDSB, so we
522 // fall through
523 default:
524 ;
525 // Do nothing and continue.
526 }
527
528 ViewArray<BoolView> xv(home,x);
530 vsc = Branch::valselcommit(home,vals);
531 if (vars.c.select() == BoolVarBranch::SEL_NONE) {
532 ViewSel<BoolView>* vs[2] = {
533 Branch::viewsel(home,vars.a),Branch::viewsel(home,vars.b)
534 };
535 postldsbbrancher<BoolView,2,int,2>(home,xv,vs,vsc,array,n,bf,vvp);
536 } else if (vars.d.select() == BoolVarBranch::SEL_NONE) {
537 ViewSel<BoolView>* vs[3] = {
538 Branch::viewsel(home,vars.a),Branch::viewsel(home,vars.b),
539 Branch::viewsel(home,vars.c)
540 };
541 postldsbbrancher<BoolView,3,int,2>(home,xv,vs,vsc,array,n,bf,vvp);
542 } else {
543 ViewSel<BoolView>* vs[4] = {
544 Branch::viewsel(home,vars.a),Branch::viewsel(home,vars.b),
545 Branch::viewsel(home,vars.c),Branch::viewsel(home,vars.d)
546 };
547 postldsbbrancher<BoolView,4,int,2>(home,xv,vs,vsc,array,n,bf,vvp);
548 }
549 }
550 }
551
552}
553
554
555
556// STATISTICS: int-branch
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1597
Argument array for non-primitive types.
Definition array.hpp:695
Which values to select for branching first.
Definition int.hh:5235
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5242
Select select(void) const
Return selection strategy.
Definition val.hpp:124
Passing Boolean variables.
Definition int.hh:738
Which Boolean variable to select for branching.
Definition int.hh:5002
void expand(Home home, const BoolVarArgs &x)
Expand decay factor into AFC or action.
Definition var.hpp:345
@ SEL_RND
Random (uniform, for tie breaking).
Definition int.hh:5007
@ SEL_NONE
First unassigned.
Definition int.hh:5006
Home class for posting propagators
Definition core.hpp:863
bool failed(void) const
Check whether corresponding space is failed.
Definition core.hpp:4185
Passing integer arguments.
Definition int.hh:652
Value iterator for integer sets.
Definition int.hh:351
Integer sets.
Definition int.hh:178
unsigned int size(void) const
Return size (cardinality) of set.
Which values to select for branching first.
Definition int.hh:5200
@ SEL_VALUES_MIN
Select all values starting from smallest.
Definition int.hh:5213
@ SEL_SPLIT_MAX
Select values greater than mean of smallest and largest value.
Definition int.hh:5209
@ SEL_RANGE_MAX
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition int.hh:5211
@ SEL_RANGE_MIN
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition int.hh:5210
@ SEL_VALUES_MAX
Select all values starting from largest.
Definition int.hh:5214
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5212
@ SEL_SPLIT_MIN
Select values not greater than mean of smallest and largest value.
Definition int.hh:5208
Select select(void) const
Return selection strategy.
Definition val.hpp:49
Passing integer variables.
Definition int.hh:680
Which integer variable to select for branching.
Definition int.hh:4916
void expand(Home home, const IntVarArgs &x)
Expand AFC, action, and CHB.
Definition var.hpp:74
@ SEL_RND
Random (uniform, for tie breaking).
Definition int.hh:4921
@ SEL_NONE
First unassigned.
Definition int.hh:4920
Integer variables.
Definition int.hh:389
int min(void) const
Return minimum of domain.
Definition int.hpp:62
int max(void) const
Return maximum of domain.
Definition int.hpp:70
Exception: Value selection incompatible with LDSB
Exception: Variable in symmetry not branched on
Implementation of a single symmetry.
Definition ldsb.hh:162
Implementation of a value sequence symmetry.
Definition ldsb.hh:266
Implementation of a value sequence symmetry at the modelling level.
Definition ldsb.hh:150
IntArgs values
Array of values in symmetry.
Definition ldsb.hh:153
int seq_size
Size of each sequence in symmetry.
Definition ldsb.hh:155
Implementation of a value symmetry.
Definition ldsb.hh:204
Implementation of a value symmetry at the modelling level.
Definition ldsb.hh:128
IntSet values
Set of symmetric values.
Definition ldsb.hh:131
Map from variable implementation to index.
Definition ldsb.cpp:130
Implementation of a variable sequence symmetry.
Definition ldsb.hh:224
Implementation of a variable sequence symmetry at the modelling level.
Definition ldsb.hh:136
int seq_size
Size of each sequence in symmetry.
Definition ldsb.hh:143
int nxs
Number of variables in symmetry.
Definition ldsb.hh:141
VarImpBase ** xs
Array of variables in symmetry.
Definition ldsb.hh:139
Implementation of a variable symmetry.
Definition ldsb.hh:183
Implementation of a variable symmetry at the modelling level.
Definition ldsb.hh:116
int nxs
Number of variables in symmetry.
Definition ldsb.hh:121
VarImpBase ** xs
Array of variables in symmetry.
Definition ldsb.hh:119
Computation spaces.
Definition core.hpp:1775
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Definition core.hpp:2901
Collection of symmetries.
Definition int.hh:5638
A reference-counted pointer to a SymmetryObject.
Definition int.hh:5601
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition int.hh:5604
Combine variable selection criteria for tie-breaking.
Definition tiebreak.hpp:38
VarBranch a
Branching criteria to try in order.
Definition tiebreak.hpp:41
BranchCommit commit(void) const
Return commit function.
Definition val.hpp:102
Base class for value selection and commit.
View arrays.
Definition array.hpp:255
Abstract class for view selection.
Definition view-sel.hpp:44
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Branch over x with variable selection vars and value selection vals.
Definition branch.cpp:39
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition int.hh:4510
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
Definition int.hh:4520
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
Definition view-sel.cpp:39
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
Symmetry breaking for integer variables.
Definition int.hh:5592
std::pair< int, int > findVar(int *indices, unsigned int n_values, unsigned int seq_size, int index)
Find the location of an integer in a collection of sequences.
Definition ldsb.cpp:42
SymmetryImp< BoolView > * createBoolSym(Space &home, const SymmetryHandle &s, VariableMap variableMap)
Create a boolean symmetry implementation from a symmetry handle.
Definition ldsb.cpp:197
void postldsbbrancher(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)
Post LDSB brancher.
Definition brancher.hpp:275
SymmetryImp< IntView > * createIntSym(Space &home, const SymmetryHandle &s, VariableMap variableMap)
Create an integer symmetry implementation from a symmetry handle.
Definition ldsb.cpp:140
Finite domain integers.
Definition lastval.hh:52
Gecode toplevel namespace
SymmetryHandle ValueSymmetry(const IntArgs &v)
Values in v are interchangeable.
Definition ldsb.cpp:81
SymmetryHandle ValueSequenceSymmetry(const IntArgs &v, int ss)
Value sequences in v of size ss are interchangeable.
Definition ldsb.cpp:102
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
Definition ldsb.cpp:106
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:96
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:364
std::function< void(const Space &home, const Brancher &b, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)> IntVarValPrint
Function type for printing branching alternatives for integer variables.
Definition int.hh:4898
SymmetryHandle VariableSymmetry(const IntVarArgs &x)
Variables in x are interchangeable.
Definition ldsb.cpp:62
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &x, int ss)
Variable sequences in x of size ss are interchangeable.
Definition ldsb.cpp:90
std::function< void(const Space &home, const Brancher &b, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)> BoolVarValPrint
Function type for printing branching alternatives for Boolean variables.
Definition int.hh:4905
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56