Generated on Sun Aug 9 2020 05:34:08 for Gecode by doxygen 1.8.18
ldsb.hh
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.org
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 #ifndef __GECODE_SET_LDSB_HH__
35 #define __GECODE_SET_LDSB_HH__
36 
37 #include <gecode/set.hh>
38 #include <gecode/int/ldsb.hh>
39 
44 namespace Gecode { namespace Set { namespace LDSB {
45 
46  using namespace Int::LDSB;
47 
56  template<class View, int n, class Val, unsigned int a,
57  class Filter, class Print>
58  class LDSBSetBrancher : public LDSBBrancher<View,n,Val,a,Filter,Print> {
59  public:
62  int _prevPos;
82  bool _stable;
83 
89  ViewSel<View>* vs[n],
91  SymmetryImp<View>** syms, int nsyms,
95  virtual const Choice* choice(Space& home);
97  virtual ExecStatus commit(Space& home, const Choice& c, unsigned int b);
99  virtual Actor* copy(Space& home);
101  static void post(Home home,
103  ViewSel<View>* vs[n],
105  SymmetryImp<View>** _syms,
106  int _nsyms,
109 
111  template<class View0, int n0, class Val0, unsigned int a0>
114  ViewSel<View0>* vs[n0],
116  SymmetryImp<View0>** syms, int nsyms,
119 
128  void updatePart1(Space& home, int choicePos);
129  };
130 
131 }}}
132 
133 namespace Gecode { namespace Int { namespace LDSB {
134 
135  template <>
136  ArgArray<Literal>
139 
140 }}}
141 
143 
144 #endif
145 
146 // STATISTICS: set-branch
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Definition: filter.hpp:41
Post propagator for SetVar x
Definition: set.hh:767
Implementation of a value symmetry.
Definition: ldsb.hh:204
Symmetry-breaking brancher with generic view and value selection.
Definition: ldsb.hh:58
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Definition: sym-imp.hpp:226
Computation spaces.
Definition: core.hpp:1742
Base-class for both propagators and branchers.
Definition: core.hpp:628
ValueSymmetryImp< View > ** _copiedSyms
Copy of value symmetries from the first node where the current variable was branched on.
Definition: ldsb.hh:69
Gecode toplevel namespace
Integer sets.
Definition: int.hh:174
Home class for posting propagators
Definition: core.hpp:856
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Definition: filter.cpp:138
int _nValueSymmetries
Number of value symmetries.
Definition: ldsb.hh:66
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int _prevPos
Position of previous variable that was branched on.
Definition: ldsb.hh:62
A Literal is a pair of variable index and value.
Definition: ldsb.hh:46
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
int _nNonValueSymmetries
Number of non-value symmetries.
Definition: ldsb.hh:64
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
LDSBSetBrancher(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)
Constructor for creation.
bool _stable
Is the state of the brancher "stable"?
Definition: ldsb.hh:82
Symmetry-breaking brancher with generic view and value selection.
Definition: ldsb.hh:332
int _nCopiedSyms
Number of copied symmetries.
Definition: ldsb.hh:71
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.
Gecode::FloatVal c(-8, 8)
View arrays.
Definition: array.hpp:253
Implementation of a single symmetry.
Definition: ldsb.hh:162
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
Choice for performing commit
Definition: core.hpp:1412
IntSet _leftBranchValues
Set of values used on left branches for the current variable.
Definition: ldsb.hh:73
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.
Definition: print.hpp:43
ExecStatus
Definition: core.hpp:472